diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-03-21 00:11:42 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-03-21 00:11:42 +0000 |
commit | 932ce58f6d471381d07c0859194b534a74536400 (patch) | |
tree | 456b780fd740100167657ef0901f0ff45458ff20 /java | |
parent | d3903111ad61b5621f76bf573484c16f20231df0 (diff) |
Minor clean up
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@756843 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r-- | java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeFactoryImpl.java | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeFactoryImpl.java b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeFactoryImpl.java index 37b3f1a6fb..053e40b5ac 100644 --- a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeFactoryImpl.java +++ b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeFactoryImpl.java @@ -166,11 +166,13 @@ public class NodeFactoryImpl { private ConfiguredNodeImplementation getNodeConfiguration(Bundle bundle, String compositeContent) throws Exception { ConfiguredNodeImplementation configuration = getNodeConfiguration(bundle); + if (compositeContent != null) { - Contribution deploymentContrib = createDeploymentContribution(compositeContent); + Contribution deploymentContrib = createDeploymentContribution(compositeContent); - configuration.setComposite(deploymentContrib.getDeployables().get(0)); - configuration.getContributions().add(deploymentContrib); + configuration.setComposite(deploymentContrib.getDeployables().get(0)); + configuration.getContributions().add(deploymentContrib); + } return configuration; } @@ -527,23 +529,10 @@ public class NodeFactoryImpl { private Bundle bundle; private Composite domainFragementComposite; private CompositeActivator compositeActivator; + private ConfiguredNodeImplementation configuration; public NodeImpl(Bundle bundle) { - try { - // Initialize the runtime - init(); - - this.bundle = bundle; - ConfiguredNodeImplementation configuration = getNodeConfiguration(bundle); - - // Configure the node - this.domainFragementComposite = configureNode(configuration); - this.compositeActivator = utilities.getUtility(CompositeActivator.class, true); - this.compositeActivator.setDomainComposite(domainFragementComposite); - - } catch (Exception e) { - throw new ServiceRuntimeException(e); - } + this(bundle, null); } public NodeImpl(Bundle bundle, String compositeContent) { @@ -552,7 +541,7 @@ public class NodeFactoryImpl { init(); this.bundle = bundle; - ConfiguredNodeImplementation configuration = getNodeConfiguration(bundle, compositeContent); + this.configuration = getNodeConfiguration(bundle, compositeContent); // Configure the node this.domainFragementComposite = configureNode(configuration); @@ -675,6 +664,8 @@ public class NodeFactoryImpl { public void destroy() { this.bundle = null; this.domainFragementComposite = null; + this.compositeActivator = null; + this.configuration = null; nodes.remove(this); } |