diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-28 16:37:45 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-28 16:37:45 +0000 |
commit | 220cc6f35942025a502a602e330efb05aea44500 (patch) | |
tree | 67872c213c3c1766cf71e055b108d045f71830a6 /java/sca/modules/binding-corba-runtime | |
parent | aa333c67013c36692c03475a6ed40b63cc1ea8d5 (diff) |
Fix the compliation error due to refactoring in host-corba
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@672545 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/binding-corba-runtime')
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; } |