diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-28 05:27:50 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-28 05:27:50 +0000 |
commit | 93f5929ff2d05ff05db0069667a641395706e582 (patch) | |
tree | 560e6fb00e0f3750e0cbd3548820328d43ca2cc4 /sca-java-2.x/trunk | |
parent | 316a61d28feb70e846b4b2140b798d6e85e517a2 (diff) |
Make ExtensibleCorbaHost a utility
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@928346 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk')
2 files changed, 11 insertions, 10 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/CorbaBindingProviderFactory.java b/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/CorbaBindingProviderFactory.java index 86cb4afb7c..bf0cc34195 100644 --- a/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/CorbaBindingProviderFactory.java +++ b/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/CorbaBindingProviderFactory.java @@ -21,13 +21,10 @@ package org.apache.tuscany.sca.binding.corba.provider; import org.apache.tuscany.sca.binding.corba.CorbaBinding; import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.host.corba.CorbaHostExtensionPoint; import org.apache.tuscany.sca.host.corba.ExtensibleCorbaHost; import org.apache.tuscany.sca.provider.BindingProviderFactory; import org.apache.tuscany.sca.provider.ReferenceBindingProvider; import org.apache.tuscany.sca.provider.ServiceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; import org.apache.tuscany.sca.runtime.RuntimeEndpoint; import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; @@ -35,13 +32,10 @@ import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; * @version $Rev$ $Date$ */ public class CorbaBindingProviderFactory implements BindingProviderFactory<CorbaBinding> { - - private CorbaHostExtensionPoint chep; private ExtensibleCorbaHost host; public CorbaBindingProviderFactory(ExtensionPointRegistry registry) { - chep = registry.getExtensionPoint(CorbaHostExtensionPoint.class); - host = new ExtensibleCorbaHost(chep); + host = ExtensibleCorbaHost.getInstance(registry); } /** * @see org.apache.tuscany.sca.provider.BindingProviderFactory#createReferenceBindingProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.runtime.RuntimeComponentReference, org.apache.tuscany.sca.assembly.Binding) diff --git a/sca-java-2.x/trunk/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/ExtensibleCorbaHost.java b/sca-java-2.x/trunk/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/ExtensibleCorbaHost.java index 7e043667a9..644682e106 100644 --- a/sca-java-2.x/trunk/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/ExtensibleCorbaHost.java +++ b/sca-java-2.x/trunk/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/ExtensibleCorbaHost.java @@ -19,6 +19,8 @@ package org.apache.tuscany.sca.host.corba; +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; import org.omg.CORBA.Object; /** @@ -29,10 +31,15 @@ public class ExtensibleCorbaHost implements CorbaHost { private CorbaHostExtensionPoint hosts; - public ExtensibleCorbaHost(CorbaHostExtensionPoint chep) { - this.hosts = chep; + public ExtensibleCorbaHost(ExtensionPointRegistry registry) { + this.hosts = registry.getExtensionPoint(CorbaHostExtensionPoint.class); } - + + public static ExtensibleCorbaHost getInstance(ExtensionPointRegistry registry) { + UtilityExtensionPoint utilityExtensionPoint = registry.getExtensionPoint(UtilityExtensionPoint.class); + return utilityExtensionPoint.getUtility(ExtensibleCorbaHost.class); + } + public Object lookup(String uri) throws CorbaHostException { return getCorbaHost().lookup(uri); } |