diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2008-09-19 05:31:14 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2008-09-19 05:31:14 +0000 |
commit | 6a633dee838417ed68cf91fbd2e9b3b9fa07bd8f (patch) | |
tree | 658d78b2087d2f851518be4d27ed9d913ac47ebb /branches/sca-equinox/modules/node-api/src/main/java | |
parent | bd126f649a92dd53cd3b3ccef5029ab273436291 (diff) |
Simplified ServiceDiscoverer. Started to use it to create factories to resolve ClassNotFoundExceptions. Renamed calculator-osgi to calculator-equinox and a few fixes to get it working in Eclipse.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@696924 13f79535-47bb-0310-9956-ffa450edef68
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; } |