From b67b4d3678d5380edf72b75a1cbdd48e70b68089 Mon Sep 17 00:00:00 2001 From: antelder Date: Tue, 16 Mar 2010 08:01:26 +0000 Subject: Add way to keep track of Nodes created by the factory git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@923618 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/tuscany/sca/node/NodeFactory.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sca-java-2.x/trunk/modules/node-api/src') diff --git a/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java b/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java index 5efaa97841..b8bfbee356 100644 --- a/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java +++ b/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java @@ -59,6 +59,8 @@ public abstract class NodeFactory extends DefaultNodeConfigurationFactory { protected static NodeFactory instance; protected static Class factoryImplClass; + + protected static List factories = new ArrayList(); protected static void setNodeFactory(NodeFactory factory) { instance = factory; @@ -174,6 +176,7 @@ public abstract class NodeFactory extends DefaultNodeConfigurationFactory { } catch (Exception e) { throw new ServiceRuntimeException(e); } + factories.add(nodeFactory); return nodeFactory; } @@ -474,6 +477,11 @@ public abstract class NodeFactory extends DefaultNodeConfigurationFactory { public void destroy() { count = 0; instance = null; + factories.remove(this); + } + + public static List getNodeFactories() { + return factories; } /** -- cgit v1.2.3