summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/core-spi/src
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2012-08-16 15:34:54 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2012-08-16 15:34:54 +0000
commit87a88c3c24a338a00fe3949dec3816020975ce10 (patch)
treea9657a2c30ee81f8a2e0e0e51ff79cae5d67e2d4 /sca-java-2.x/trunk/modules/core-spi/src
parentc3c1a6f713d2abf990ae628f29b1494bf00b3847 (diff)
Add a method to get the Node to the TuscanyComponentContext
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1373883 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/core-spi/src')
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java20
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/TuscanyComponentContext.java3
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();
+
}