From 13b7f97dd44734f792038d514a06bb276c7ba0dc Mon Sep 17 00:00:00 2001 From: wjaniszewski Date: Fri, 1 Aug 2008 22:27:33 +0000 Subject: 1. SCA default binding over CORBA - now transient name server is beeing created automatically for localhost service bindings. 2. Code cleanup git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@681871 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tuscany/sca/host/corba/CorbaHost.java | 21 +++++++++++++++++++-- .../tuscany/sca/host/corba/ExtensibleCorbaHost.java | 9 ++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) (limited to 'java/sca/modules/host-corba/src/main') diff --git a/java/sca/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbaHost.java b/java/sca/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbaHost.java index f68fb21737..17e9566e17 100644 --- a/java/sca/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbaHost.java +++ b/java/sca/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/CorbaHost.java @@ -19,7 +19,6 @@ package org.apache.tuscany.sca.host.corba; -import org.omg.CORBA.ORB; import org.omg.CORBA.Object; /** @@ -29,6 +28,7 @@ public interface CorbaHost { /** * Registers servant in name server. + * * @param uri corbaname URI * @param serviceObject * @throws CorbaHostException @@ -37,18 +37,35 @@ public interface CorbaHost { /** * Removes servant from name server + * * @param orb The ORB instance * @param name binding name * @throws CorbaHostException */ void unregisterServant(String uri) throws CorbaHostException; - + /** * Gets reference to object + * * @param name binding name * @return objects reference * @throws CorbaHostException */ Object lookup(String uri) throws CorbaHostException; + /** + * Provides name server under given port. + * + * @param port + * @throws CorbaHostException + */ + void createLocalNameServer(int port) throws CorbaHostException; + + /** + * Stops name server but only if every client released previously created NS. + * + * @param port + * @throws CorbaHostException + */ + void releaseLocalNameServer(int port) throws CorbaHostException; } diff --git a/java/sca/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/ExtensibleCorbaHost.java b/java/sca/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/ExtensibleCorbaHost.java index 73471d658a..1c36fca57d 100644 --- a/java/sca/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/ExtensibleCorbaHost.java +++ b/java/sca/modules/host-corba/src/main/java/org/apache/tuscany/sca/host/corba/ExtensibleCorbaHost.java @@ -19,7 +19,6 @@ package org.apache.tuscany.sca.host.corba; -import org.omg.CORBA.ORB; import org.omg.CORBA.Object; /** @@ -52,4 +51,12 @@ public class ExtensibleCorbaHost implements CorbaHost { return hosts.getCorbaHosts().get(0); } + public void createLocalNameServer(int port) throws CorbaHostException { + getCorbaHost().createLocalNameServer(port); + } + + public void releaseLocalNameServer(int port) throws CorbaHostException { + getCorbaHost().releaseLocalNameServer(port); + } + } -- cgit v1.2.3