diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2011-03-21 20:28:20 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2011-03-21 20:28:20 +0000 |
commit | b8a63636ff2dbea555f14b42c5a49e1555e68f85 (patch) | |
tree | a9cc56e976bbcc2b2e352dcc9f2844a205c38270 /sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration | |
parent | 9158de4b937e44c15edd966e37774d717e506eb6 (diff) |
Allow the spring component to receive parent application context from the composite context
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1083938 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration')
2 files changed, 33 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java b/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java index 12c6994dda..ec9148483c 100644 --- a/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java +++ b/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java @@ -24,6 +24,7 @@ import java.io.Reader; import java.net.URI; import java.net.URL; import java.util.List; +import java.util.Map; import javax.xml.namespace.QName; @@ -103,6 +104,24 @@ public interface NodeConfiguration { NodeConfiguration addBinding(BindingConfiguration binding); NodeConfiguration addBinding(QName bindingType, String...baseURIs); NodeConfiguration addBinding(QName bindingType, URI...baseURIs); - + List<Object> getExtensions(); + + + /** + * Allow the hosting environment to pass in a map of attributes as context + * @param name The name of the attribute + * @param value The value of the attribute + * @return + */ + Map<String, Object> getAttributes(); + + /** + * Configure an attribute + * @param name + * @param value + * @return + */ + NodeConfiguration setAttribute(String name, Object value); + } diff --git a/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/NodeConfigurationImpl.java b/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/NodeConfigurationImpl.java index b4ec05cae5..f3853fc4bf 100644 --- a/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/NodeConfigurationImpl.java +++ b/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/NodeConfigurationImpl.java @@ -24,7 +24,9 @@ import java.io.Reader; import java.net.URI; import java.net.URL; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import javax.xml.namespace.QName; @@ -42,6 +44,8 @@ public class NodeConfigurationImpl implements NodeConfiguration { private List<ContributionConfiguration> contributions = new ArrayList<ContributionConfiguration>(); private List<BindingConfiguration> bindings = new ArrayList<BindingConfiguration>(); private List<Object> extensions = new ArrayList<Object>(); + + private transient Map<String, Object> attributes = new HashMap<String, Object>(); public String getURI() { return uri; @@ -173,4 +177,13 @@ public class NodeConfigurationImpl implements NodeConfiguration { return this; } + public Map<String, Object> getAttributes() { + return attributes; + } + + public NodeConfiguration setAttribute(String name, Object value) { + attributes.put(name, value); + return this; + } + } |