User: norbert
Date: 00/06/15 16:21:41
Modified: src/java/org/spydermq/distributed/server
ConnectionReceiverOIL.java
ConnectionReceiverOILClient.java
Log:
More work on the OIL
Revision Changes Path
1.3 +5 -11
spyderMQ/src/java/org/spydermq/distributed/server/ConnectionReceiverOIL.java
Index: ConnectionReceiverOIL.java
===================================================================
RCS file:
/products/cvs/ejboss/spyderMQ/src/java/org/spydermq/distributed/server/ConnectionReceiverOIL.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ConnectionReceiverOIL.java 2000/06/15 22:50:31 1.2
+++ ConnectionReceiverOIL.java 2000/06/15 23:21:40 1.3
@@ -38,7 +38,7 @@
*
* @author Norbert Lataille ([EMAIL PROTECTED])
*
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class ConnectionReceiverOIL
implements ConnectionReceiver, Runnable
@@ -60,7 +60,7 @@
// Internals -----------------------------------------------------
// Should be hold in an "extention" and the ConnectionReceiver logic should be
in a separated object
- // Why not generate a dynamic proxy for that :)
+ // We could generate a dynamic proxy for that...
static final int RECEIVE = 1;
static final int RECEIVE_MULTIPLE = 2;
@@ -106,8 +106,6 @@
while (true) {
- Log.log("Wait for command");
-
try {
code=is.read();
} catch (IOException e) {
@@ -117,8 +115,6 @@
try {
- Log.log("code = "+code);
-
switch (code)
{
case RECEIVE:
@@ -138,7 +134,6 @@
}
//Everthing was OK
- Log.log("OK !");
try {
os.write(0);
@@ -149,11 +144,10 @@
}
} catch (Exception e) {
- Log.log("Throw exception");
- Log.error(e);
try {
os.write(1);
+ out.writeObject(e.getMessage());
os.flush();
} catch (IOException e2) {
failure("Result write",e2);
@@ -167,7 +161,7 @@
void failure(String st,Exception e)
{
- Log.error(st);
+ Log.error("Closing socket: "+st);
Log.error(e);
}
@@ -186,7 +180,7 @@
//A message has arrived for this Connection, We have to dispatch it to the
sessions
public void receive(SpyDestination dest,SpyMessage mes) throws JMSException
- {
+ {
if (closed) throw new IllegalStateException("The connection is
closed");
Log.log("ConnectionReceiver:
Receive(Destination="+dest.toString()+",Mes="+mes.toString()+")");
1.3 +7 -4
spyderMQ/src/java/org/spydermq/distributed/server/ConnectionReceiverOILClient.java
Index: ConnectionReceiverOILClient.java
===================================================================
RCS file:
/products/cvs/ejboss/spyderMQ/src/java/org/spydermq/distributed/server/ConnectionReceiverOILClient.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ConnectionReceiverOILClient.java 2000/06/15 22:50:31 1.2
+++ ConnectionReceiverOILClient.java 2000/06/15 23:21:40 1.3
@@ -53,24 +53,27 @@
}
}
- public void waitAnswer() throws RemoteException
+ public void waitAnswer() throws Exception
{
try {
int val=is.read();
if (val==0) Log.log("Return : OK");
else {
Log.log("Return : Exception");
- throw new RemoteException("Remote Exception");
+ String st=(String)in.readObject();
+ throw new RemoteException(st);
}
} catch (IOException e) {
Log.error("IOException while reading the answer");
Log.error(e);
- throw new RemoteException("Cannot contact the Distant object");
+ throw new RemoteException("Cannot contact the remote object");
+ } catch (ClassNotFoundException e) {
+ throw new RemoteException("ClassNotFoundException");
}
}
public void receive(SpyDestination dest,SpyMessage mes) throws Exception
- {
+ {
if (socket==null) createConnection();
os.write(RECEIVE);
out.writeObject(dest);