diff options
Diffstat (limited to '')
2 files changed, 15 insertions, 4 deletions
diff --git a/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaReferenceBindingProvider.java b/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaReferenceBindingProvider.java index d251ce0d01..50247de0db 100644 --- a/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaReferenceBindingProvider.java +++ b/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaReferenceBindingProvider.java @@ -21,12 +21,15 @@ package org.apache.tuscany.sca.binding.corba.impl; import org.apache.tuscany.sca.binding.corba.CorbaBinding; import org.apache.tuscany.sca.host.corba.CorbaHost; +import org.apache.tuscany.sca.host.corba.CorbaHostException; import org.apache.tuscany.sca.interfacedef.InterfaceContract; import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.invocation.Invoker; import org.apache.tuscany.sca.provider.ReferenceBindingProvider; import org.apache.tuscany.sca.runtime.RuntimeComponentReference; +import org.omg.CORBA.ORB; import org.omg.CORBA.Object; +import org.osoa.sca.ServiceRuntimeException; /** * @version $Rev$ $Date$ @@ -37,11 +40,17 @@ public class CorbaReferenceBindingProvider implements ReferenceBindingProvider { private CorbaHost host; private RuntimeComponentReference reference; private Object remoteObject; + private ORB orb; public CorbaReferenceBindingProvider(CorbaBinding binding, CorbaHost host, RuntimeComponentReference reference) { this.binding = binding; this.host = host; this.reference = reference; + try { + this.orb = host.createORB(binding.getHost(), binding.getPort(), false); + } catch (CorbaHostException e) { + throw new ServiceRuntimeException(e); + } } /** @@ -50,7 +59,7 @@ public class CorbaReferenceBindingProvider implements ReferenceBindingProvider { public Invoker createInvoker(Operation operation) { try { if (remoteObject == null) { - remoteObject = host.getReference(binding.getName(), binding.getHost(), binding.getPort()); + remoteObject = host.lookup(orb, binding.getName()); } return new CorbaInvoker(remoteObject); } catch (Exception e) { diff --git a/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaServiceBindingProvider.java b/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaServiceBindingProvider.java index bf1b5ffc47..9d4a93d1ac 100644 --- a/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaServiceBindingProvider.java +++ b/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaServiceBindingProvider.java @@ -25,6 +25,7 @@ import org.apache.tuscany.sca.host.corba.CorbaHost; import org.apache.tuscany.sca.interfacedef.InterfaceContract; import org.apache.tuscany.sca.provider.ServiceBindingProvider; import org.apache.tuscany.sca.runtime.RuntimeComponentService; +import org.omg.CORBA.ORB; import org.osoa.sca.ServiceRuntimeException; /** @@ -36,6 +37,7 @@ public class CorbaServiceBindingProvider implements ServiceBindingProvider { private CorbaHost host; private RuntimeComponentService service; private DynaCorbaServant servant; + private ORB orb; public CorbaServiceBindingProvider(CorbaBinding binding, CorbaHost host, RuntimeComponentService service) { this.binding = binding; @@ -55,8 +57,9 @@ public class CorbaServiceBindingProvider implements ServiceBindingProvider { */ public void start() { try { + this.orb = host.createORB(binding.getHost(), binding.getPort(), false); servant = new DynaCorbaServant(service, binding); - host.registerServant(binding.getName(), binding.getHost(), binding.getPort(), servant); + host.registerServant(orb, binding.getName(), servant); } catch (Exception e) { throw new ServiceRuntimeException(e); } @@ -68,7 +71,7 @@ public class CorbaServiceBindingProvider implements ServiceBindingProvider { */ public void stop() { try { - host.unregisterServant(binding.getName(), binding.getHost(), binding.getPort()); + host.unregisterServant(orb, binding.getName()); } catch (Exception e) { throw new ServiceRuntimeException(e); } @@ -79,7 +82,6 @@ public class CorbaServiceBindingProvider implements ServiceBindingProvider { * @see org.apache.tuscany.sca.provider.ServiceBindingProvider#supportsOneWayInvocation() */ public boolean supportsOneWayInvocation() { - // TODO Auto-generated method stub return false; } |