From 7a9f5fb22fff27230d87ebcf37f5ec89fd2f6f2d Mon Sep 17 00:00:00 2001 From: antelder Date: Thu, 12 Feb 2009 07:14:16 +0000 Subject: 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 --- .../tuscany/sca/node/impl/NodeFactoryImpl.java | 5 +++++ .../org/apache/tuscany/sca/node/impl/NodeImpl.java | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) (limited to 'branches/sca-java-1.x/modules/node-impl/src') 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 @@ -144,6 +144,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 -- cgit v1.2.3