summaryrefslogtreecommitdiffstats
path: root/libjava/java/rmi/server/UnicastRemoteObject.java
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2002-10-01 03:46:43 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2002-10-01 03:46:43 +0000
commit1834f2d6e707af5e33654167ac0b3844210764c3 (patch)
treebf757dbbf21b52fd568fba72014b0347b815ecdb /libjava/java/rmi/server/UnicastRemoteObject.java
parent52d972392150fc1a07734a90ba55586e7cee710b (diff)
downloadppe42-gcc-1834f2d6e707af5e33654167ac0b3844210764c3.tar.gz
ppe42-gcc-1834f2d6e707af5e33654167ac0b3844210764c3.zip
* java/io/ObjectInputStream.java (resolveProxyClass): New method
from Classpath. * Makefile.in: Rebuilt. * Makefile.am (rmi_java_source_files): Added new files. * gnu/java/rmi/RMIMarshalledObjectInputStream.java, gnu/java/rmi/RMIMarshalledObjectOutputStream.java, gnu/java/rmi/server/ConnectionRunnerPool.java: New files from Classpath. * gnu/java/rmi/dgc/DGCImpl.java, gnu/java/rmi/dgc/DGCImpl_Skel.java, gnu/java/rmi/dgc/DGCImpl_Stub.java, gnu/java/rmi/registry/RegistryImpl_Skel.java, gnu/java/rmi/registry/RegistryImpl_Stub.java, gnu/java/rmi/server/RMIHashes.java, gnu/java/rmi/server/RMIObjectInputStream.java, gnu/java/rmi/server/RMIObjectOutputStream.java, gnu/java/rmi/server/UnicastConnection.java, gnu/java/rmi/server/UnicastConnectionManager.java, gnu/java/rmi/server/UnicastRef.java, gnu/java/rmi/server/UnicastServer.java, gnu/java/rmi/server/UnicastServerRef.java, java/rmi/MarshalledObject.java, java/rmi/server/RMIClassLoader.java, java/rmi/server/RemoteObject.java, java/rmi/server/UnicastRemoteObject.java, java/security/SecureClassLoader.java: Merged from Classpath. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57675 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/rmi/server/UnicastRemoteObject.java')
-rw-r--r--libjava/java/rmi/server/UnicastRemoteObject.java71
1 files changed, 59 insertions, 12 deletions
diff --git a/libjava/java/rmi/server/UnicastRemoteObject.java b/libjava/java/rmi/server/UnicastRemoteObject.java
index 5571b9f0b49..a9c4f35099c 100644
--- a/libjava/java/rmi/server/UnicastRemoteObject.java
+++ b/libjava/java/rmi/server/UnicastRemoteObject.java
@@ -42,10 +42,17 @@ import java.rmi.Remote;
import java.rmi.server.RemoteRef;
import java.rmi.NoSuchObjectException;
import gnu.java.rmi.server.UnicastServerRef;
+import gnu.java.rmi.server.UnicastServer;
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;
+
protected UnicastRemoteObject() throws RemoteException {
this(0);
}
@@ -55,11 +62,21 @@ protected UnicastRemoteObject(int port) throws RemoteException {
}
protected UnicastRemoteObject(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException {
- super(new UnicastServerRef(new ObjID(), port, ssf));
+ this.port = port;
+ //Is RMIXXXSocketFactory serializable
+ //this.csf = csf;
+ //this.ssf = ssf;
+ this.ref = new UnicastServerRef(new ObjID(), port, ssf);
+ //Should we export it here?
+ // if we export, we got infinite recursive call:
+ // UnicastRemoteObject.<init>->...->UnicastServer.startDGC()->UnicastRemoteObject.<init>->...
+ //exportObject(this);
}
protected UnicastRemoteObject(RemoteRef ref) throws RemoteException {
super((UnicastServerRef)ref);
+ //Should we export it here?
+ //exportObject(this);
}
public Object clone() throws CloneNotSupportedException {
@@ -71,16 +88,46 @@ public static RemoteStub exportObject(Remote obj) throws RemoteException {
return (sref.exportObject(obj));
}
-public static Remote exportObject(Remote obj, int port) throws RemoteException {
- return (exportObject(obj));
-}
-
-public static Remote exportObject(Remote obj, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException {
- return (exportObject(obj));
-}
-
-public static boolean unexportObject(Remote obj, boolean force) throws NoSuchObjectException {
- throw new Error("Not implemented");
-}
+ public static Remote exportObject(Remote obj, int port) throws RemoteException
+ {
+ return exportObject(obj, port, null);
+ }
+
+ protected static Remote exportObject(Remote obj, int port, RMIServerSocketFactory ssf)
+ throws RemoteException
+ {
+ UnicastServerRef sref = null;
+ if (obj instanceof RemoteObject)
+ sref = (UnicastServerRef)((RemoteObject)obj).getRef ();
+ if(sref == null)
+ {
+ sref = new UnicastServerRef(new ObjID (), port, ssf);
+ }
+ return (sref.exportObject (obj));
+ }
+
+ /**
+ * FIX ME
+ */
+ public static Remote exportObject(Remote obj, int port, RMIClientSocketFactory csf,
+ RMIServerSocketFactory ssf)
+ throws RemoteException
+ {
+ return (exportObject(obj, port, ssf));
+ }
+
+ public static boolean unexportObject(Remote obj, boolean force)
+ throws RemoteException, NoSuchObjectException
+ {
+ if (obj instanceof RemoteObject)
+ {
+ UnicastServerRef sref = (UnicastServerRef)((RemoteObject)obj).getRef();
+ return sref.unexportObject(obj, force);
+ }
+ else
+ //FIX ME
+ ;
+ return true;
+ }
}
OpenPOWER on IntegriCloud