summaryrefslogtreecommitdiff
path: root/libjava/gnu/java/rmi/server/UnicastRemoteCall.java
diff options
context:
space:
mode:
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-20 20:30:56 +0000
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-20 20:30:56 +0000
commite835c12a0e664d4b68ae8f0b19ddc7c28e3acf17 (patch)
tree46489ab9dc40917ff9013121644478cc830a4a4e /libjava/gnu/java/rmi/server/UnicastRemoteCall.java
parent041207ec5e4b7b2c48f43b72cc1beafefe24ad99 (diff)
downloadgcc-e835c12a0e664d4b68ae8f0b19ddc7c28e3acf17.tar.gz
2004-03-20 Norbert Frese <postfach@nfrese.net>
* gnu/java/rmi/server/RMIIncomingThread.java: New file. * gcc/libjava/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'. * gcc/libjava/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. * gcc/libjava/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. * gcc/libjava/gnu/java/rmi/server/UnicastRemoteCall.java: Start a new RMIObjectInputStream/RMIObjectOutputStream for every rmi-message. * gcc/libjava/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. * gcc/libjava/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. * gcc/libjava/java/rmi/server/RemoteServer.java (getClientHost): Implementated. * gcc/libjava/Makefile.am (rmi_java_source_files): Added gnu/java/rmi/server/RMIIncomingThread.java. * Makefile.in: Regenerated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79755 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu/java/rmi/server/UnicastRemoteCall.java')
-rw-r--r--libjava/gnu/java/rmi/server/UnicastRemoteCall.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/libjava/gnu/java/rmi/server/UnicastRemoteCall.java b/libjava/gnu/java/rmi/server/UnicastRemoteCall.java
index 2d7d6d4a9ff..76dd8e215b7 100644
--- a/libjava/gnu/java/rmi/server/UnicastRemoteCall.java
+++ b/libjava/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);
}