Skip to content

Commit 49bc145

Browse files
committed
wer
1 parent 27c8683 commit 49bc145

File tree

15 files changed

+39
-57
lines changed

15 files changed

+39
-57
lines changed

modules/packed/src/main/java/app/packed/application/repository/other/GuestLauncher.java renamed to modules/packed/src/main/java/app/packed/application/repository/ApplicationLauncher.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package app.packed.application.repository.other;
16+
package app.packed.application.repository;
1717

18+
import app.packed.application.repository.other.ManagedInstance;
1819
import app.packed.container.Wirelet;
1920
import app.packed.runtime.RunState;
2021

2122
// Kune maaske shares med container
22-
public interface GuestLauncher<I> {
23+
// Skal have lidt mere koedt paa en bare saette et navn syntes jegT
24+
public interface ApplicationLauncher<I> {
2325

2426
/**
2527
* Initializes a new application instance.
@@ -40,12 +42,12 @@ public interface GuestLauncher<I> {
4042
*/
4143
ManagedInstance<I> launch(Wirelet... wirelets);
4244

43-
/**
45+
/**s
4446
* Names the application instance to be launched.
4547
*
4648
* @param instanceName
4749
* the name of the application instance
4850
* @return this launcher
4951
*/
50-
GuestLauncher<I> named(String instanceName);
52+
ApplicationLauncher<I> named(String instanceName);
5153
}

modules/packed/src/main/java/app/packed/application/repository/ApplicationRepositoryBeanHandle.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ protected ApplicationRepositoryConfiguration<I, H> newBeanConfiguration() {
5858
@Override
5959
protected void onConfigurationClosed() {
6060
bindServiceInstance(BuildApplicationRepository.class, repository);
61-
BeanSetup.crack(this).container.application.subChildren.add(repository);
61+
BeanSetup.crack(this).container.application.childApplications.add(repository);
6262
}
6363
}

modules/packed/src/main/java/app/packed/application/repository/ApplicationRepositoryExtension.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ public final class ApplicationRepositoryExtension extends Extension<ApplicationR
5757
// Ved ikke om det har noget med repository at goere. Det tror jeg egentlig ikke...
5858
// Altsaa hvorfor ikke bare have en extension der exposer nogle beans?
5959
// Saa maa de selv om de vil bruge Packed
60-
public void buildDependecy(Consumer<? super ApplicationInstaller<?>> installer) {
60+
61+
// Maybe you want an image???
62+
public void newDependecy(Consumer<? super ApplicationInstaller<?>> installer) {
6163
throw new UnsupportedOperationException();
6264
}
6365

modules/packed/src/main/java/app/packed/application/repository/InstalledApplication.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.util.stream.Stream;
2020

2121
import app.packed.application.ApplicationHandle;
22-
import app.packed.application.repository.other.GuestLauncher;
2322
import app.packed.application.repository.other.ManagedInstance;
2423
import app.packed.container.Wirelet;
2524
import internal.app.packed.application.repository.PackedInstalledApplication;
@@ -55,7 +54,7 @@ public sealed interface InstalledApplication<I> permits PackedInstalledApplicati
5554

5655
boolean isManaged();
5756

58-
GuestLauncher<I> launcher();
57+
ApplicationLauncher<I> launcher();
5958

6059
I startNew(Wirelet... wirelets);
6160

modules/packed/src/main/java/app/packed/application/repository/InstalledApplicationHandle.java

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,18 @@
1515
*/
1616
package app.packed.application.repository;
1717

18-
import app.packed.application.ApplicationHandle;
1918
import app.packed.bean.BeanHandle;
2019
import app.packed.bean.BeanInstaller;
2120
import app.packed.bean.BeanKind;
2221
import app.packed.bean.BeanTemplate;
2322
import app.packed.service.ProvidableBeanConfiguration;
24-
import internal.app.packed.application.PackedApplicationTemplate;
2523
import internal.app.packed.bean.PackedBeanTemplate;
26-
import internal.app.packed.build.AuthoritySetup;
27-
import internal.app.packed.extension.ExtensionSetup;
2824

29-
/**
30-
*
31-
*/
32-
final class InstalledApplicationHandle<T> extends BeanHandle<ProvidableBeanConfiguration<T>>{
25+
/** A handle for an installed application. */
26+
final class InstalledApplicationHandle<T> extends BeanHandle<ProvidableBeanConfiguration<T>> {
27+
28+
@SuppressWarnings("unused")
29+
private static final PackedBeanTemplate REPOSITORY_BEAN_TEMPLATE = (PackedBeanTemplate) BeanTemplate.of(BeanKind.CONTAINER);
3330

3431
/**
3532
* @param installer
@@ -38,24 +35,4 @@ public InstalledApplicationHandle(BeanInstaller installer) {
3835
super(installer);
3936
}
4037

41-
@SuppressWarnings("unused")
42-
private static final PackedBeanTemplate REPOSITORY_BEAN_TEMPLATE = (PackedBeanTemplate) BeanTemplate.of(BeanKind.CONTAINER,
43-
b -> {});
44-
45-
46-
static <A, H extends ApplicationHandle<A, ?>> ProvidableBeanConfiguration<InstalledApplication<A>> install(PackedApplicationTemplate<H> template, ExtensionSetup es,
47-
AuthoritySetup<?> owner) {
48-
49-
throw new UnsupportedOperationException();
50-
51-
// Install a ApplicationRepository
52-
// ApplicationRepositoryHandle<A, H> h = REPOSITORY_BEAN_TEMPLATE.newInstaller(es, owner)
53-
// .install(AbstractApplicationRepository.repositoryClassFor(template), i -> new ApplicationRepositoryHandle<>(i, template));
54-
//
55-
// // Create a new installer for the guest bean
56-
// BeanInstaller i = PackedApplicationTemplate.GB.newInstaller(es, owner);
57-
// template.installGuestBean(i, h.repository::onCodeGenerated);
58-
//
59-
// return h.configuration();
60-
}
6138
}

modules/packed/src/main/java/app/packed/component/guest/usage/AaaaDoo.java renamed to modules/packed/src/main/java/app/packed/application/repository/usage/AaaaDoo.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package app.packed.component.guest.usage;
16+
package app.packed.application.repository.usage;
1717

1818
import java.util.concurrent.atomic.AtomicLong;
1919

2020
import app.packed.application.App;
2121
import app.packed.application.repository.ApplicationRepository;
2222
import app.packed.application.repository.ApplicationRepositoryConfiguration;
2323
import app.packed.application.repository.ApplicationRepositoryExtension;
24+
import app.packed.application.repository.usage.SimpleManagedApplication.GuestApplicationHandle;
2425
import app.packed.assembly.BaseAssembly;
2526
import app.packed.bean.lifecycle.Initialize;
26-
import app.packed.component.guest.usage.SimpleManagedApplication.GuestApplicationHandle;
2727

2828
/**
2929
*

modules/packed/src/main/java/app/packed/component/guest/usage/AaaaDoo3.java renamed to modules/packed/src/main/java/app/packed/application/repository/usage/AaaaDoo3.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package app.packed.component.guest.usage;
16+
package app.packed.application.repository.usage;
1717

1818
import app.packed.application.App;
1919
import app.packed.application.repository.InstalledApplication;

modules/packed/src/main/java/app/packed/component/guest/usage/SimpleManagedApplication.java renamed to modules/packed/src/main/java/app/packed/application/repository/usage/SimpleManagedApplication.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package app.packed.component.guest.usage;
16+
package app.packed.application.repository.usage;
1717

1818
import java.util.concurrent.CompletableFuture;
1919
import java.util.concurrent.TimeUnit;
@@ -36,7 +36,7 @@
3636
*/
3737
public record SimpleManagedApplication(@FromComponentGuest ManagedLifecycle lifecycle, long nanos) implements ManagedLifecycle {
3838

39-
// Problemet er vi skal definere en Handle Class...
39+
// Problemet er vi skal definere en Handle Class... Der har <I> = ManagedLifecycle
4040
// Men syntes ogsaa det er fint at folk skal lave en guest bean
4141
public static final ApplicationTemplate<GuestApplicationHandle2> MANAGED = ApplicationTemplate
4242
.ofManaged(new Op1<@FromComponentGuest ManagedLifecycle, ManagedLifecycle>(e -> e) {}, GuestApplicationHandle2.class, GuestApplicationHandle2::new);

modules/packed/src/main/java/app/packed/component/guest/usage/SubApplication.java renamed to modules/packed/src/main/java/app/packed/application/repository/usage/SubApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package app.packed.component.guest.usage;
16+
package app.packed.application.repository.usage;
1717

1818
import app.packed.assembly.BaseAssembly;
1919
import app.packed.bean.lifecycle.Initialize;

modules/packed/src/main/java/internal/app/packed/application/ApplicationSetup.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public final class ApplicationSetup implements BuildLocalSource, ComponentSetup
5454
@Nullable
5555
private ArrayList<Runnable> codegenActions;
5656

57-
/** Components tags on components in the application. */
57+
/** Handles components tags for every components in the application. */
5858
public final ComponentTagHolder componentTags = new ComponentTagHolder();
5959

6060
/**
@@ -100,16 +100,14 @@ public final class ApplicationSetup implements BuildLocalSource, ComponentSetup
100100
public final HashMap<NamespaceKey, NamespaceHandle<?, ?>> namespaces = new HashMap<>();
101101

102102
/** The current phase of the application's build process. */
103-
private ApplicationBuildPhase phase = ApplicationBuildPhase.ASSEMBLE;
103+
public ApplicationBuildPhase phase = ApplicationBuildPhase.ASSEMBLE;
104104

105105
/** Any (statically defined) children this application has. */
106-
public final ArrayList<BuildApplicationRepository> subChildren = new ArrayList<>();
106+
public final ArrayList<BuildApplicationRepository> childApplications = new ArrayList<>();
107107

108108
/** The template used to create the application. */
109109
public final PackedApplicationTemplate<?> template;
110110

111-
public boolean completedBuilding;
112-
113111
/**
114112
* Create a new application.
115113
*
@@ -121,7 +119,7 @@ private ApplicationSetup(PackedApplicationInstaller<?> installer) {
121119
this.deployment = new DeploymentSetup(this, installer);
122120
this.codegenActions = deployment.goal.isCodeGenerating() ? new ArrayList<>() : null;
123121
this.goal = installer.buildProcess.goal();
124-
this.launcher = installer.launcher; // Is null for rootstrap
122+
this.launcher = installer.launcher; // Is null for bootstrap
125123
}
126124

127125
/**
@@ -176,7 +174,8 @@ public void close() {
176174
}
177175

178176
// The application was build successfully
179-
phase = ApplicationBuildPhase.COMPLETED;
177+
phase = ApplicationBuildPhase.CLOSED;
178+
new Exception().printStackTrace();
180179
}
181180

182181
/** {@return the component path of the application} */
@@ -244,7 +243,7 @@ public static ApplicationSetup newApplication(PackedApplicationInstaller<?> inst
244243
}
245244

246245
/** The build phase of the application. */
247-
private enum ApplicationBuildPhase {
248-
ASSEMBLE, CODEGEN, COMPLETED;
246+
public enum ApplicationBuildPhase {
247+
ASSEMBLE, CODEGEN, CLOSED, COMPLETED;
249248
}
250249
}

0 commit comments

Comments
 (0)