Skip to content

Commit e5036cb

Browse files
committed
ea
a
1 parent fd62902 commit e5036cb

File tree

258 files changed

+3387
-2411
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

258 files changed

+3387
-2411
lines changed

modules/packed-incubator/packed-incubator-cli/src/main/java/app/packed/cli/CliCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import java.lang.annotation.RetentionPolicy;
2222
import java.lang.annotation.Target;
2323

24-
import app.packed.bean.BeanTrigger.AnnotatedMethodBeanTrigger;
24+
import app.packed.bean.scanning.BeanTrigger.AnnotatedMethodBeanTrigger;
2525
import app.packed.namespace.sandbox.NamespaceOperation;
2626

2727
/**

modules/packed-incubator/packed-incubator-cli/src/main/java/app/packed/cli/CliExtension.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
import java.util.function.Consumer;
2121

2222
import app.packed.assembly.Assembly;
23-
import app.packed.bean.BeanElement.BeanMethod;
24-
import app.packed.bean.BeanIntrospector;
23+
import app.packed.bean.scanning.BeanIntrospector;
24+
import app.packed.bean.scanning.BeanElement.BeanMethod;
2525
import app.packed.bean.InstanceBeanConfiguration;
2626
import app.packed.container.ContainerBuildLocal;
2727
import app.packed.container.ContainerConfiguration;
@@ -69,7 +69,7 @@ public <T> InstanceBeanConfiguration<T> newBean(Class<T> beanClass) {
6969
}
7070

7171
CliNamespaceHandle ns() {
72-
return applicationRoot().namespaceLazy(CliNamespaceHandle.TEMPLATE, "main", c -> c.install(CliNamespaceHandle::new));
72+
return applicationRoot().namespaceLazy(CliNamespaceHandle.TEMPLATE, "main");
7373
}
7474

7575
/** {@inheritDoc} */
@@ -79,11 +79,11 @@ protected BeanIntrospector newBeanIntrospector() {
7979

8080
/** {@inheritDoc} */
8181
@Override
82-
public void onAnnotatedMethod(Annotation hook, BeanMethod method) {
82+
public void onAnnotatedMethod(BeanMethod method, Annotation hook) {
8383
if (hook instanceof CliCommand c) {
8484
ns().process(CliExtension.this, c, method);
8585
} else {
86-
super.onAnnotatedMethod(hook, method);
86+
super.onAnnotatedMethod(method, hook);
8787
}
8888
}
8989
};

modules/packed-incubator/packed-incubator-cli/src/main/java/app/packed/cli/CliNamespaceConfiguration.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.util.function.Consumer;
1919

2020
import app.packed.build.BuildActor;
21+
import app.packed.namespace.NamespaceBuildHook;
2122
import app.packed.namespace.NamespaceConfiguration;
2223

2324
/**
@@ -40,4 +41,9 @@ public CliCommandConfiguration addCliCommand(Consumer<CliCommandContext> action)
4041
throw new UnsupportedOperationException();
4142
}
4243

44+
public static NamespaceBuildHook<CliNamespaceConfiguration> pushToNewApplication(boolean inheritExistingConfiguration, Consumer<? super CliNamespaceConfiguration> c) {
45+
throw new UnsupportedOperationException();
46+
}
47+
48+
4349
}

modules/packed-incubator/packed-incubator-cli/src/main/java/app/packed/cli/CliNamespaceHandle.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
import java.util.LinkedHashMap;
1919

20-
import app.packed.bean.BeanElement.BeanMethod;
2120
import app.packed.bean.BeanInstallationException;
21+
import app.packed.bean.scanning.BeanElement.BeanMethod;
2222
import app.packed.build.BuildActor;
2323
import app.packed.namespace.NamespaceHandle;
2424
import app.packed.namespace.NamespaceInstaller;
@@ -31,12 +31,12 @@
3131
final class CliNamespaceHandle extends NamespaceHandle<CliExtension, CliNamespaceConfiguration> {
3232

3333
/** The default namespace template. */
34-
static final NamespaceTemplate TEMPLATE = NamespaceTemplate.of(CliNamespaceHandle.class, c -> {});
34+
static final NamespaceTemplate<CliNamespaceHandle> TEMPLATE = NamespaceTemplate.of(CliNamespaceHandle.class, CliNamespaceHandle::new, c -> {});
3535

3636
/** All the commands within the namespace. */
3737
final LinkedHashMap<String, CliCommandHandle> oldCommands = new LinkedHashMap<>();
3838

39-
CliNamespaceHandle(NamespaceInstaller installer) {
39+
CliNamespaceHandle(NamespaceInstaller<?> installer) {
4040
super(installer);
4141
}
4242

modules/packed-incubator/packed-incubator-concurrent/src/main/java/app/packed/concurrent/Daemon.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import java.lang.annotation.RetentionPolicy;
2121
import java.lang.annotation.Target;
2222

23-
import app.packed.bean.BeanTrigger.AnnotatedMethodBeanTrigger;
23+
import app.packed.bean.scanning.BeanTrigger.AnnotatedMethodBeanTrigger;
2424

2525
/**
2626
* Will have a dedicated thread.

modules/packed-incubator/packed-incubator-concurrent/src/main/java/app/packed/concurrent/DaemonOperationHandle.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package app.packed.concurrent;
1717

1818
import app.packed.operation.OperationInstaller;
19-
import internal.app.packed.concurrent.ScheduledDaemon;
2019

2120
/** An operation handle for a daemon operation. */
2221
final class DaemonOperationHandle extends ThreadedOperationHandle<DaemonOperationConfiguration> {
@@ -40,8 +39,4 @@ protected DaemonOperationConfiguration newOperationConfiguration() {
4039
public DaemonOperationMirror newOperationMirror() {
4140
return new DaemonOperationMirror(this);
4241
}
43-
44-
ScheduledDaemon schedule() {
45-
return new ScheduledDaemon(useVirtual, generateMethodHandle());
46-
}
4742
}

modules/packed-incubator/packed-incubator-concurrent/src/main/java/app/packed/concurrent/ScheduleRecurrent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import java.lang.annotation.RetentionPolicy;
2121
import java.lang.annotation.Target;
2222

23-
import app.packed.bean.BeanTrigger.AnnotatedMethodBeanTrigger;
23+
import app.packed.bean.scanning.BeanTrigger.AnnotatedMethodBeanTrigger;
2424

2525
/**
2626
*

modules/packed-incubator/packed-incubator-concurrent/src/main/java/app/packed/concurrent/ScheduledOperationHandle.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import app.packed.operation.OperationInstaller;
1919
import app.packed.util.Nullable;
2020
import internal.app.packed.concurrent.ScheduleImpl;
21-
import internal.app.packed.concurrent.ScheduledOperation;
2221

2322
/**
2423
*
@@ -45,12 +44,11 @@ protected ScheduledOperationMirror newOperationMirror() {
4544
return new ScheduledOperationMirror(this);
4645
}
4746

48-
ScheduledOperation schedule() {
47+
@Override
48+
protected void onClose() {
4949
/// Called from a code generation thread
5050
if (s == null) {
5151
throw new IllegalStateException("Operation " + this + " was never scheduled");
5252
}
53-
return new ScheduledOperation(s, generateMethodHandle());
5453
}
55-
5654
}

modules/packed-incubator/packed-incubator-concurrent/src/main/java/app/packed/concurrent/ThreadExtension.java

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
import java.util.function.Consumer;
2222

2323
import app.packed.bean.BeanConfiguration;
24-
import app.packed.bean.BeanElement.BeanMethod;
25-
import app.packed.bean.BeanIntrospector;
24+
import app.packed.bean.scanning.BeanElement.BeanMethod;
25+
import app.packed.bean.scanning.BeanIntrospector;
2626
import app.packed.binding.Key;
2727
import app.packed.binding.UnwrappedBindableVariable;
2828
import app.packed.context.Context;
@@ -79,16 +79,11 @@ public class ThreadExtension extends FrameworkExtension<ThreadExtension> {
7979
static final OperationTemplate DAEMON_OPERATION_TEMPLATE = OperationTemplate.defaults()
8080
.reconfigure(c -> c.inContext(DAEMON_CONTEXT_TEMPLATE).returnIgnore());
8181

82-
private BeanConfiguration schedulingBean;
83-
8482
/** Creates a new thread extension. */
8583

86-
BeanConfiguration initSchedulingBean() {
87-
BeanConfiguration b = schedulingBean;
88-
if (b == null) {
89-
b = schedulingBean = provide(SchedulingTaskManager.class);
90-
b.bindServiceInstance(ExecutorConfiguration.class, main().scheduler);
91-
}
84+
BeanConfiguration newSchedulingBean() {
85+
BeanConfiguration b = provide(SchedulingTaskManager.class);
86+
b.bindServiceInstance(ExecutorConfiguration.class, main().scheduler);
9287
return b;
9388
}
9489

@@ -118,7 +113,7 @@ public void onContextualServiceProvision(Key<?> key, Class<?> actualHook, Set<Cl
118113
}
119114

120115
@Override
121-
public void onAnnotatedMethod(Annotation hook, BeanMethod on) {
116+
public void onAnnotatedMethod(BeanMethod on, Annotation hook) {
122117
if (hook instanceof ScheduleRecurrent schedule) {
123118
// Parse the schedule
124119
ScheduleImpl s = new ScheduleImpl(Duration.ofMillis(schedule.millies()));
@@ -141,7 +136,7 @@ public void onAnnotatedMethod(Annotation hook, BeanMethod on) {
141136
// Configure the handle
142137
h.useVirtual = daemon.useVirtual();
143138
} else {
144-
super.onAnnotatedMethod(hook, on);
139+
super.onAnnotatedMethod(on, hook);
145140
}
146141
}
147142
};
@@ -157,7 +152,7 @@ public ThreadNamespaceConfiguration namespace() {
157152
}
158153

159154
private ThreadNamespaceHandle main() {
160-
return namespaceLazy(ThreadNamespaceHandle.TEMPLATE, "main", c -> c.install(ThreadNamespaceHandle::new));
155+
return namespaceLazy(ThreadNamespaceHandle.TEMPLATE, "main");
161156
}
162157

163158
/** {@inheritDoc} */

modules/packed-incubator/packed-incubator-concurrent/src/main/java/app/packed/concurrent/ThreadExtensionMirror.java

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)