summaryrefslogtreecommitdiff
path: root/java/rmi/server/UnicastRemoteObject.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/rmi/server/UnicastRemoteObject.java')
-rw-r--r--java/rmi/server/UnicastRemoteObject.java104
1 files changed, 61 insertions, 43 deletions
diff --git a/java/rmi/server/UnicastRemoteObject.java b/java/rmi/server/UnicastRemoteObject.java
index dbe25bda3..195f6788e 100644
--- a/java/rmi/server/UnicastRemoteObject.java
+++ b/java/rmi/server/UnicastRemoteObject.java
@@ -46,59 +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 {
- UnicastServerRef sref = (UnicastServerRef)((RemoteObject)obj).getRef();
- return (sref.exportObject(obj));
-}
+ 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;
}
@@ -106,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));
@@ -118,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;
}