diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-16 08:01:26 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-16 08:01:26 +0000 |
commit | b67b4d3678d5380edf72b75a1cbdd48e70b68089 (patch) | |
tree | 90aae0f50a0d034e8d66b0a141e0f18b9d970864 /sca-java-2.x/trunk/modules/node-api/src | |
parent | 0d9b8d05c6d510427e92b891020fdf183572f09f (diff) |
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
Diffstat (limited to 'sca-java-2.x/trunk/modules/node-api/src')
-rw-r--r-- | sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java | 8 |
1 files changed, 8 insertions, 0 deletions
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<NodeFactory> factories = new ArrayList<NodeFactory>(); 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<NodeFactory> getNodeFactories() { + return factories; } /** |