diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-20 16:46:55 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-20 16:46:55 +0000 |
commit | b099739d69690535623b126b37f47bfdfecf040f (patch) | |
tree | 252ab5e26d6e6f2c804c43744ff22d68ce3b353f /java/sca/modules/node-api/src/main | |
parent | f1863df3c7da7a4632ef3ca70d430d62ed387bad (diff) |
Refactoring a few methods on the ServiceDiscover
Adding an OSGi service registry based ExtensionPointRegistry implementation
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@776759 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/node-api/src/main')
-rw-r--r-- | java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java index c9d4efe451..a4b3c6e84d 100644 --- a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java +++ b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java @@ -160,8 +160,6 @@ public abstract class NodeFactory extends DefaultNodeConfigurationFactory { return nodeFactory; } - NodeFactory scaNodeFactory = null; - try { // final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); // Use reflection APIs to call ServiceDiscovery to avoid hard dependency to tuscany-extensibility @@ -169,14 +167,13 @@ public abstract class NodeFactory extends DefaultNodeConfigurationFactory { Class<?> discoveryClass = Class.forName("org.apache.tuscany.sca.extensibility.ServiceDiscovery"); Object instance = discoveryClass.getMethod("getInstance").invoke(null); Object factoryDeclaration = - discoveryClass.getMethod("getFirstServiceDeclaration", String.class).invoke(instance, - NodeFactory.class - .getName()); + discoveryClass.getMethod("getServiceDeclaration", String.class).invoke(instance, + NodeFactory.class.getName()); if (factoryDeclaration != null) { Class<?> factoryImplClass = (Class<?>)factoryDeclaration.getClass().getMethod("loadClass").invoke(factoryDeclaration); - scaNodeFactory = (NodeFactory)factoryImplClass.newInstance(); - return scaNodeFactory; + nodeFactory = (NodeFactory)factoryImplClass.newInstance(); + return nodeFactory; } } catch (ClassNotFoundException e) { // Ignore @@ -186,8 +183,8 @@ public abstract class NodeFactory extends DefaultNodeConfigurationFactory { String className = "org.apache.tuscany.sca.node.impl.NodeFactoryImpl"; Class<?> cls = Class.forName(className); - scaNodeFactory = (NodeFactory)cls.newInstance(); - return scaNodeFactory; + nodeFactory = (NodeFactory)cls.newInstance(); + return nodeFactory; } catch (Exception e) { throw new ServiceRuntimeException(e); |