diff options
Diffstat (limited to 'branches/sca-equinox/modules/node-api/src/main/java')
-rw-r--r-- | branches/sca-equinox/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANodeFactory.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/branches/sca-equinox/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANodeFactory.java b/branches/sca-equinox/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANodeFactory.java index e41afd29c4..2c91032653 100644 --- a/branches/sca-equinox/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANodeFactory.java +++ b/branches/sca-equinox/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANodeFactory.java @@ -123,13 +123,11 @@ public abstract class SCANodeFactory { // final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); // Use reflection APIs to call ServiceDiscovery to avoid hard dependency to tuscany-extensibility try { - Class<?> discoveryClass = - Class.forName("org.apache.tuscany.sca.extensibility.ServiceDiscovery"); + Class<?> discoveryClass = Class.forName("org.apache.tuscany.sca.extensibility.ServiceDiscovery"); Object instance = discoveryClass.getMethod("getInstance").invoke(null); - Class<?> factoryImplClass = - (Class<?>)discoveryClass.getMethod("loadFirstServiceClass", Class.class) - .invoke(instance, SCANodeFactory.class); - if (factoryImplClass != null) { + Object factoryDeclaration = discoveryClass.getMethod("getFirstServiceDeclaration", String.class).invoke(instance, SCANodeFactory.class.getName()); + if (factoryDeclaration != null) { + Class<?> factoryImplClass = (Class<?>)factoryDeclaration.getClass().getMethod("loadClass").invoke(factoryDeclaration); scaNodeFactory = (SCANodeFactory)factoryImplClass.newInstance(); return scaNodeFactory; } |