Skip to content

Commit 0045b49

Browse files
committed
e
1 parent cbdfc56 commit 0045b49

15 files changed

Lines changed: 40 additions & 92 deletions

modules/packed/src/main/java/app/packed/component/ComponentMirror.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import app.packed.bean.BeanMirror;
2222
import app.packed.build.Mirror;
2323
import app.packed.container.ContainerMirror;
24-
import app.packed.namespaceold.OldNamespaceMirror;
2524
import app.packed.operation.OperationMirror;
2625

2726
/**
@@ -30,7 +29,7 @@
3029
* A component mirror is always defined either by the framework or by an extension. IDK would it make sense to have it
3130
* as a user??? Fx Importer...
3231
*/
33-
public sealed interface ComponentMirror extends Mirror permits ApplicationMirror, BeanMirror, ContainerMirror, OldNamespaceMirror, OperationMirror {
32+
public sealed interface ComponentMirror extends Mirror permits ApplicationMirror, BeanMirror, ContainerMirror, OperationMirror {
3433

3534
// BuildAction installedBy();?? Cute
3635

modules/packed/src/main/java/app/packed/extension/Extension.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,9 @@
3030
import app.packed.build.BuildCodeSource;
3131
import app.packed.build.BuildGoal;
3232
import app.packed.component.ComponentPath;
33-
import app.packed.component.ComponentRealm;
3433
import app.packed.container.ContainerHandle;
3534
import app.packed.extension.Extension.ExtensionProperty;
3635
import app.packed.extension.ExtensionPoint.ExtensionPointHandle;
37-
import app.packed.namespaceold.OldNamespaceHandle;
38-
import app.packed.namespaceold.OldNamespaceTemplate;
3936
import app.packed.service.ProvidableBeanConfiguration;
4037
import app.packed.util.TreeView;
4138
import internal.app.packed.container.ContainerSetup;
@@ -279,10 +276,6 @@ protected final E lifetimeRoot() {
279276
return (E) s.instance();
280277
}
281278

282-
protected final <H extends OldNamespaceHandle<E, ?>> H namespaceLazy(OldNamespaceTemplate<H> template) {
283-
return handle.namespaceLazy(template, ComponentRealm.userland());
284-
}
285-
286279
/**
287280
* This method can be overridden to provide a customized {@link ExtensionMirror mirror} for the extension. For example,
288281
* {@link BaseExtension} overrides this method to provide an instance of {@link BaseExtensionMirror}.

modules/packed/src/main/java/app/packed/namespaceold/OldNamespaceHandle.java

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

2020
import java.util.HashMap;
21-
import java.util.function.Supplier;
2221
import java.util.stream.Stream;
2322

2423
import app.packed.component.ComponentHandle;
@@ -42,9 +41,6 @@ public abstract non-sealed class OldNamespaceHandle<E extends Extension<E>, C ex
4241
/** A cache of all namespace configurations, currently do not support namespaces uses by extensions. */
4342
private HashMap<E, C> configurations = new HashMap<>();
4443

45-
/** The lazy generated namespace mirror. */
46-
private final Supplier<OldNamespaceMirror<E>> mirror = StableValue.supplier(() -> newNamespaceMirror());
47-
4844
/** The namespace configuration. */
4945
final OldNamespaceSetup namespace;
5046

@@ -112,26 +108,9 @@ public final boolean isOpen() {
112108
return namespace.root.container.handle().isOpen();
113109
}
114110

115-
/** {@inheritDoc} */
116-
@Override
117-
public final OldNamespaceMirror<E> mirror() {
118-
return mirror.get();
119-
}
120-
121111
/** {@inheritDoc} */
122112
protected abstract C newNamespaceConfiguration(E extension, ComponentRealm actor);
123113

124-
/**
125-
* <p>
126-
* Most namespace implementations will want to define a special namespace mirror. But it is fine to leave it alone when
127-
* implementing the namespace.
128-
*
129-
* @return the new mirror
130-
*/
131-
protected OldNamespaceMirror<E> newNamespaceMirror() {
132-
return new OldNamespaceMirror<E>(this);
133-
}
134-
135114
protected void onClose() {}
136115

137116
// I think we have one per assembly

modules/packed/src/main/java/app/packed/namespaceold/OldNamespaceMirror.java renamed to modules/packed/src/main/java/app/packed/namespaceold/OverviewOldMirror.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import java.util.stream.Stream;
2222

2323
import app.packed.bean.BeanMirror;
24-
import app.packed.component.ComponentMirror;
2524
import app.packed.component.ComponentPath;
2625
import app.packed.component.ComponentRealm;
2726
import app.packed.container.ContainerMirror;
@@ -30,7 +29,7 @@
3029
import app.packed.util.TreeView;
3130

3231
/** A mirror of a namespace. */
33-
public non-sealed class OldNamespaceMirror<E extends Extension<E>> implements ComponentMirror {
32+
public class OverviewOldMirror<E extends Extension<E>> {
3433

3534
/** The namespace configuration. */
3635
private final OldNamespaceHandle<E, ?> handle;
@@ -41,12 +40,11 @@ public non-sealed class OldNamespaceMirror<E extends Extension<E>> implements Co
4140
* @param handle
4241
* the namespace's handle
4342
*/
44-
public OldNamespaceMirror(OldNamespaceHandle<E, ?> handle) {
43+
public OverviewOldMirror(OldNamespaceHandle<E, ?> handle) {
4544
this.handle = requireNonNull(handle);
4645
}
4746

4847
/** {@inheritDoc} */
49-
@Override
5048
public final ComponentPath componentPath() {
5149
return handle.componentPath();
5250
}
@@ -55,15 +53,14 @@ public final ComponentRealm componentOwner() {
5553
return handle.componentOwner();
5654
}
5755

58-
@Override
5956
public final Set<String> componentTags() {
6057
return handle.componentTags();
6158
}
6259

6360
/** {@inheritDoc} */
6461
@Override
6562
public final boolean equals(Object other) {
66-
return other instanceof OldNamespaceMirror m && getClass() == m.getClass() && handle.namespace == m.handle.namespace;
63+
return other instanceof OverviewOldMirror m && getClass() == m.getClass() && handle.namespace == m.handle.namespace;
6764
}
6865

6966
/** {@return the root extension in the namespace} */

modules/packed/src/main/java/app/packed/service/ServiceNamespaceConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public ServiceNamespaceConfiguration newServiceNamespaceConfiguration(ServiceNam
179179

180180
@Override
181181
public ServiceNamespaceMirror newServiceNamespaceMirror(ServiceNamespaceHandle handle) {
182-
return new ServiceNamespaceMirror(handle);
182+
return new ServiceNamespaceMirror();
183183
}
184184
});
185185
}

modules/packed/src/main/java/app/packed/service/ServiceNamespaceMirror.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,14 @@
2020
import java.util.Set;
2121

2222
import app.packed.binding.Key;
23-
import app.packed.extension.BaseExtension;
24-
import app.packed.namespaceold.OldNamespaceMirror;
2523
import app.packed.service.mirror.ServiceBindingMirror;
2624
import app.packed.service.mirror.ServiceProviderMirror;
27-
import internal.app.packed.service.ServiceNamespaceHandle;
2825

2926
/**
3027
* A mirror for a service namespace.
3128
*/
32-
public final class ServiceNamespaceMirror extends OldNamespaceMirror<BaseExtension> {
29+
public final class ServiceNamespaceMirror {
3330

34-
/**
35-
* Creates a new service namespace mirror.
36-
*
37-
* @param handle
38-
* the namespace's handle
39-
*
40-
* @implNote Invoked via
41-
* {@link internal.app.packed.handlers.ServiceHandlers#newServiceNamespaceMirror(ServiceNamespaceHandle)}
42-
*/
43-
ServiceNamespaceMirror(ServiceNamespaceHandle handle) {
44-
super(handle);
45-
}
4631

4732
/** {@return A map of all the bindings from providers in the namespace} */
4833
public Map<Key<?>, Collection<ServiceBindingMirror>> bindings() {

modules/packed/src/main/java/app/packed/service/bridge/ServiceNamespaceBridgeMirror.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@
1515
*/
1616
package app.packed.service.bridge;
1717

18-
import app.packed.service.ServiceNamespaceMirror;
19-
2018
/**
2119
*
2220
*/
23-
public interface ServiceNamespaceBridgeMirror extends NamespaceBridgeMirror<ServiceNamespaceMirror> {
21+
public interface ServiceNamespaceBridgeMirror {
2422
String ACTION_REMOVED = "removed";
2523

2624
// remove [Key, Operation]

modules/packed/src/main/java/app/packed/service/mirror/ServiceNamespaceProvideOperationMirror.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import app.packed.operation.OperationHandle;
1919
import app.packed.operation.OperationMirror;
20-
import app.packed.service.ServiceNamespaceMirror;
2120

2221
/**
2322
*
@@ -30,11 +29,11 @@ public class ServiceNamespaceProvideOperationMirror extends OperationMirror {
3029
public ServiceNamespaceProvideOperationMirror(OperationHandle<?> handle) {
3130
super(handle);
3231
}
33-
34-
/** {@inheritDoc} */
35-
public ServiceNamespaceMirror namespace() {
36-
return null;
37-
}
32+
//
33+
// /** {@inheritDoc} */
34+
// public ServiceNamespaceMirror namespace() {
35+
// return null;
36+
// }
3837

3938
ServiceProviderMirror.FromNamespace providerMirror() {
4039
throw new UnsupportedOperationException();

modules/packed/src/main/java/app/packed/service/mirror/ServiceProviderMirror.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import app.packed.binding.Key;
2323
import app.packed.context.ContextMirror;
2424
import app.packed.operation.OperationMirror;
25-
import app.packed.service.ServiceNamespaceMirror;
2625

2726
/**
2827
*
@@ -67,7 +66,7 @@ interface FromNamespace extends ServiceProviderMirror {
6766

6867
ServiceNamespaceProvideOperationMirror providedVia();
6968

70-
ServiceNamespaceMirror namespace();
69+
// ServiceNamespaceMirror namespace();
7170
}
7271

7372
interface FromOperation extends ServiceProviderMirror {

modules/packed/src/main/java/app/packed/service/mirrorold/ExportedServiceMirror.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import app.packed.binding.Key;
1919
import app.packed.operation.OperationHandle;
2020
import app.packed.operation.OperationMirror;
21-
import app.packed.service.ServiceNamespaceMirror;
2221
import internal.app.packed.service.ExportedService;
2322

2423
/**
@@ -45,11 +44,6 @@ public Key<?> key() {
4544
return es.key;
4645
}
4746

48-
/** {@inheritDoc} */
49-
public ServiceNamespaceMirror namespace() {
50-
throw new UnsupportedOperationException();
51-
}
52-
5347
// // Hvad goer vi omvendt??? Returnere en liste??
5448
// // Kun allower en? IDK
5549
// public abstract Optional<ServiceProvisionMirror> service(); // Kan ikke fange alle dog

0 commit comments

Comments
 (0)