diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2012-03-22 15:53:41 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2012-03-22 15:53:41 +0000 |
commit | 73da1fdb893118d67777a2e8962965d2336ca6e2 (patch) | |
tree | 9bf7b022e9596480521f05f49638fbe3e679a2a1 /sca-java-2.x/trunk/modules/domain-node/src/main | |
parent | a16f36a53eaefe3e6f60df7537baecb2ab6f9a11 (diff) |
TUSCANY-4034 - plug a few more potential memory leaks
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1303855 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/domain-node/src/main')
-rw-r--r-- | sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java index 456c4ef7b6..27f00be0ba 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java @@ -54,6 +54,8 @@ import org.apache.tuscany.sca.contribution.resolver.ModelResolver; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.core.invocation.ProxyFactory; +import org.apache.tuscany.sca.core.invocation.ProxyFactoryExtensionPoint; import org.apache.tuscany.sca.databinding.jaxb.JAXBContextHelper; import org.apache.tuscany.sca.deployment.Deployer; import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; @@ -90,6 +92,8 @@ public class NodeImpl implements Node { private boolean quietLogging; private boolean releaseOnUnload; + + private ContributionListener contributionListener; public NodeImpl(Deployer deployer, CompositeActivator compositeActivator, @@ -107,7 +111,7 @@ public class NodeImpl implements Node { utilityExtensionPoint.getUtility(ActiveNodes.class).getActiveNodes().add(this); - domainRegistry.addContributionListener(new ContributionListener() { + contributionListener = new ContributionListener() { public void contributionInstalled(String uri) { // Do nothing } @@ -126,7 +130,9 @@ public class NodeImpl implements Node { } } } - }); + }; + + this.domainRegistry.addContributionListener(contributionListener); endpointsIncludeDomainName = !TuscanyRuntime.DEFAUL_DOMAIN_NAME.equals(domainRegistry.getDomainName()); @@ -248,6 +254,10 @@ public class NodeImpl implements Node { JavaInterfaceFactory javaInterfaceFactory = factoryExtensionPoint.getFactory(JavaInterfaceFactory.class); javaInterfaceFactory.removeInterfacesForContribution(contributionClassloader); + + ProxyFactoryExtensionPoint proxyFactoryExtensionPoint = extensionPointRegistry.getExtensionPoint(ProxyFactoryExtensionPoint.class); + ProxyFactory interfaceProxyFactory = proxyFactoryExtensionPoint.getInterfaceProxyFactory(); + interfaceProxyFactory.removeProxiesForContribution(contributionClassloader); } domainRegistry.uninstallContribution(contributionURI); @@ -587,6 +597,7 @@ public class NodeImpl implements Node { startedComposites.clear(); stoppedComposites.clear(); extensionPointRegistry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(ActiveNodes.class).getActiveNodes().remove(this); + domainRegistry.removeContributionListener(contributionListener); if (tuscanyRuntime != null) { tuscanyRuntime.stop(); } |