diff options
author | Roman Kennke <roman@kennke.org> | 2006-02-13 17:15:09 +0000 |
---|---|---|
committer | Roman Kennke <roman@kennke.org> | 2006-02-13 17:15:09 +0000 |
commit | 7590587abcf43ed62962eea18bedaf76d7111126 (patch) | |
tree | daa90b50d4f4ae527e81f2ea6754eca3b92161fe /java | |
parent | 697d556cd2f4f52e702b5ebe063c5a826cca9c96 (diff) | |
download | classpath-7590587abcf43ed62962eea18bedaf76d7111126.tar.gz |
2006-02-13 Roman Kennke <kennke@aicas.com>
* java/rmi/server/UnicastRemoteObject.java: Reformatted.
Diffstat (limited to 'java')
-rw-r--r-- | java/rmi/server/UnicastRemoteObject.java | 101 |
1 files changed, 60 insertions, 41 deletions
diff --git a/java/rmi/server/UnicastRemoteObject.java b/java/rmi/server/UnicastRemoteObject.java index 118e8a193..195f6788e 100644 --- a/java/rmi/server/UnicastRemoteObject.java +++ b/java/rmi/server/UnicastRemoteObject.java @@ -46,58 +46,75 @@ import java.rmi.RemoteException; public class UnicastRemoteObject extends RemoteServer { -private static final long serialVersionUID = 4974527148936298033L; -//The following serialized fields are from Java API Documentation "Serialized form" -private int port = 0; -private RMIClientSocketFactory csf = null; -private RMIServerSocketFactory ssf = null; + private static final long serialVersionUID = 4974527148936298033L; -protected UnicastRemoteObject() throws RemoteException { + //The following serialized fields are from Java API Documentation + // "Serialized form" + private int port = 0; + private RMIClientSocketFactory csf = null; + private RMIServerSocketFactory ssf = null; + + protected UnicastRemoteObject() + throws RemoteException + { this(0); -} + } -protected UnicastRemoteObject(int port) throws RemoteException { - this(port, RMISocketFactory.getSocketFactory(), RMISocketFactory.getSocketFactory()); -} + protected UnicastRemoteObject(int port) + throws RemoteException + { + this(port, RMISocketFactory.getSocketFactory(), + RMISocketFactory.getSocketFactory()); + } -protected UnicastRemoteObject(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException { - this.port = port; - //Is RMIXXXSocketFactory serializable - //this.csf = csf; - //this.ssf = ssf; - this.ref = new UnicastServerRef(new ObjID(), port, ssf); - exportObject(this); -} + protected UnicastRemoteObject(int port, RMIClientSocketFactory csf, + RMIServerSocketFactory ssf) + throws RemoteException + { + this.port = port; + //Is RMIXXXSocketFactory serializable + //this.csf = csf; + //this.ssf = ssf; + this.ref = new UnicastServerRef(new ObjID(), port, ssf); + exportObject(this); + } -protected UnicastRemoteObject(RemoteRef ref) throws RemoteException { - super((UnicastServerRef)ref); + protected UnicastRemoteObject(RemoteRef ref) + throws RemoteException + { + super((UnicastServerRef) ref); exportObject(this); -} + } -public Object clone() throws CloneNotSupportedException { + public Object clone() + throws CloneNotSupportedException + { throw new Error("Not implemented"); -} + } -public static RemoteStub exportObject(Remote obj) throws RemoteException { + public static RemoteStub exportObject(Remote obj) + throws RemoteException + { return (RemoteStub) exportObject(obj, 0); -} + } - public static Remote exportObject(Remote obj, int port) throws RemoteException + public static Remote exportObject(Remote obj, int port) + throws RemoteException { return exportObject(obj, port, null); } - + static Remote exportObject(Remote obj, int port, RMIServerSocketFactory ssf) - throws RemoteException + throws RemoteException { UnicastServerRef sref = null; if (obj instanceof RemoteObject) - sref = (UnicastServerRef)((RemoteObject)obj).getRef (); - if(sref == null) - { - sref = new UnicastServerRef(new ObjID (), port, ssf); - } - Remote stub = sref.exportObject (obj); + sref = (UnicastServerRef) ((RemoteObject) obj).getRef(); + + if (sref == null) + sref = new UnicastServerRef(new ObjID(), port, ssf); + + Remote stub = sref.exportObject(obj); addStub(obj, stub); return stub; } @@ -105,8 +122,9 @@ public static RemoteStub exportObject(Remote obj) throws RemoteException { /** * FIXME */ - public static Remote exportObject(Remote obj, int port, RMIClientSocketFactory csf, - RMIServerSocketFactory ssf) + public static Remote exportObject(Remote obj, int port, + RMIClientSocketFactory csf, + RMIServerSocketFactory ssf) throws RemoteException { return (exportObject(obj, port, ssf)); @@ -117,14 +135,15 @@ public static RemoteStub exportObject(Remote obj) throws RemoteException { { if (obj instanceof RemoteObject) { - deleteStub(obj); - UnicastServerRef sref = (UnicastServerRef)((RemoteObject)obj).getRef(); - return sref.unexportObject(obj, force); + deleteStub(obj); + UnicastServerRef sref = + (UnicastServerRef) ((RemoteObject) obj).getRef(); + return sref.unexportObject(obj, force); } else { - //FIX ME - ; + // FIXME + ; } return true; } |