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
This commit is contained in:
parent
aa333c6701
commit
220cc6f359
2 changed files with 15 additions and 4 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue