Minor clean up

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@756843 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
rfeng 2009-03-21 00:11:42 +00:00
parent d3903111ad
commit 932ce58f6d

View file

@ -166,11 +166,13 @@ public class NodeFactoryImpl {
private ConfiguredNodeImplementation getNodeConfiguration(Bundle bundle, String compositeContent) throws Exception { private ConfiguredNodeImplementation getNodeConfiguration(Bundle bundle, String compositeContent) throws Exception {
ConfiguredNodeImplementation configuration = getNodeConfiguration(bundle); ConfiguredNodeImplementation configuration = getNodeConfiguration(bundle);
if (compositeContent != null) {
Contribution deploymentContrib = createDeploymentContribution(compositeContent); Contribution deploymentContrib = createDeploymentContribution(compositeContent);
configuration.setComposite(deploymentContrib.getDeployables().get(0)); configuration.setComposite(deploymentContrib.getDeployables().get(0));
configuration.getContributions().add(deploymentContrib); configuration.getContributions().add(deploymentContrib);
}
return configuration; return configuration;
} }
@ -527,23 +529,10 @@ public class NodeFactoryImpl {
private Bundle bundle; private Bundle bundle;
private Composite domainFragementComposite; private Composite domainFragementComposite;
private CompositeActivator compositeActivator; private CompositeActivator compositeActivator;
private ConfiguredNodeImplementation configuration;
public NodeImpl(Bundle bundle) { public NodeImpl(Bundle bundle) {
try { this(bundle, null);
// 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);
}
} }
public NodeImpl(Bundle bundle, String compositeContent) { public NodeImpl(Bundle bundle, String compositeContent) {
@ -552,7 +541,7 @@ public class NodeFactoryImpl {
init(); init();
this.bundle = bundle; this.bundle = bundle;
ConfiguredNodeImplementation configuration = getNodeConfiguration(bundle, compositeContent); this.configuration = getNodeConfiguration(bundle, compositeContent);
// Configure the node // Configure the node
this.domainFragementComposite = configureNode(configuration); this.domainFragementComposite = configureNode(configuration);
@ -675,6 +664,8 @@ public class NodeFactoryImpl {
public void destroy() { public void destroy() {
this.bundle = null; this.bundle = null;
this.domainFragementComposite = null; this.domainFragementComposite = null;
this.compositeActivator = null;
this.configuration = null;
nodes.remove(this); nodes.remove(this);
} }