diff options
Diffstat (limited to 'branches/sca-equinox/modules/binding-rmi-runtime/src')
4 files changed, 9 insertions, 14 deletions
diff --git a/branches/sca-equinox/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIBindingInvoker.java b/branches/sca-equinox/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIBindingInvoker.java index 62218a1d9c..7754fb5485 100644 --- a/branches/sca-equinox/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIBindingInvoker.java +++ b/branches/sca-equinox/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIBindingInvoker.java @@ -35,18 +35,14 @@ import org.apache.tuscany.sca.invocation.DataExchangeSemantics; public class RMIBindingInvoker implements Invoker, DataExchangeSemantics { private RMIHost rmiHost; - private String host; - private String port; - private String svcName; + private String uri; private Method remoteMethod; private Remote proxy; - public RMIBindingInvoker(RMIHost rmiHost, String host, String port, String svcName, Method remoteMethod) { + public RMIBindingInvoker(RMIHost rmiHost, String uri, Method remoteMethod) { this.rmiHost = rmiHost; this.remoteMethod = remoteMethod; - this.host = host; - this.port = port; - this.svcName = svcName; + this.uri = uri; } public Message invoke(Message msg) { @@ -67,8 +63,7 @@ public class RMIBindingInvoker implements Invoker, DataExchangeSemantics { public Object invokeTarget(final Object payload) throws InvocationTargetException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException { if (proxy == null) { - proxy = rmiHost.findService(host, port, svcName); - // proxy = Naming.lookup(serviceURI); + proxy = rmiHost.findService(uri); } remoteMethod = proxy.getClass().getMethod(remoteMethod.getName(), remoteMethod.getParameterTypes()); diff --git a/branches/sca-equinox/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIReferenceBindingProvider.java b/branches/sca-equinox/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIReferenceBindingProvider.java index e5302c2a98..8a368a26c3 100644 --- a/branches/sca-equinox/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIReferenceBindingProvider.java +++ b/branches/sca-equinox/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIReferenceBindingProvider.java @@ -65,7 +65,7 @@ public class RMIReferenceBindingProvider implements ReferenceBindingProvider { throw new IllegalArgumentException(e); } - return new RMIBindingInvoker(rmiHost, binding.getHost(), binding.getPort(), binding.getServiceName(), remoteMethod); + return new RMIBindingInvoker(rmiHost, binding.getURI(), remoteMethod); } public void start() { diff --git a/branches/sca-equinox/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java b/branches/sca-equinox/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java index 73efb47071..4f657103d5 100644 --- a/branches/sca-equinox/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java +++ b/branches/sca-equinox/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java @@ -79,7 +79,7 @@ public class RMIServiceBindingProvider implements ServiceBindingProvider { try { - rmiHost.registerService(binding.getServiceName(), getPort(binding.getPort()), rmiProxy); + rmiHost.registerService(binding.getURI(), rmiProxy); } catch (RMIHostException e) { throw new ServiceRuntimeException(e); @@ -87,7 +87,7 @@ public class RMIServiceBindingProvider implements ServiceBindingProvider { } public void stop() { - rmiHost.unregisterService(binding.getServiceName(), getPort(binding.getPort())); + rmiHost.unregisterService(binding.getURI()); } private int getPort(String port) { diff --git a/branches/sca-equinox/modules/binding-rmi-runtime/src/test/resources/RMIBindingTest.composite b/branches/sca-equinox/modules/binding-rmi-runtime/src/test/resources/RMIBindingTest.composite index d29fe85586..2a0bcf0f76 100644 --- a/branches/sca-equinox/modules/binding-rmi-runtime/src/test/resources/RMIBindingTest.composite +++ b/branches/sca-equinox/modules/binding-rmi-runtime/src/test/resources/RMIBindingTest.composite @@ -23,7 +23,7 @@ <service name="HelloWorldRmiService" promote="HelloWorldServiceComponent"> <interface.java interface="helloworld.HelloWorldService"/> - <tuscany:binding.rmi host="localhost" port="8099" serviceName="HelloWorldRemoteService" /> + <tuscany:binding.rmi uri="rmi://localhost:8099/HelloWorldRemoteService" /> </service> <component name="HelloWorldServiceComponent"> @@ -37,7 +37,7 @@ <reference name="HelloWorldRmiReference" promote="HelloWorldRmiServiceComponent/extService"> <interface.java interface="helloworld.HelloWorldService"/> - <tuscany:binding.rmi host="localhost" port="8099" serviceName="HelloWorldRemoteService" /> + <tuscany:binding.rmi uri="rmi://localhost:8099/HelloWorldRemoteService" /> </reference> </composite> |