hammant     2003/01/19 03:10:01

  Modified:    altrmi   default.properties
               altrmi/src/java/org/apache/excalibur/altrmi/client
                        ClientInvocationHandler.java
                        ConnectionListener.java
               altrmi/src/java/org/apache/excalibur/altrmi/client/impl
                        AbstractClientInvocationHandler.java
                        AbstractConnectionPinger.java
                        DefaultConnectionListener.java
                        DefaultProxyHelper.java DumbConnectionListener.java
               altrmi/src/java/org/apache/excalibur/altrmi/client/impl/callback/stream
                        CallbackEnabledClientCustomStreamReadWriter.java
               altrmi/src/java/org/apache/excalibur/altrmi/client/impl/direct
                        AbstractDirectInvocationHandler.java
               altrmi/src/java/org/apache/excalibur/altrmi/client/impl/multiple
                        AbstractMultipleInvocationHandler.java
               altrmi/src/java/org/apache/excalibur/altrmi/client/impl/rmi
                        RmiClientInvocationHandler.java
               altrmi/src/java/org/apache/excalibur/altrmi/client/impl/socket
                        AbstractSocketStreamInvocationHandler.java
               altrmi/src/java/org/apache/excalibur/altrmi/client/impl/stream
                        StreamInvocationHandler.java
               altrmi/src/java/org/apache/excalibur/altrmi/common
                        ConnectionException.java
               altrmi/src/java/org/apache/excalibur/altrmi/server/impl
                        AbstractServer.java ServerStreamReadWriter.java
                        StreamServerConnection.java
               altrmi/src/java/org/apache/excalibur/altrmi/server/impl/http
                        CustomHttpServer.java
               altrmi/src/java/org/apache/excalibur/altrmi/server/impl/piped
                        AbstractPipedServer.java
                        PipedStreamServerConnection.java
               altrmi/src/java/org/apache/excalibur/altrmi/server/impl/rmi
                        RmiServer.java
               altrmi/src/java/org/apache/excalibur/altrmi/server/impl/socket
                        AbstractCompleteSocketStreamServer.java
                        AbstractPartialSocketStreamServer.java
                        SocketStreamServerConnection.java
               altrmi/src/test/org/apache/excalibur/altrmi/client/impl
                        DefaultConnectionPingerTestCase.java
               altrmi/src/test/org/apache/excalibur/altrmi/test
                        BasicClientServerTestCase.java
  Added:       altrmi/src/java/org/apache/excalibur/altrmi/server/impl
                        ConsoleServerMonitor.java
                        LogEnabledServerMonitor.java NullServerMonitor.java
               altrmi/src/test/org/apache/excalibur/altrmi/test
                        DummyInvocationHandler.java
               altrmi/src/java/org/apache/excalibur/altrmi/server
                        ServerMonitor.java
  Removed:     altrmi/src/test/org/apache/excalibur/altrmi/client/impl
                        DummyInvocationHandler.java
  Log:
  AbstractLogEnabled mostly removed. ServerMonitor created.
  
  Revision  Changes    Path
  1.22      +1 -1      jakarta-avalon-excalibur/altrmi/default.properties
  
  Index: default.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/default.properties,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- default.properties        12 Jan 2003 22:09:12 -0000      1.21
  +++ default.properties        19 Jan 2003 11:09:59 -0000      1.22
  @@ -8,7 +8,7 @@
   name=excalibur-altrmi
   Name=Excalibur AltRMI
   dir-name=altrmi
  -version=0.8
  +version=0.9
   year=2002-2003
   
   common.jar.name=${name}-common-${version}.jar
  
  
  
  1.4       +7 -1      
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/ClientInvocationHandler.java
  
  Index: ClientInvocationHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/ClientInvocationHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ClientInvocationHandler.java      9 Jan 2003 22:55:09 -0000       1.3
  +++ ClientInvocationHandler.java      19 Jan 2003 11:09:59 -0000      1.4
  @@ -31,6 +31,12 @@
       void setConnectionListener( ConnectionListener altrmiConnectionListener );
   
       /**
  +     * Get the connection Listener.
  +     * @return the connection listener.
  +     */
  +    ConnectionListener getConnectionListener();
  +
  +    /**
        * Method setConnectionPinger
        *
        *
  
  
  
  1.3       +10 -3     
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/ConnectionListener.java
  
  Index: ConnectionListener.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/ConnectionListener.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ConnectionListener.java   5 Jan 2003 23:24:08 -0000       1.2
  +++ ConnectionListener.java   19 Jan 2003 11:09:59 -0000      1.3
  @@ -8,6 +8,7 @@
   package org.apache.excalibur.altrmi.client;
   
   import org.apache.excalibur.altrmi.common.Request;
  +import org.apache.excalibur.altrmi.common.InvocationException;
   
   import java.io.IOException;
   
  @@ -15,7 +16,7 @@
    * Interface ConnectionListener
    *
    *
  - * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  + * @author Paul Hammant
    * @version * $Revision$
    */
   public interface ConnectionListener
  @@ -30,7 +31,7 @@
        * @param duration
        *
        */
  -    void methodCalled( String methodSignature, long duration );
  +    void methodCalled( String methodSignature, long duration, String annotation );
   
       /**
        * Method methodLogging tests if the implementing class intends to do method 
logging.
  @@ -62,4 +63,10 @@
        *
        */
       void serviceAbend( int attempt, IOException cause );
  +
  +    void invocationFailure(String name, InvocationException ie);
  +
  +    void unexpectedClosedConnection(String name, ConnectionClosedException cce);
  +
  +    void unexpectedInterruption(String name, InterruptedException ie);
   }
  
  
  
  1.12      +8 -3      
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractClientInvocationHandler.java
  
  Index: AbstractClientInvocationHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractClientInvocationHandler.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- AbstractClientInvocationHandler.java      9 Jan 2003 22:55:09 -0000       1.11
  +++ AbstractClientInvocationHandler.java      19 Jan 2003 11:09:59 -0000      1.12
  @@ -32,7 +32,7 @@
   {
   
       protected ConnectionPinger m_connectionPinger;
  -    protected ConnectionListener m_altrmiConnectionListener =
  +    protected ConnectionListener m_connectionListener =
           new DefaultConnectionListener();
       protected boolean m_stopped = false;
   
  @@ -45,7 +45,12 @@
        */
       public void setConnectionListener( ConnectionListener altrmiConnectionListener )
       {
  -        m_altrmiConnectionListener = altrmiConnectionListener;
  +        m_connectionListener = altrmiConnectionListener;
  +    }
  +
  +    public ConnectionListener getConnectionListener()
  +    {
  +        return m_connectionListener;
       }
   
       /**
  
  
  
  1.13      +7 -12     
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractConnectionPinger.java
  
  Index: AbstractConnectionPinger.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractConnectionPinger.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- AbstractConnectionPinger.java     9 Jan 2003 22:55:09 -0000       1.12
  +++ AbstractConnectionPinger.java     19 Jan 2003 11:09:59 -0000      1.13
  @@ -22,7 +22,7 @@
   public abstract class AbstractConnectionPinger implements ConnectionPinger
   {
   
  -    private ClientInvocationHandler m_altrmiInvocationHandler;
  +    private ClientInvocationHandler m_clientInvocationHandler;
       private boolean m_continue = true;
       private Runnable m_runnable;
       private Thread m_thread;
  @@ -77,7 +77,7 @@
        */
       public void setInvocationHandler( ClientInvocationHandler 
altrmiInvocationHandler )
       {
  -        m_altrmiInvocationHandler = altrmiInvocationHandler;
  +        m_clientInvocationHandler = altrmiInvocationHandler;
       }
   
       /**
  @@ -86,7 +86,7 @@
        */
       protected ClientInvocationHandler getInvocationHandler()
       {
  -        return m_altrmiInvocationHandler;
  +        return m_clientInvocationHandler;
       }
   
       /**
  @@ -111,24 +111,19 @@
                   }
                   catch( InvocationException ie )
                   {
  -
  -                    // We really need a logger or something to be able to see this
  -                    //  for debugging.
  -
  +                    
m_clientInvocationHandler.getConnectionListener().invocationFailure(this.getClass().getName(),
 ie);
                       // no need to ping anymore.
                   }
                   catch( ConnectionClosedException cce )
                   {
  -                    // We really need a logger or something to be able to see this
  -                    //  for debugging.
  -
  +                    
m_clientInvocationHandler.getConnectionListener().unexpectedClosedConnection(this.getClass().getName(),
 cce);
                       // no need to ping anymore.
                   }
                   catch( InterruptedException e )
                   {
                       if (m_continue)
                       {
  -                        System.err.println("Unexpected interuption of pnger thread 
- " + e.getMessage());
  +                        
m_clientInvocationHandler.getConnectionListener().unexpectedInterruption(this.getClass().getName(),
 e);
                       }
                   }
               }
  
  
  
  1.9       +26 -11    
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DefaultConnectionListener.java
  
  Index: DefaultConnectionListener.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DefaultConnectionListener.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DefaultConnectionListener.java    5 Jan 2003 23:24:08 -0000       1.8
  +++ DefaultConnectionListener.java    19 Jan 2003 11:09:59 -0000      1.9
  @@ -8,6 +8,7 @@
   package org.apache.excalibur.altrmi.client.impl;
   
   import org.apache.excalibur.altrmi.client.ConnectionListener;
  +import org.apache.excalibur.altrmi.client.ConnectionClosedException;
   import org.apache.excalibur.altrmi.common.InvocationException;
   import org.apache.excalibur.altrmi.common.Request;
   
  @@ -22,6 +23,7 @@
    */
   public class DefaultConnectionListener implements ConnectionListener
   {
  +
       private int m_maxReconnectAttempts;
   
       /**
  @@ -55,7 +57,7 @@
        * @param duration
        *
        */
  -    public void methodCalled( final String methodSignature, final long duration )
  +    public void methodCalled( final String methodSignature, final long duration, 
String annotation )
       {
   
           // do mothing in default impl, could do logging.
  @@ -70,7 +72,7 @@
        */
       public boolean methodLogging()
       {
  -        return true;
  +        return false;
       }
   
       /**
  @@ -93,7 +95,7 @@
               throw new InvocationException( "Too many retries on suspended service" 
);
           }
   
  -        System.out.println( "AltRMI service suspended, Trying to reconnect (attempt 
" + attempt
  +        printMessage( "AltRMI service suspended, Trying to reconnect (attempt " + 
attempt
                               + ", waiting for " + suggestedWaitMillis / 1000 + " 
seconds)" );
   
           // We are quite happy with the recommended wait time.
  @@ -103,9 +105,7 @@
           }
           catch( InterruptedException ie )
           {
  -            System.out.println( "InterruptedException in Listener " + 
ie.getMessage() );
  -
  -            // TODO ?
  +            unexpectedInterruption(this.getClass().getName(), ie);
           }
       }
   
  @@ -151,7 +151,7 @@
               throw new InvocationException( msg );
           }
   
  -        System.out.println( "AltRMI service abnormally ended, Trying to reconnect 
(attempt "
  +        printMessage( "AltRMI service abnormally ended, Trying to reconnect 
(attempt "
                               + attempt + ")" );
   
           // Increasing wait time.
  @@ -161,9 +161,24 @@
           }
           catch( InterruptedException ie )
           {
  -            System.out.println( "InterruptedException in Listener " + 
ie.getMessage() );
  -
  -            // TODO ?
  +            unexpectedInterruption(this.getClass().getName(), ie);
           }
       }
  +
  +    public void invocationFailure(String name, InvocationException ie)
  +    {
  +    }
  +
  +    public void unexpectedClosedConnection(String name, ConnectionClosedException 
cce)
  +    {
  +    }
  +
  +    public void unexpectedInterruption(String name, InterruptedException ie)
  +    {
  +    }
  +
  +    void printMessage(String message) {
  +        System.out.println(message);
  +    }
  +
   }
  
  
  
  1.21      +73 -34    
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DefaultProxyHelper.java
  
  Index: DefaultProxyHelper.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DefaultProxyHelper.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- DefaultProxyHelper.java   9 Jan 2003 22:55:09 -0000       1.20
  +++ DefaultProxyHelper.java   19 Jan 2003 11:09:59 -0000      1.21
  @@ -24,7 +24,6 @@
   import org.apache.excalibur.altrmi.common.MethodRequest;
   import org.apache.excalibur.altrmi.common.RawRequest;
   
  -import javax.swing.*;
   import java.lang.reflect.Array;
   import java.util.Vector;
   
  @@ -100,10 +99,26 @@
        * @throws Throwable
        *
        */
  +
       public Object processObjectRequestGettingFacade(
           Class returnClassType, String methodSignature, Object[] args, String 
objectName )
           throws Throwable
       {
  +        try
  +        {
  +            return processObjectRequestGettingFacade2(returnClassType, 
methodSignature, args, objectName);
  +        }
  +        catch (InvocationException ie)
  +        {
  +            
m_clientInvocationHandler.getConnectionListener().invocationFailure(this.getClass().getName(),
 ie);
  +            throw ie;
  +        }
  +    }
  +
  +    private Object processObjectRequestGettingFacade2(
  +        Class returnClassType, String methodSignature, Object[] args, String 
objectName )
  +        throws Throwable
  +    {
   
           boolean arrayRetVal = objectName.endsWith( "[]" );
           String objNameWithoutArray = objectName.substring( 0, objectName.length() - 
2 );
  @@ -231,43 +246,59 @@
       public Object processObjectRequest( String methodSignature, Object[] args, 
Class[] argClasses ) throws Throwable
       {
   
  -        m_altrmiFactory.marshallCorrection( methodSignature, args, argClasses );
  +        try
  +        {
  +            m_altrmiFactory.marshallCorrection( methodSignature, args, argClasses );
   
  -        MethodRequest request = new MethodRequest( m_publishedServiceName, 
m_objectName,
  -                                                   methodSignature, args, 
m_referenceID, m_session );
  -        Reply reply = m_clientInvocationHandler.handleInvocation( request );
  +            MethodRequest request = new MethodRequest( m_publishedServiceName, 
m_objectName,
  +                                                       methodSignature, args, 
m_referenceID, m_session );
  +            Reply reply = m_clientInvocationHandler.handleInvocation( request );
   
  -        if( reply.getReplyCode() == ReplyConstants.METHODREPLY )
  -        {
  -            MethodReply or = (MethodReply)reply;
  +            if( reply.getReplyCode() == ReplyConstants.METHODREPLY )
  +            {
  +                MethodReply or = (MethodReply)reply;
   
  -            return or.getReplyObject();
  +                return or.getReplyObject();
  +            }
  +            else
  +            {
  +                throw makeUnexpectedReplyThrowable(reply);
  +            }
           }
  -        else
  +        catch (InvocationException ie)
           {
  -            throw makeUnexpectedReplyThrowable(reply);
  +            
m_clientInvocationHandler.getConnectionListener().invocationFailure(this.getClass().getName(),
 ie);
  +            throw ie;
           }
       }
   
       public void processVoidRequests(Vector requests) throws Throwable
       {
   
  -        RawRequest[] rawRequests = new RawRequest[requests.size()];
  -        requests.copyInto(rawRequests);
  -        MethodAsyncRequest request = new MethodAsyncRequest( 
m_publishedServiceName, m_objectName,
  -                                                   rawRequests, m_referenceID, 
m_session );
  +        try
  +        {
  +            RawRequest[] rawRequests = new RawRequest[requests.size()];
  +            requests.copyInto(rawRequests);
  +            MethodAsyncRequest request = new MethodAsyncRequest( 
m_publishedServiceName, m_objectName,
  +                                                       rawRequests, m_referenceID, 
m_session );
   
  -        //debug(args);
  -        Reply reply = m_clientInvocationHandler.handleInvocation( request );
  +            //debug(args);
  +            Reply reply = m_clientInvocationHandler.handleInvocation( request );
   
  -        if( reply.getReplyCode() == ReplyConstants.METHODREPLY )
  -        {
  -            MethodReply or = (MethodReply)reply;
  -            return;
  +            if( reply.getReplyCode() == ReplyConstants.METHODREPLY )
  +            {
  +                MethodReply or = (MethodReply)reply;
  +                return;
  +            }
  +            else
  +            {
  +                throw makeUnexpectedReplyThrowable(reply);
  +            }
           }
  -        else
  +        catch (InvocationException ie)
           {
  -            throw makeUnexpectedReplyThrowable(reply);
  +            
m_clientInvocationHandler.getConnectionListener().invocationFailure(this.getClass().getName(),
 ie);
  +            throw ie;
           }
       }
   
  @@ -284,21 +315,29 @@
       public void processVoidRequest( String methodSignature, Object[] args ) throws 
Throwable
       {
   
  -        MethodRequest request = new MethodRequest( m_publishedServiceName, 
m_objectName,
  -                                                   methodSignature, args, 
m_referenceID, m_session );
  +        try
  +        {
  +            MethodRequest request = new MethodRequest( m_publishedServiceName, 
m_objectName,
  +                                                       methodSignature, args, 
m_referenceID, m_session );
   
  -        //debug(args);
  -        Reply reply = m_clientInvocationHandler.handleInvocation( request );
  +            //debug(args);
  +            Reply reply = m_clientInvocationHandler.handleInvocation( request );
   
  -        if( reply.getReplyCode() == ReplyConstants.METHODREPLY )
  -        {
  -            MethodReply or = (MethodReply)reply;
  +            if( reply.getReplyCode() == ReplyConstants.METHODREPLY )
  +            {
  +                MethodReply or = (MethodReply)reply;
   
  -            return;
  +                return;
  +            }
  +            else
  +            {
  +                throw makeUnexpectedReplyThrowable(reply);
  +            }
           }
  -        else
  +        catch (InvocationException ie)
           {
  -            throw makeUnexpectedReplyThrowable(reply);
  +            
m_clientInvocationHandler.getConnectionListener().invocationFailure(this.getClass().getName(),
 ie);
  +            throw ie;
           }
       }
   
  
  
  
  1.5       +16 -2     
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DumbConnectionListener.java
  
  Index: DumbConnectionListener.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DumbConnectionListener.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DumbConnectionListener.java       9 Jan 2003 22:55:09 -0000       1.4
  +++ DumbConnectionListener.java       19 Jan 2003 11:09:59 -0000      1.5
  @@ -8,6 +8,7 @@
   package org.apache.excalibur.altrmi.client.impl;
   
   import org.apache.excalibur.altrmi.client.ConnectionListener;
  +import org.apache.excalibur.altrmi.client.ConnectionClosedException;
   import org.apache.excalibur.altrmi.common.InvocationException;
   import org.apache.excalibur.altrmi.common.Request;
   
  @@ -39,7 +40,7 @@
        * @param duration
        *
        */
  -    public void methodCalled( final String methodSignature, final long duration )
  +    public void methodCalled( final String methodSignature, final long duration, 
String annotation )
       {
           // do mothing in default impl, could do logging.
       }
  @@ -83,4 +84,17 @@
       {
           throw new InvocationException( "AltRMI Service has Abended." );
       }
  +
  +    public void invocationFailure(String name, InvocationException ie)
  +    {
  +    }
  +
  +    public void unexpectedClosedConnection(String name, ConnectionClosedException 
cce)
  +    {
  +    }
  +
  +    public void unexpectedInterruption(String name, InterruptedException ie)
  +    {
  +    }
  +
   }
  
  
  
  1.11      +3 -2      
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/callback/stream/CallbackEnabledClientCustomStreamReadWriter.java
  
  Index: CallbackEnabledClientCustomStreamReadWriter.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/callback/stream/CallbackEnabledClientCustomStreamReadWriter.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- CallbackEnabledClientCustomStreamReadWriter.java  6 Jan 2003 23:41:50 -0000      
 1.10
  +++ CallbackEnabledClientCustomStreamReadWriter.java  19 Jan 2003 11:10:00 -0000     
 1.11
  @@ -23,6 +23,7 @@
   import org.apache.excalibur.altrmi.common.ConnectionException;
   import org.apache.excalibur.altrmi.server.Server;
   import org.apache.excalibur.altrmi.server.PublicationException;
  +import org.apache.excalibur.altrmi.server.ServerException;
   import org.apache.excalibur.altrmi.server.impl.classretrievers.PlainClassRetriever;
   import org.apache.excalibur.altrmi.server.impl.direct.DirectServer;
   
  @@ -77,7 +78,7 @@
               m_clientServerHostingExposedObjects.start();
               m_clientServerHostingExposedObjects.setClassRetriever( new 
PlainClassRetriever() );
           }
  -        catch( Exception e )
  +        catch( ServerException e )
           {
               throw new ConnectionException( "Error Starting Internal Server" );
           }
  
  
  
  1.9       +4 -4      
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/direct/AbstractDirectInvocationHandler.java
  
  Index: AbstractDirectInvocationHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/direct/AbstractDirectInvocationHandler.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AbstractDirectInvocationHandler.java      9 Jan 2003 22:55:10 -0000       1.8
  +++ AbstractDirectInvocationHandler.java      19 Jan 2003 11:10:00 -0000      1.9
  @@ -99,7 +99,7 @@
                   {
                       int millis = ( (TryLaterReply)reply ).getSuggestedDelayMillis();
   
  -                    m_altrmiConnectionListener.serviceSuspended( request, tries, 
millis );
  +                    m_connectionListener.serviceSuspended( request, tries, millis );
   
                       again = true;
                   }
  @@ -122,9 +122,9 @@
           {
               if( request instanceof MethodRequest )
               {
  -                m_altrmiConnectionListener.methodCalled(
  +                m_connectionListener.methodCalled(
                       ( (MethodRequest)request ).getMethodSignature(),
  -                    System.currentTimeMillis() - start );
  +                    System.currentTimeMillis() - start, "" );
               }
           }
   
  
  
  
  1.9       +8 -3      
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/multiple/AbstractMultipleInvocationHandler.java
  
  Index: AbstractMultipleInvocationHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/multiple/AbstractMultipleInvocationHandler.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AbstractMultipleInvocationHandler.java    9 Jan 2003 22:55:10 -0000       1.8
  +++ AbstractMultipleInvocationHandler.java    19 Jan 2003 11:10:00 -0000      1.9
  @@ -23,7 +23,7 @@
   public abstract class AbstractMultipleInvocationHandler implements 
ClientInvocationHandler
   {
   
  -    private ConnectionListener m_altrmiConnectionListener;
  +    private ConnectionListener m_clientConnectionListener;
       protected AbstractMultipleHostContext m_multipleHostContext;
   
       /**
  @@ -35,7 +35,12 @@
        */
       public void setConnectionListener( ConnectionListener altrmiConnectionListener )
       {
  -        m_altrmiConnectionListener = altrmiConnectionListener;
  +        m_clientConnectionListener = altrmiConnectionListener;
  +    }
  +
  +    public ConnectionListener getConnectionListener()
  +    {
  +        return m_clientConnectionListener;
       }
   
       protected void setMultipleHostContext( AbstractMultipleHostContext 
multipleHostContext )
  
  
  
  1.2       +6 -6      
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/rmi/RmiClientInvocationHandler.java
  
  Index: RmiClientInvocationHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/rmi/RmiClientInvocationHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RmiClientInvocationHandler.java   9 Jan 2003 22:55:29 -0000       1.1
  +++ RmiClientInvocationHandler.java   19 Jan 2003 11:10:00 -0000      1.2
  @@ -34,7 +34,7 @@
    * Class RmiClientInvocationHandler
    *
    *
  - * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  + * @author Paul Hammant
    * @version $Revision$
    */
   public final class RmiClientInvocationHandler extends 
AbstractClientInvocationHandler
  @@ -164,7 +164,7 @@
                       {
                           int millis = ( (TryLaterReply)reply 
).getSuggestedDelayMillis();
   
  -                        m_altrmiConnectionListener.serviceSuspended( request, 
tries, millis );
  +                        m_connectionListener.serviceSuspended( request, tries, 
millis );
   
                           again = true;
                       }
  @@ -192,7 +192,7 @@
   
                       while( !tryReconnect() )
                       {
  -                        m_altrmiConnectionListener.serviceAbend( retryConnectTries, 
re );
  +                        m_connectionListener.serviceAbend( retryConnectTries, re );
   
                           retryConnectTries++;
                       }
  @@ -209,9 +209,9 @@
           {
               if( request instanceof MethodRequest )
               {
  -                m_altrmiConnectionListener.methodCalled(
  +                m_connectionListener.methodCalled(
                       ( (MethodRequest)request ).getMethodSignature(),
  -                    System.currentTimeMillis() - start );
  +                    System.currentTimeMillis() - start, "" );
               }
           }
   
  
  
  
  1.8       +3 -2      
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/socket/AbstractSocketStreamInvocationHandler.java
  
  Index: AbstractSocketStreamInvocationHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/socket/AbstractSocketStreamInvocationHandler.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AbstractSocketStreamInvocationHandler.java        5 Jan 2003 23:24:23 -0000      
 1.7
  +++ AbstractSocketStreamInvocationHandler.java        19 Jan 2003 11:10:00 -0000     
 1.8
  @@ -15,6 +15,7 @@
   import org.apache.excalibur.altrmi.client.impl.stream.StreamInvocationHandler;
   import org.apache.excalibur.altrmi.common.ConnectionException;
   import org.apache.excalibur.altrmi.common.ConnectionRefusedException;
  +import org.apache.excalibur.altrmi.common.BadConnectionException;
   
   /**
    * Class SocketCustomStreamInvocationHandler
  @@ -62,7 +63,7 @@
               {
                   throw new ConnectionRefusedException("Connection to port "+port+" 
on host "+host+" refused.");
               }
  -            throw new ConnectionException( "Cannot open Stream(s) for socket: "
  +            throw new BadConnectionException( "Cannot open Stream(s) for socket: "
                                                    + ioe.getMessage() );
           }
       }
  
  
  
  1.16      +5 -5      
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/stream/StreamInvocationHandler.java
  
  Index: StreamInvocationHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/stream/StreamInvocationHandler.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- StreamInvocationHandler.java      9 Jan 2003 22:55:10 -0000       1.15
  +++ StreamInvocationHandler.java      19 Jan 2003 11:10:00 -0000      1.16
  @@ -140,7 +140,7 @@
                               {
                                   int millis = ( (TryLaterReply)reply 
).getSuggestedDelayMillis();
   
  -                                m_altrmiConnectionListener.serviceSuspended( 
request, tries,
  +                                m_connectionListener.serviceSuspended( request, 
tries,
                                                                               millis 
);
   
                                   again = true;
  @@ -169,7 +169,7 @@
   
                               while( !tryReconnect() )
                               {
  -                                m_altrmiConnectionListener.serviceAbend( 
retryConnectTries, ioe );
  +                                m_connectionListener.serviceAbend( 
retryConnectTries, ioe );
   
                                   retryConnectTries++;
                               }
  @@ -188,9 +188,9 @@
                   {
                       if( request instanceof MethodRequest )
                       {
  -                        m_altrmiConnectionListener.methodCalled(
  +                        m_connectionListener.methodCalled(
                               ( (MethodRequest)request ).getMethodSignature(),
  -                            System.currentTimeMillis() - start );
  +                            System.currentTimeMillis() - start, "" );
                       }
                   }
   
  
  
  
  1.3       +5 -3      
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/common/ConnectionException.java
  
  Index: ConnectionException.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/common/ConnectionException.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ConnectionException.java  6 Jan 2003 23:41:51 -0000       1.2
  +++ ConnectionException.java  19 Jan 2003 11:10:00 -0000      1.3
  @@ -7,14 +7,16 @@
    */
   package org.apache.excalibur.altrmi.common;
   
  +import java.io.IOException;
  +
   /**
    * Class ConnectionException
    *
    *
  - * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  + * @author Paul Hammant
    * @version $Revision$
    */
  -public class ConnectionException extends Exception
  +public class ConnectionException extends IOException
   {
   
       static final long serialVersionUID = -2991328464962422036L;
  
  
  
  1.13      +13 -34    
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/AbstractServer.java
  
  Index: AbstractServer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/AbstractServer.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- AbstractServer.java       11 Jan 2003 16:10:08 -0000      1.12
  +++ AbstractServer.java       19 Jan 2003 11:10:00 -0000      1.13
  @@ -8,9 +8,6 @@
   package org.apache.excalibur.altrmi.server.impl;
   
   import java.util.Vector;
  -import org.apache.avalon.framework.logger.ConsoleLogger;
  -import org.apache.avalon.framework.logger.LogEnabled;
  -import org.apache.avalon.framework.logger.Logger;
   import org.apache.excalibur.altrmi.common.Reply;
   import org.apache.excalibur.altrmi.common.Request;
   import org.apache.excalibur.altrmi.common.MethodRequest;
  @@ -21,18 +18,19 @@
   import org.apache.excalibur.altrmi.server.MethodInvocationHandler;
   import org.apache.excalibur.altrmi.server.PublicationDescription;
   import org.apache.excalibur.altrmi.server.PublicationException;
  +import org.apache.excalibur.altrmi.server.ServerMonitor;
   import org.apache.excalibur.altrmi.server.impl.adapters.InvocationHandlerAdapter;
   
   /**
    * Class AbstractServer
    *
    *
  - * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  + * @author Paul Hammant
    * @author Vinay Chandrasekharan <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
    * @version $Revision$
    */
   public abstract class AbstractServer
  -    implements Server, LogEnabled
  +    implements Server
   {
   
       /**
  @@ -46,15 +44,12 @@
       private InvocationHandlerAdapter m_invocationHandlerAdapter;
   
       /**
  -     * The logger
  -     */
  -    private Logger m_logger;
  -
  -    /**
        * The state of the system.
        */
       private int m_state = UNSTARTED;
   
  +    private ServerMonitor m_serverMonitor;
  +
       /**
        * Construct a AbstractServer
        *
  @@ -67,35 +62,19 @@
           m_invocationHandlerAdapter = invocationHandlerAdapter;
       }
   
  -    /**
  -     * Enable Logging
  -     *
  -     *
  -     * @param logger The logger.
  -     *
  -     */
  -    public void enableLogging( Logger logger )
  -    {
  -        m_logger = logger;
  +
  +    public void setServerMonitor(ServerMonitor serverMonitor) {
  +        m_serverMonitor = serverMonitor;
       }
   
  -    /**
  -     * Method getLogger
  -     *
  -     *
  -     * @return The logger.
  -     *
  -     */
  -    public synchronized Logger getLogger()
  +    protected synchronized ServerMonitor getServerMonitor()
       {
  -
  -        // Default if not logger assigned.
  -        if( m_logger == null )
  +        if (m_serverMonitor == null)
           {
  -            m_logger = new ConsoleLogger();
  +            m_serverMonitor = new ConsoleServerMonitor();
           }
   
  -        return m_logger;
  +        return m_serverMonitor;
       }
   
       /**
  
  
  
  1.10      +13 -5     
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/ServerStreamReadWriter.java
  
  Index: ServerStreamReadWriter.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/ServerStreamReadWriter.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ServerStreamReadWriter.java       11 Jan 2003 16:10:08 -0000      1.9
  +++ ServerStreamReadWriter.java       19 Jan 2003 11:10:00 -0000      1.10
  @@ -13,7 +13,8 @@
   import org.apache.excalibur.altrmi.common.Reply;
   import org.apache.excalibur.altrmi.common.Request;
   import org.apache.excalibur.altrmi.common.ConnectionException;
  -import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.excalibur.altrmi.server.ServerMonitor;
  +
   
   /**
    * Class ServerStreamReadWriter
  @@ -22,7 +23,7 @@
    * @author Paul Hammant
    * @version $Revision$
    */
  -public abstract class ServerStreamReadWriter extends AbstractLogEnabled
  +public abstract class ServerStreamReadWriter
   {
   
       /**
  @@ -35,6 +36,13 @@
        */
       private OutputStream m_outputStream;
   
  +    private ServerMonitor m_serverMonitor;
  +
  +    private void setServerMonitor(ServerMonitor serverMonitor) {
  +        m_serverMonitor = serverMonitor;
  +    }
  +
  +
       /**
        * Method setStreams
        *
  @@ -77,7 +85,7 @@
           }
           catch ( IOException e )
           {
  -            getLogger().error( "ServerStreamReadWriter.close(): Failed closing an 
AltRMI connection input stream: ", e);
  +            m_serverMonitor.closeError( "ServerStreamReadWriter.close(): Failed 
closing an AltRMI connection input stream: ", e);
           }
           
           try
  @@ -86,7 +94,7 @@
           }
           catch ( IOException e )
           {
  -            getLogger().error( "ServerStreamReadWriter.close(): Failed closing an 
AltRMI connection output stream: ", e);
  +            m_serverMonitor.closeError( "ServerStreamReadWriter.close(): Failed 
closing an AltRMI connection output stream: ", e);
           }
       }
   
  
  
  
  1.13      +22 -9     
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/StreamServerConnection.java
  
  Index: StreamServerConnection.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/StreamServerConnection.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- StreamServerConnection.java       11 Jan 2003 16:10:08 -0000      1.12
  +++ StreamServerConnection.java       19 Jan 2003 11:10:00 -0000      1.13
  @@ -12,22 +12,22 @@
   import java.io.InterruptedIOException;
   import java.net.SocketException;
   
  -import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.excalibur.altrmi.common.Reply;
   import org.apache.excalibur.altrmi.common.Request;
   import org.apache.excalibur.altrmi.common.EndConnectionReply;
   import org.apache.excalibur.altrmi.common.ConnectionException;
   import org.apache.excalibur.altrmi.common.BadConnectionException;
   import org.apache.excalibur.altrmi.server.ServerConnection;
  +import org.apache.excalibur.altrmi.server.ServerMonitor;
   
   /**
    * Class StreamServerConnection
    *
    *
  - * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  + * @author Paul Hammant
    * @version $Revision$
    */
  -public abstract class StreamServerConnection  extends AbstractLogEnabled
  +public abstract class StreamServerConnection
           implements Runnable, ServerConnection
   {
   
  @@ -46,6 +46,8 @@
        */
       private ServerStreamReadWriter m_readWriter;
   
  +    private ServerMonitor m_serverMonitor;
  +
       /**
        * Construct a StreamServerConnection
        *
  @@ -61,6 +63,17 @@
           m_readWriter = readWriter;
       }
   
  +
  +    public void setServerMonitor(ServerMonitor serverMonitor)
  +    {
  +        this.m_serverMonitor = serverMonitor;
  +    }
  +
  +    public ServerMonitor getServerMonitor()
  +    {
  +        return m_serverMonitor;
  +    }
  +
       /**
        * Method run
        *
  @@ -102,13 +115,13 @@
                   catch (BadConnectionException bce)
                   {
                       more = false;
  -                    getLogger().error("StreamServerConnection.run(): Bad connection 
#0", bce);
  +                    m_serverMonitor.badConnection("StreamServerConnection.run(): 
Bad connection #0", bce);
                       m_readWriter.close();
                   }
                   catch (ConnectionException ace)
                   {
                       more = false;
  -                    getLogger().error("StreamServerConnection.run(): Unexpected 
ConnectionException #0", ace);
  +                    
m_serverMonitor.connectionProblem("StreamServerConnection.run(): Unexpected 
ConnectionException #0", ace);
                       m_readWriter.close();
                   }
                   catch (IOException ioe)
  @@ -127,7 +140,7 @@
                       }
                       else
                       {
  -                        getLogger().error("StreamServerConnection.run(): Unexpected 
IOE #1", ioe);
  +                        
m_serverMonitor.unexpectedIOException("StreamServerConnection.run(): Unexpected IOE 
#1", ioe);
                           m_readWriter.close();
                       }
                   }
  @@ -135,11 +148,11 @@
           }
           catch (IOException e)
           {
  -            getLogger().error("StreamServerConnection.run(): Unexpected IOE #2", e);
  +            m_serverMonitor.unexpectedIOException("StreamServerConnection.run(): 
Unexpected IOE #2", e);
           }
           catch (ClassNotFoundException e)
           {
  -            getLogger().error("StreamServerConnection.run(): Unexpected 
ClassNotFoundException", e);
  +            m_serverMonitor.classNotFound(e);
           }
   
           m_abstractServer.connectionCompleted(this);
  
  
  
  1.1                  
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/ConsoleServerMonitor.java
  
  Index: ConsoleServerMonitor.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  
  package org.apache.excalibur.altrmi.server.impl;
  
  import org.apache.excalibur.altrmi.server.ServerMonitor;
  import org.apache.excalibur.altrmi.common.BadConnectionException;
  
  import java.io.IOException;
  
  /**
   * Class ConsoleServerMonitor
   *
   *
   * @author Paul Hammant
   * @version $Revision: 1.1 $
   */
  public class ConsoleServerMonitor implements ServerMonitor
  {
  
      public void closeError(String s, IOException e)
      {
          System.out.println("[closeError] " + s + " : " + e.getMessage());
      }
  
      public void badConnection(String s, BadConnectionException bce)
      {
          System.out.println("[badConnection] " + s + " : " + bce.getMessage());
      }
  
      public void c(String s, IOException ioe)
      {
          System.out.println("[badConnection] " + s + " : " + ioe.getMessage());
      }
  
      public void classNotFound(ClassNotFoundException e)
      {
          System.out.println("[classNotFound] " + e.getMessage());
      }
  
      public void unexpectedIOException(String s, IOException e)
      {
          System.out.println("[unexpectedIOException] " + s + " : " + e.getMessage());
      }
  
      public void stopServerError(String s, Exception e)
      {
          System.out.println("[stopServerError] " + s + " : " + e.getMessage());
      }
  
      public void connectionProblem(String s, IOException ioe)
      {
          System.out.println("[connectionProblem] " + s + " : " + ioe.getMessage());
      }
  }
  
  
  
  1.1                  
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/LogEnabledServerMonitor.java
  
  Index: LogEnabledServerMonitor.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  
  package org.apache.excalibur.altrmi.server.impl;
  
  import org.apache.excalibur.altrmi.server.ServerMonitor;
  import org.apache.excalibur.altrmi.common.BadConnectionException;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  
  import java.io.IOException;
  
  /**
   * Class LogEnabledServerMonitor
   *
   *
   * @author Paul Hammant
   * @version $Revision: 1.1 $
   */
  public class LogEnabledServerMonitor extends AbstractLogEnabled implements 
ServerMonitor
  {
  
      public void closeError(String s, IOException e)
      {
          getLogger().error("[closeError] " + s + " : " + e.getMessage());
      }
  
      public void badConnection(String s, BadConnectionException bce)
      {
          getLogger().error("[badConnection] " + s + " : " + bce.getMessage());
      }
  
      public void classNotFound(ClassNotFoundException e)
      {
          getLogger().fatalError("[classNotFound] " + e.getMessage());
      }
  
      public void unexpectedIOException(String s, IOException e)
      {
          getLogger().error("[unexpectedIOException] " + s + " : " + e.getMessage());
      }
  
      public void stopServerError(String s, Exception e)
      {
          getLogger().error("[stopServerError] " + s + " : " + e.getMessage());
      }
  
      public void connectionProblem(String s, IOException ioe)
      {
          getLogger().error("[connectionProblem] " + s + " : " + ioe.getMessage());
      }
  }
  
  
  
  1.1                  
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/NullServerMonitor.java
  
  Index: NullServerMonitor.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  
  package org.apache.excalibur.altrmi.server.impl;
  
  import org.apache.excalibur.altrmi.server.ServerMonitor;
  import org.apache.excalibur.altrmi.common.BadConnectionException;
  
  import java.io.IOException;
  
  /**
   * Class NullServerMonitor
   *
   *
   * @author Paul Hammant
   * @version $Revision: 1.1 $
   */
  public class NullServerMonitor implements ServerMonitor
  {
  
      public void closeError(String s, IOException e)
      {
      }
  
      public void badConnection(String s, BadConnectionException bce)
      {
      }
  
      public void c(String s, IOException ioe)
      {
      }
  
      public void classNotFound(ClassNotFoundException e)
      {
      }
  
      public void unexpectedIOException(String s, IOException e)
      {
      }
  
      public void stopServerError(String s, Exception e)
      {
      }
  
      public void connectionProblem(String s, IOException ioe)
      {
      }
  }
  
  
  
  1.4       +2 -2      
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/http/CustomHttpServer.java
  
  Index: CustomHttpServer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/http/CustomHttpServer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CustomHttpServer.java     11 Jan 2003 16:10:09 -0000      1.3
  +++ CustomHttpServer.java     19 Jan 2003 11:10:01 -0000      1.4
  @@ -98,7 +98,7 @@
           HttpCustomServerConnection hcsc =
                   new HttpCustomServerConnection(this, ssrw);
   
  -        hcsc.enableLogging(new ConsoleLogger());
  +        hcsc.setServerMonitor(getServerMonitor());
   
           Thread thread = new Thread(hcsc, "SocketStreamServerConnection Thread");
   
  
  
  
  1.8       +3 -5      
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/piped/AbstractPipedServer.java
  
  Index: AbstractPipedServer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/piped/AbstractPipedServer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AbstractPipedServer.java  11 Jan 2003 16:10:09 -0000      1.7
  +++ AbstractPipedServer.java  19 Jan 2003 11:10:01 -0000      1.8
  @@ -19,7 +19,7 @@
    * Class AbstractPipedServer
    *
    *
  - * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  + * @author Paul Hammant
    * @version $Revision$
    */
   public abstract class AbstractPipedServer extends AbstractServer
  @@ -80,9 +80,7 @@
   
               PipedStreamServerConnection pssc = new PipedStreamServerConnection( 
this, pIS, pOS,
                                                                                   
ssrw );
  -            pssc.enableLogging(getLogger());
  -
  -            pssc.enableLogging( getLogger() );
  +            pssc.setServerMonitor(getServerMonitor());
   
               Thread thread = new Thread( pssc ,"PipedStreamServerConnection Thread");
   
  
  
  
  1.6       +5 -4      
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/piped/PipedStreamServerConnection.java
  
  Index: PipedStreamServerConnection.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/piped/PipedStreamServerConnection.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PipedStreamServerConnection.java  11 Jan 2003 16:10:09 -0000      1.5
  +++ PipedStreamServerConnection.java  19 Jan 2003 11:10:01 -0000      1.6
  @@ -18,7 +18,7 @@
    * Class PipedStreamServerConnection
    *
    *
  - * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  + * @author Paul Hammant
    * @version $Revision$
    */
   public class PipedStreamServerConnection extends StreamServerConnection
  @@ -67,7 +67,8 @@
           }
           catch( IOException e )
           {
  -            getLogger().error("PipedStreamServerConnection.killConnection(): Some 
problem during closing of Input Stream", e);
  +
  +            
getServerMonitor().closeError("PipedStreamServerConnection.killConnection(): Some 
problem during closing of Input Stream", e);
           }
   
           try
  @@ -76,7 +77,7 @@
           }
           catch( IOException e )
           {
  -            getLogger().error("PipedStreamServerConnection.killConnection(): Some 
problem during closing of Output Stream", e);
  +            
getServerMonitor().closeError("PipedStreamServerConnection.killConnection(): Some 
problem during closing of Output Stream", e);
           }
       }
   }
  
  
  
  1.8       +3 -3      
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/rmi/RmiServer.java
  
  Index: RmiServer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/rmi/RmiServer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- RmiServer.java    11 Jan 2003 16:10:09 -0000      1.7
  +++ RmiServer.java    19 Jan 2003 11:10:01 -0000      1.8
  @@ -116,11 +116,11 @@
           }
           catch( RemoteException re )
           {
  -            getLogger().error("RmiServer.stop(): Error stopping RMI server",re);
  +            getServerMonitor().stopServerError("RmiServer.stop(): Error stopping 
RMI server - RemoteException",re);
           }
           catch( NotBoundException nbe )
           {
  -            getLogger().error("RmiServer.stop(): Error stopping RMI server",nbe);
  +            getServerMonitor().stopServerError("RmiServer.stop(): Error stopping 
RMI server - NotBoundException",nbe);
           }
   
           setState(STOPPED);
  
  
  
  1.11      +4 -3      
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/socket/AbstractCompleteSocketStreamServer.java
  
  Index: AbstractCompleteSocketStreamServer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/socket/AbstractCompleteSocketStreamServer.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- AbstractCompleteSocketStreamServer.java   11 Jan 2003 16:10:09 -0000      1.10
  +++ AbstractCompleteSocketStreamServer.java   19 Jan 2003 11:10:01 -0000      1.11
  @@ -107,7 +107,7 @@
                   SocketStreamServerConnection sssc =
                           new SocketStreamServerConnection( this, sock, ssrw );
   
  -                sssc.enableLogging( getLogger() );
  +                sssc.setServerMonitor(getServerMonitor());
   
                   Thread thread = new Thread( sssc, "SocketStreamServerConnection 
Thread" );
   
  @@ -122,7 +122,8 @@
               }
               else
               {
  -                getLogger().error("AbstractCompleteSocketStreamServer.run(): Some 
problem connecting client " +
  +
  +                
getServerMonitor().connectionProblem("AbstractCompleteSocketStreamServer.run(): Some 
problem connecting client " +
                           "via sockets: ", ioe);
               }
           }
  
  
  
  1.7       +6 -4      
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/socket/AbstractPartialSocketStreamServer.java
  
  Index: AbstractPartialSocketStreamServer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/socket/AbstractPartialSocketStreamServer.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AbstractPartialSocketStreamServer.java    11 Jan 2003 16:10:09 -0000      1.6
  +++ AbstractPartialSocketStreamServer.java    19 Jan 2003 11:10:01 -0000      1.7
  @@ -47,7 +47,7 @@
           }
           catch( SocketException se )
           {
  -            getLogger().info("AbstractPartialSocketStreamServer.handleConnection(): 
Some error during " +
  +            
getServerMonitor().connectionProblem("AbstractPartialSocketStreamServer.handleConnection():
 Some error during " +
                       "socket handling", se);
           }
   
  @@ -61,13 +61,15 @@
   
                   SocketStreamServerConnection sssc =
                           new SocketStreamServerConnection( this, socket, ssrw );
  -                sssc.enableLogging( getLogger() );
  +                sssc.setServerMonitor(getServerMonitor());
  +
                   sssc.run();
               }
           }
           catch( IOException ioe )
           {
  -            getLogger().info("AbstractPartialSocketStreamServer.handleConnection(): 
Some problem connecting " +
  +
  +            
getServerMonitor().connectionProblem("AbstractPartialSocketStreamServer.handleConnection():
 Some problem connecting " +
                       "client via sockets: ", ioe);
           }
       }
  
  
  
  1.5       +3 -3      
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/socket/SocketStreamServerConnection.java
  
  Index: SocketStreamServerConnection.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/socket/SocketStreamServerConnection.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SocketStreamServerConnection.java 11 Jan 2003 16:10:09 -0000      1.4
  +++ SocketStreamServerConnection.java 19 Jan 2003 11:10:01 -0000      1.5
  @@ -17,7 +17,7 @@
    * Class SocketStreamServerConnection
    *
    *
  - * @author Paul Hammant <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
  + * @author Paul Hammant
    * @version $Revision$
    */
   public class SocketStreamServerConnection extends StreamServerConnection
  @@ -54,7 +54,7 @@
           }
           catch( IOException e )
           {
  -            getLogger().info("SocketStreamServerConnection.killConnection(): Error 
closing Connection",e);
  +            
getServerMonitor().closeError("SocketStreamServerConnection.killConnection(): Error 
closing Connection",e);
           }
       }
   }
  
  
  
  1.3       +1 -0      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/client/impl/DefaultConnectionPingerTestCase.java
  
  Index: DefaultConnectionPingerTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/client/impl/DefaultConnectionPingerTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultConnectionPingerTestCase.java      9 Jan 2003 22:55:12 -0000       1.2
  +++ DefaultConnectionPingerTestCase.java      19 Jan 2003 11:10:01 -0000      1.3
  @@ -8,6 +8,7 @@
   package org.apache.excalibur.altrmi.client.impl;
   
   import junit.framework.TestCase;
  +import org.apache.excalibur.altrmi.test.DummyInvocationHandler;
   
   public class DefaultConnectionPingerTestCase extends TestCase
   {
  
  
  
  1.4       +4 -1      
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/BasicClientServerTestCase.java
  
  Index: BasicClientServerTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/BasicClientServerTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BasicClientServerTestCase.java    9 Jan 2003 22:55:27 -0000       1.3
  +++ BasicClientServerTestCase.java    19 Jan 2003 11:10:01 -0000      1.4
  @@ -15,6 +15,7 @@
   import org.apache.excalibur.altrmi.common.BadConnectionException;
   import 
org.apache.excalibur.altrmi.server.impl.socket.CompleteSocketCustomStreamServer;
   import 
org.apache.excalibur.altrmi.server.impl.socket.CompleteSocketObjectStreamServer;
  +import org.apache.excalibur.altrmi.server.impl.NullServerMonitor;
   import org.apache.excalibur.altrmi.server.PublicationDescription;
   import org.apache.avalon.framework.logger.NullLogger;
   import junit.framework.TestCase;
  @@ -51,7 +52,9 @@
   
           // server side setup.
           CompleteSocketCustomStreamServer server = new 
CompleteSocketCustomStreamServer(12346);
  -        server.enableLogging(new NullLogger());
  +
  +        server.setServerMonitor(new NullServerMonitor());
  +
           TestInterfaceImpl testServer = new TestInterfaceImpl();
           PublicationDescription pd = new PublicationDescription(TestInterface.class,
                   new Class[] { TestInterface3.class, TestInterface2.class });
  
  
  
  1.1                  
jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/DummyInvocationHandler.java
  
  Index: DummyInvocationHandler.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.excalibur.altrmi.test;
  
  import org.apache.excalibur.altrmi.common.Reply;
  import org.apache.excalibur.altrmi.common.Request;
  import org.apache.excalibur.altrmi.common.ConnectionException;
  import org.apache.excalibur.altrmi.client.ClientInvocationHandler;
  import org.apache.excalibur.altrmi.client.ConnectionListener;
  import org.apache.excalibur.altrmi.client.ConnectionPinger;
  
  
  public class DummyInvocationHandler implements ClientInvocationHandler
  {
  
      boolean pinged = false;
      long lastReq = System.currentTimeMillis();
      private ConnectionListener m_connectionListener;
  
      public boolean isPinged()
      {
          return pinged;
      }
  
      public void reset()
      {
          pinged = false;
      }
  
      public Reply handleInvocation(Request request)
      {
          throw new java.lang.UnsupportedOperationException();
      }
  
      public void ping()
      {
          System.out.println("pinged!");
          pinged = true;
      }
  
      public long getLastRealRequest()
      {
          return lastReq;
      }
  
      public ClassLoader getInterfacesClassLoader()
      {
          throw new java.lang.UnsupportedOperationException();
      }
  
      public void setConnectionListener(ConnectionListener connectionListener)
      {
          m_connectionListener = connectionListener;
      }
  
      public void setConnectionPinger(ConnectionPinger connectionPinger)
      {
          throw new java.lang.UnsupportedOperationException();
      }
  
      public void initialize() throws ConnectionException
      {
          throw new java.lang.UnsupportedOperationException();
      }
  
      public void close()
      {
          throw new java.lang.UnsupportedOperationException();
      }
  
      public Object resolveArgument(String methodSignature, Class inputArgumentClass, 
Object inputArgumentInstance)
      {
          throw new java.lang.UnsupportedOperationException();
      }
  
      public ConnectionListener getConnectionListener()
      {
          return m_connectionListener;
      }
  
  }
  
  
  
  1.1                  
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/ServerMonitor.java
  
  Index: ServerMonitor.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.excalibur.altrmi.server;
  
  import org.apache.excalibur.altrmi.common.BadConnectionException;
  
  import java.io.IOException;
  
  /**
   * Class ServerMonitor
   *
   *
   * @author Paul Hammant
   * @version $Revision: 1.1 $
   */
  public interface ServerMonitor {
  
      void closeError(String s, IOException e);
  
      void badConnection(String s, BadConnectionException bce);
  
      void connectionProblem(String s, IOException ioe);
  
      void classNotFound(ClassNotFoundException e);
  
      void unexpectedIOException(String s, IOException e);
  
      void stopServerError(String s, Exception e);
  }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to