summaryrefslogtreecommitdiffstats
path: root/libjava/java/rmi
diff options
context:
space:
mode:
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-25 14:38:02 +0000
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-25 14:38:02 +0000
commitb6631c76074cafa0c492db90d97ee17dd4ed8be6 (patch)
tree98e9b1795bf4d73975fa89445f54388b466fb553 /libjava/java/rmi
parent1ba8a5f4e275834d3d7d25b78838bef0c2dc7fbd (diff)
downloadppe42-gcc-b6631c76074cafa0c492db90d97ee17dd4ed8be6.tar.gz
ppe42-gcc-b6631c76074cafa0c492db90d97ee17dd4ed8be6.zip
2003-09-25 Sascha Brawer <brawer@dandelis.ch>
* java/awt/font/FontRenderContext.java (getTransform): Return copy of internal transform object. Add Javadoc. * java/awt/geom/Rectangle2D.java (getPathIterator): Use the same winding rule as Sun J2SE. * javax/swing/border/MatteBorder.java (MatteBorder(Icon)): Docfix. 2003-09-25 Ingo Proetel <proetel@aicas.com> * java/rmi/Naming.java: Added comments, now accepts pseudo protocol "rmi". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71777 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/rmi')
-rw-r--r--libjava/java/rmi/Naming.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/libjava/java/rmi/Naming.java b/libjava/java/rmi/Naming.java
index b558976eba1..2dd50d32804 100644
--- a/libjava/java/rmi/Naming.java
+++ b/libjava/java/rmi/Naming.java
@@ -44,26 +44,72 @@ import java.rmi.registry.LocateRegistry;
public final class Naming {
+/** <pre>
+ * Looks for the remote object that is associated with the named service.
+ * Name and location is given in form of a URL without a scheme:
+ *
+ * //host:port/service-name
+ *
+ * The port is optional.
+ * </pre>
+ * @param name the service name and location
+ * @return Remote-object that implements the named service
+ * @throws NotBoundException if no object implements the service
+ * @throws MalformedURLException
+ * @throws RemoteException
+ */
public static Remote lookup(String name) throws NotBoundException, MalformedURLException, RemoteException {
+ // hack to accept "rmi://host:port/service" strings
+ if(name.startsWith("rmi:")){ name = name.substring(4); }
URL u = new URL("http:" + name);
return (getRegistry(u).lookup(u.getFile().substring(1)));
}
+/**
+ * Try to bind the given object to the given service name.
+ * @param name
+ * @param obj
+ * @throws AlreadyBoundException
+ * @throws MalformedURLException
+ * @throws RemoteException
+ */
public static void bind(String name, Remote obj) throws AlreadyBoundException, MalformedURLException, RemoteException {
URL u = new URL("http:" + name);
getRegistry(u).bind(u.getFile().substring(1), obj);
}
+/**
+ * Remove a binding for a given service name.
+ * @param name
+ * @throws RemoteException
+ * @throws NotBoundException
+ * @throws MalformedURLException
+ */
public static void unbind(String name) throws RemoteException, NotBoundException, MalformedURLException {
URL u = new URL("http:" + name);
getRegistry(u).unbind(u.getFile().substring(1));
}
+/**
+ * Forces the binding between the given Remote-object and the given service name, even
+ * if there was already an object bound to this name.
+ * @param name
+ * @param obj
+ * @throws RemoteException
+ * @throws MalformedURLException
+ */
public static void rebind(String name, Remote obj) throws RemoteException, MalformedURLException {
URL u = new URL("http:" + name);
getRegistry(u).rebind(u.getFile().substring(1), obj);
}
+/**
+ * Lists all services at the named registry.
+ * @param name url that specifies the registry
+ * @return list of services at the name registry
+ * @throws RemoteException
+ * @throws MalformedURLException
+ */
public static String[] list(String name) throws RemoteException, MalformedURLException {
return (getRegistry(new URL("http:" + name)).list());
}
OpenPOWER on IntegriCloud