summaryrefslogtreecommitdiff
path: root/gnu/java/rmi/server/UnicastRemoteCall.java
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2004-03-21 10:10:14 +0000
committerMichael Koch <konqueror@gmx.de>2004-03-21 10:10:14 +0000
commit1ea4bde3447a9c4e437be979b5dc8860d89031cd (patch)
treeb8743b4206429436c98f9e24b4101497e131d09b /gnu/java/rmi/server/UnicastRemoteCall.java
parent9e70865e826bf2816d7343924e003fe24d42b07f (diff)
downloadclasspath-1ea4bde3447a9c4e437be979b5dc8860d89031cd.tar.gz
2004-03-21 Norbert Frese <postfach@nfrese.net>
* gnu/java/rmi/server/RMIIncomingThread.java: New file. * gnu/java/rmi/server/UnicastConnection.java: Create a new RMIObjectOuputStream/RMIObjectInputStream for every rmi-message. (getObjectInputStream): Return object reference, throw IOException if null. (startObjectInputStream): Create new RMIObjectInputStream on top of 'din'. (getObjectOutputStream): Return object reference, throw IOException if null. (startObjectOutputStream): Create new RMIObjectOutputStream on top of 'dout'. * gnu/java/rmi/server/UnicastConnectionManager.java: (UnicastConnectionManager): Throw RemoteException if port is not available. (getInstance): Throw RemoteException. (run): Lookup client host and attach it to new RMIIncomingThread for later retrieval. * gnu/java/rmi/server/UnicastRef.java: Start a new RMIObjectInputStream/RMIObjectOutputStream for every rmi-message. Collect Exceptions which are returned by a rmi-call and fix void returns. * gnu/java/rmi/server/UnicastRemoteCall.java: Start a new RMIObjectInputStream/RMIObjectOutputStream for every rmi-message. * gnu/java/rmi/server/UnicastServer.java: (dispatch): Answer ping messages which are sent by other java implementions. (incomingMessageCall): Start a new RMIObjectInputStream/RMIObjectOutputStream for every rmi-message and fix void return problems. * gnu/java/rmi/server/UnicastServerRef.java (UnicastServerRef): Throw RemoteException. (exportObject): Find the class up the class hierarchy which has a _Stub generated by rmic. In some situations it is necessary to export a subclass of the class which has the _Stub. For instance when the class with has the _Stub is abstract. (findStubSkelClass): New method which looks for the class which has the _Stub. (getClientHost): Implementated. * java/rmi/server/RemoteServer.java (getClientHost): Implemented. * gnu/java/rmi/server/Makefile.am (EXTRA_DIST): RMIIncomingThread.java.
Diffstat (limited to 'gnu/java/rmi/server/UnicastRemoteCall.java')
-rw-r--r--gnu/java/rmi/server/UnicastRemoteCall.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/gnu/java/rmi/server/UnicastRemoteCall.java b/gnu/java/rmi/server/UnicastRemoteCall.java
index 2d7d6d4a9..76dd8e215 100644
--- a/gnu/java/rmi/server/UnicastRemoteCall.java
+++ b/gnu/java/rmi/server/UnicastRemoteCall.java
@@ -138,6 +138,21 @@ public class UnicastRemoteCall
oout.flush();
}
+ /**
+ *
+ * (re)starts ObjectInputStream
+ *
+ */
+ public ObjectInput startInputStream() throws IOException
+ {
+ if (conn != null) {
+ return (oin = conn.startObjectInputStream());
+ } else {
+ return getInputStream(); // dummy Input Stream
+ }
+
+ }
+
public ObjectInput getInputStream() throws IOException
{
if (conn != null)
@@ -177,7 +192,7 @@ public class UnicastRemoteCall
DataOutputStream dout = conn.getDataOutputStream();
dout.write(MESSAGE_CALL);
- oout = conn.getObjectOutputStream();
+ oout = conn.startObjectOutputStream(); // (re)start ObjectOutputStream
objid.write(oout);
oout.writeInt(opnum);
oout.writeLong(hash);
@@ -194,7 +209,7 @@ public class UnicastRemoteCall
if (din.readByte() != MESSAGE_CALL_ACK)
throw new RemoteException("Call not acked");
- oin = getInputStream();
+ oin = startInputStream();
returncode = oin.readByte();
UID.read(oin);
}