diff options
Diffstat (limited to 'sca-java-2.x/trunk')
2 files changed, 21 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java index 313c4bb64e..dad982d0e7 100644 --- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java +++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java @@ -47,13 +47,15 @@ public class CompositeContext { protected Definitions systemDefinitions; protected Map<String, Object> attributes = new HashMap<String, Object>(); + protected Object node; public CompositeContext(ExtensionPointRegistry registry, DomainRegistry domainRegistry, Composite domainComposite, String domainURI, String nodeURI, - Definitions systemDefinitions) { + Definitions systemDefinitions, + Object node) { this.extensionPointRegistry = registry; this.domainRegistry = domainRegistry; ContextFactoryExtensionPoint contextFactories = registry.getExtensionPoint(ContextFactoryExtensionPoint.class); @@ -62,10 +64,20 @@ public class CompositeContext { this.domainURI = domainURI; this.nodeURI = nodeURI; this.systemDefinitions = systemDefinitions; + this.node = node; + } + + public CompositeContext(ExtensionPointRegistry registry, + DomainRegistry domainRegistry, + Composite domainComposite, + String domainURI, + String nodeURI, + Definitions systemDefinitions) { + this(registry, domainRegistry, null, "default", "default", systemDefinitions, null); } public CompositeContext(ExtensionPointRegistry registry, DomainRegistry domainRegistry) { - this(registry, domainRegistry, null, "default", "default", null); + this(registry, domainRegistry, null, "default", "default", null, null); } /** @@ -171,4 +183,8 @@ public class CompositeContext { public Map<String, Object> getAttributes() { return attributes; } + + public <T> T getNode() { + return (T)node; + } } diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/TuscanyComponentContext.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/TuscanyComponentContext.java index 88a01e42b9..196cc3c994 100644 --- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/TuscanyComponentContext.java +++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/TuscanyComponentContext.java @@ -28,4 +28,7 @@ public interface TuscanyComponentContext extends ComponentContext { <B> TuscanyServiceReference<B> getServiceReference(Class<B> businessInterface, String referenceName) throws IllegalArgumentException;
ExtensionPointRegistry getExtensionPointRegistry();
+
+ <T> T getNode();
+
}
|