|
13 | 13 | * See the License for the specific language governing permissions and |
14 | 14 | * limitations under the License. |
15 | 15 | */ |
16 | | -package app.packed.concurrent.job2; |
17 | | - |
18 | | -import java.lang.annotation.Annotation; |
19 | | -import java.time.Duration; |
| 16 | +package app.packed.concurrent; |
20 | 17 |
|
21 | 18 | import app.packed.bean.BeanConfiguration; |
22 | | -import app.packed.bean.scanning.BeanIntrospector; |
23 | | -import app.packed.binding.Key; |
24 | | -import app.packed.concurrent.annotations.ScheduleJob; |
25 | | -import app.packed.concurrent.job2.impl.ScheduledOperationHandle; |
26 | | -import app.packed.concurrent.other.SchedulingContext; |
27 | 19 | import app.packed.extension.ExtensionHandle; |
28 | 20 | import app.packed.extension.ExtensionPoint; |
29 | 21 | import app.packed.extension.ExtensionPoint.ExtensionPointHandle; |
30 | 22 | import app.packed.extension.FrameworkExtension; |
31 | | -import internal.app.packed.concurrent.ScheduleImpl; |
32 | 23 | import internal.app.packed.concurrent.SchedulingTaskManager; |
33 | | -import internal.app.packed.concurrent.ThreadNamespaceHandle; |
34 | 24 |
|
35 | 25 | /** |
36 | 26 | * This extension allows for multiple threads within an application. |
@@ -83,41 +73,6 @@ BeanConfiguration newSchedulingBean() { |
83 | 73 | // throw new UnsupportedOperationException(); |
84 | 74 | // } |
85 | 75 |
|
86 | | - public static class MyI extends BeanIntrospector<JobExtension> { |
87 | | - |
88 | | - @Override |
89 | | - public void onExtensionService(Key<?> key, OnContextService service) { |
90 | | - OnVariableUnwrapped binding = service.binder(); |
91 | | - |
92 | | - Class<?> hook = key.rawType(); |
93 | | - if (hook == SchedulingContext.class) { |
94 | | - binding.bindInvocationArgument(1); |
95 | | - } else { |
96 | | - super.onExtensionService(key, service); |
97 | | - } |
98 | | - } |
99 | | - |
100 | | - @Override |
101 | | - public void onAnnotatedMethod(Annotation hook, BeanIntrospector.OnMethod on) { |
102 | | - if (hook instanceof ScheduleJob schedule) { |
103 | | - // Parse the schedule |
104 | | - ScheduleImpl s = new ScheduleImpl(Duration.ofMillis(schedule.withFixedDelay())); |
105 | | - |
106 | | - // Find the namespace we are installing the operation into |
107 | | - ThreadNamespaceHandle namespace = null;// main(); |
108 | | - |
109 | | - // Install the operation |
110 | | - ScheduledOperationHandle h = on.newOperation(ScheduledOperationHandle.SCHEDULING_OPERATION_TEMPLATE).install(namespace, |
111 | | - ScheduledOperationHandle::new); |
112 | | - |
113 | | - // Configure the handle |
114 | | - h.s = s; |
115 | | - } else { |
116 | | - super.onAnnotatedMethod(hook, on); |
117 | | - } |
118 | | - } |
119 | | - } |
120 | | - |
121 | 76 | /** {@inheritDoc} */ |
122 | 77 | @Override |
123 | 78 | protected ExtensionPoint<JobExtension> newExtensionPoint(ExtensionPointHandle usesite) { |
|
0 commit comments