summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-02-12 07:14:16 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-02-12 07:14:16 +0000
commit7a9f5fb22fff27230d87ebcf37f5ec89fd2f6f2d (patch)
tree77ae3cd45a6d8607dd3c049aee99956ed72d6617
parent163d10592c06b7f1530e586f44a86bb73b08bb75 (diff)
Simplify so you can use createNode() instead of createNode(null, null)
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@743635 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--branches/sca-java-1.x/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANodeFactory.java7
-rw-r--r--branches/sca-java-1.x/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java5
-rw-r--r--branches/sca-java-1.x/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java21
3 files changed, 33 insertions, 0 deletions
diff --git a/branches/sca-java-1.x/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANodeFactory.java b/branches/sca-java-1.x/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANodeFactory.java
index e41afd29c4..e60d8238d3 100644
--- a/branches/sca-java-1.x/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANodeFactory.java
+++ b/branches/sca-java-1.x/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANodeFactory.java
@@ -150,6 +150,13 @@ public abstract class SCANodeFactory {
}
/**
+ * Create a SCA node based on the discovery of the contribution on the classpath.
+ *
+ * @return a new SCA node.
+ */
+ public abstract SCANode createSCANode();
+
+ /**
* Create a SCA node based on the discovery of the contribution on the classpath for the
* given classloader. This method should be treated a convinient shortcut with the following
* assumptions:
diff --git a/branches/sca-java-1.x/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java b/branches/sca-java-1.x/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
index 18b166acdd..7dd7da7f4f 100644
--- a/branches/sca-java-1.x/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
+++ b/branches/sca-java-1.x/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
@@ -52,4 +52,9 @@ public class NodeFactoryImpl extends SCANodeFactory {
return new NodeImpl(compositeURI, compositeContent, contributions);
}
+ @Override
+ public SCANode createSCANode() {
+ return new NodeImpl();
+ }
+
}
diff --git a/branches/sca-java-1.x/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java b/branches/sca-java-1.x/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
index 8bc3b0f09d..01887fcece 100644
--- a/branches/sca-java-1.x/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
+++ b/branches/sca-java-1.x/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
@@ -145,6 +145,27 @@ public class NodeImpl implements SCANode, SCAClient {
}
/**
+ * Construct a node by discovering the node configuration on the classpath
+ * @param classLoader
+ * @param compositeURI
+ */
+ NodeImpl() {
+ configurationName = "default";
+ logger.log(Level.INFO, "Creating node: " + configurationName);
+
+ try {
+ initRuntime();
+
+ ConfiguredNodeImplementation config = findNodeConfiguration(null, null);
+ configureNode(config);
+ } catch (ServiceRuntimeException e) {
+ throw e;
+ } catch (Throwable e) {
+ throw new ServiceRuntimeException(e);
+ }
+ }
+
+ /**
* Construct a node by discovering the node configuration (composite+contrbutions) on the classpath
* @param classLoader
* @param compositeURI