From 2a7966363348acb2c6f6ad6eaa2308fd4da1f1ae Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Mon, 29 Sep 2008 00:50:22 +0000 Subject: Ported from trunk and simplified. Support the rmi:// uri for binding.rmi. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@699932 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/host/rmi/ExtensibleRMIHost.java | 26 +++++----------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'branches/sca-equinox/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/ExtensibleRMIHost.java') diff --git a/branches/sca-equinox/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/ExtensibleRMIHost.java b/branches/sca-equinox/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/ExtensibleRMIHost.java index 32fe6c2deb..29b4e195c7 100644 --- a/branches/sca-equinox/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/ExtensibleRMIHost.java +++ b/branches/sca-equinox/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/ExtensibleRMIHost.java @@ -35,39 +35,25 @@ public class ExtensibleRMIHost implements RMIHost { this.rmiHosts = rmiHosts; } - public void registerService(String serviceName, int port, Remote serviceObject) throws RMIHostException, RMIHostRuntimeException { + public void registerService(String uri, Remote serviceObject) throws RMIHostException, RMIHostRuntimeException { if (rmiHosts.getRMIHosts().isEmpty()) { throw new RMIHostException("No RMI host available"); } - rmiHosts.getRMIHosts().get(0).registerService(serviceName, port, serviceObject); + rmiHosts.getRMIHosts().get(0).registerService(uri, serviceObject); } - public Remote findService(String host, String port, String svcName) throws RMIHostException, RMIHostRuntimeException { + public void unregisterService(String uri) throws RMIHostException, RMIHostRuntimeException { if (rmiHosts.getRMIHosts().isEmpty()) { throw new RMIHostException("No RMI host available"); } - return rmiHosts.getRMIHosts().get(0).findService(host, port, svcName); + rmiHosts.getRMIHosts().get(0).unregisterService(uri); } - public void registerService(String serviceName, Remote serviceObject) throws RMIHostException, RMIHostRuntimeException { + public Remote findService(String uri) throws RMIHostException, RMIHostRuntimeException { if (rmiHosts.getRMIHosts().isEmpty()) { throw new RMIHostException("No RMI host available"); } - rmiHosts.getRMIHosts().get(0).registerService(serviceName, serviceObject); + return rmiHosts.getRMIHosts().get(0).findService(uri); } - public void unregisterService(String serviceName) throws RMIHostException, RMIHostRuntimeException { - if (rmiHosts.getRMIHosts().isEmpty()) { - throw new RMIHostException("No RMI host available"); - } - rmiHosts.getRMIHosts().get(0).unregisterService(serviceName); - } - - public void unregisterService(String serviceName, int port) throws RMIHostException, RMIHostRuntimeException { - if (rmiHosts.getRMIHosts().isEmpty()) { - throw new RMIHostException("No RMI host available"); - } - rmiHosts.getRMIHosts().get(0).unregisterService(serviceName, port); - } - } -- cgit v1.2.3