commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/socket CompleteSocketObjectStreamServer.java PartialSocketObjectStreamServer.java
Date Sun, 13 Jan 2002 10:30:23 GMT
hammant     02/01/13 02:30:23

  Modified:    altrmi/src/java/org/apache/commons/altrmi/client/impl
                        BaseServedObject.java
                        ObjectStreamInvocationHandler.java
               altrmi/src/java/org/apache/commons/altrmi/server/impl
                        ObjectStreamServerConnection.java
               altrmi/src/java/org/apache/commons/altrmi/server/impl/socket
                        CompleteSocketObjectStreamServer.java
                        PartialSocketObjectStreamServer.java
  Log:
  further patches for JDK1.4b1 capability and use in Beanshell
  
  Revision  Changes    Path
  1.3       +10 -1     jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/BaseServedObject.java
  
  Index: BaseServedObject.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/BaseServedObject.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BaseServedObject.java	13 Jan 2002 00:13:53 -0000	1.2
  +++ BaseServedObject.java	13 Jan 2002 10:30:23 -0000	1.3
  @@ -27,7 +27,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public final class BaseServedObject {
   
  @@ -170,6 +170,7 @@
   
           MethodRequest request = new MethodRequest(mPublishedServiceName, mObjectName,
                                                     methodSignature, args, mReferenceID);
  +        //debug(args);
           AltrmiReply reply = mInvocationHandler.handleInvocation(request);
   
           if (reply.getReplyCode() == AltrmiReply.METHODREPLY) {
  @@ -202,4 +203,12 @@
   
           return new FacadeRefHolder(refID, objectName);
       }
  +
  +    private void debug(Object[] args) {
  +        for (int i = 0; i < args.length; i++) {
  +            Object arg = args[i];
  +            System.out.println("i = " + i + " class= " + args[i].getClass().getName() +
" " + args[i].toString());
  +        }
  +    }
  +
   }
  
  
  
  1.2       +5 -3      jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/ObjectStreamInvocationHandler.java
  
  Index: ObjectStreamInvocationHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/ObjectStreamInvocationHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ObjectStreamInvocationHandler.java	9 Jan 2002 19:25:53 -0000	1.1
  +++ ObjectStreamInvocationHandler.java	13 Jan 2002 10:30:23 -0000	1.2
  @@ -26,6 +26,7 @@
   import java.io.IOException;
   import java.io.ObjectOutputStream;
   import java.io.ObjectInputStream;
  +import java.io.EOFException;
   import java.net.SocketException;
   
   
  @@ -34,7 +35,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public abstract class ObjectStreamInvocationHandler extends AltrmiClientInvocationHandler
{
   
  @@ -120,14 +121,15 @@
                               }
                           }
                       } catch (IOException ioe) {
  -                        if (ioe instanceof SocketException) {
  +                        if (ioe instanceof SocketException |  ioe instanceof EOFException)
{
                               int retryConnectTries = 0;
                               while (!tryReconnect()) {
                                   mAltrmiConnectionListener.serviceAbend(retryConnectTries);
                                   retryConnectTries++;
                               }
                           } else {
  -                            throw new AltrmiInvocationException("IO Exception during invocation
to server"
  +                            ioe.printStackTrace();
  +                            throw new AltrmiInvocationException("IO Exception during invocation
to server :"
                                                 + ioe.getMessage());
                           }
                       }
  
  
  
  1.2       +3 -1      jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/ObjectStreamServerConnection.java
  
  Index: ObjectStreamServerConnection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/ObjectStreamServerConnection.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ObjectStreamServerConnection.java	9 Jan 2002 19:25:55 -0000	1.1
  +++ ObjectStreamServerConnection.java	13 Jan 2002 10:30:23 -0000	1.2
  @@ -30,7 +30,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public abstract class ObjectStreamServerConnection implements Runnable, AltrmiServerConnection
{
   
  @@ -84,6 +84,8 @@
                       }
   
                   } catch (IOException ioe) {
  +                    System.out.println("IOE in ObjStream");
  +                    ioe.printStackTrace();
                       // pipe closed?
                       more = false;
                   }
  
  
  
  1.2       +2 -0      jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/socket/CompleteSocketObjectStreamServer.java
  
  Index: CompleteSocketObjectStreamServer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/socket/CompleteSocketObjectStreamServer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CompleteSocketObjectStreamServer.java	9 Jan 2002 22:42:56 -0000	1.1
  +++ CompleteSocketObjectStreamServer.java	13 Jan 2002 10:30:23 -0000	1.2
  @@ -27,7 +27,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class CompleteSocketObjectStreamServer extends AbstractServer implements Runnable
{
   
  @@ -63,6 +63,8 @@
           try {
               while (mState == STARTED) {
                   Socket sock = mServerSocket.accept();
  +                // see http://developer.java.sun.com/developer/bugParade/bugs/4508149.html
  +                sock.setSoTimeout(360000);
                   SocketObjectStreamServerConnection ossc = new SocketObjectStreamServerConnection(this,
sock,
                           sock.getInputStream(), sock.getOutputStream());
                   Thread thread = new Thread(ossc);
  
  
  
  1.2       +10 -0     jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/socket/PartialSocketObjectStreamServer.java
  
  Index: PartialSocketObjectStreamServer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/server/impl/socket/PartialSocketObjectStreamServer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PartialSocketObjectStreamServer.java	9 Jan 2002 22:42:56 -0000	1.1
  +++ PartialSocketObjectStreamServer.java	13 Jan 2002 10:30:23 -0000	1.2
  @@ -11,6 +11,7 @@
   import org.apache.commons.altrmi.server.AltrmiServerException;
   
   import java.net.Socket;
  +import java.net.SocketException;
   import java.io.IOException;
   
   
  @@ -19,7 +20,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class PartialSocketObjectStreamServer extends AbstractServer {
   
  @@ -41,6 +42,14 @@
        */
       public void handleConnection( final Socket sock ) {
   
  +        // see http://developer.java.sun.com/developer/bugParade/bugs/4508149.html
  +        try {
  +          sock.setSoTimeout(360000);
  +        } catch (SocketException se) {
  +            se.printStackTrace();
  +        }
  +
  +
           try {
               if (mState == STARTED) {
                   SocketObjectStreamServerConnection ossc = new SocketObjectStreamServerConnection(this,
sock, sock.getInputStream(), sock.getOutputStream());
  @@ -48,6 +57,7 @@
               }
           } catch (IOException ioe) {
               System.err.println("Some problem connecting client via sockets.");
  +            ioe.printStackTrace();
           }
       }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message