hammant 2003/02/08 07:15:46
Modified: altrmi/src/java/org/apache/excalibur/altrmi/client
ClientInvocationHandler.java
altrmi/src/java/org/apache/excalibur/altrmi/client/impl
AbstractClientInvocationHandler.java
AbstractConnectionPinger.java
AbstractHostContext.java DefaultProxyHelper.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/stream
StreamInvocationHandler.java
altrmi/src/java/org/apache/excalibur/altrmi/server
ServerMonitor.java
altrmi/src/java/org/apache/excalibur/altrmi/server/impl
AbstractServerStreamReadWriter.java
ConsoleServerMonitor.java
LogEnabledServerMonitor.java NullServerMonitor.java
StreamServerConnection.java
altrmi/src/java/org/apache/excalibur/altrmi/server/impl/callback/stream
CallbackEnabledCustomStreamReadWriter.java
altrmi/src/java/org/apache/excalibur/altrmi/server/impl/piped
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/multiprocess
AbstractDyingServerTestCase.java
altrmi/src/test/org/apache/excalibur/altrmi/test
DummyInvocationHandler.java
altrmi/src/test/org/apache/excalibur/altrmi/test/invalidstate
BouncingServerTestCase.java
altrmi/src/test/org/apache/excalibur/altrmi/test/socket
CallbackEnabledCustomStreamTestCase.java
Added: altrmi/src/java/org/apache/excalibur/altrmi/client
ClientMonitor.java
altrmi/src/java/org/apache/excalibur/altrmi/client/impl
DefaultClientMonitor.java DumbClientMonitor.java
Removed: altrmi/src/java/org/apache/excalibur/altrmi/client
ConnectionListener.java
altrmi/src/java/org/apache/excalibur/altrmi/client/impl
DefaultConnectionListener.java
DumbConnectionListener.java
Log:
ConnectionListener changed to ClientMonitor. Class percolated thru monitor method
calls.
Revision Changes Path
1.9 +5 -5
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/ClientInvocationHandler.java
Index: ClientInvocationHandler.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/ClientInvocationHandler.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ClientInvocationHandler.java 5 Feb 2003 01:02:53 -0000 1.8
+++ ClientInvocationHandler.java 8 Feb 2003 15:15:44 -0000 1.9
@@ -35,19 +35,19 @@
Reply handleInvocation( Request request );
/**
- * Method setConnectionListener
+ * Method setClientMonitor
*
*
- * @param altrmiConnectionListener
+ * @param connectionMonitor
*
*/
- void setConnectionListener( ConnectionListener altrmiConnectionListener );
+ void setClientMonitor( ClientMonitor connectionMonitor );
/**
* Get the connection Listener.
* @return the connection listener.
*/
- ConnectionListener getConnectionListener();
+ ClientMonitor getClientMonitor();
/**
* Method setConnectionPinger
1.1
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/ClientMonitor.java
Index: ClientMonitor.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.client;
import org.apache.excalibur.altrmi.common.Request;
import org.apache.excalibur.altrmi.common.InvocationException;
import java.io.IOException;
/**
* Interface ClientMonitor
*
*
* @author Paul Hammant
* @version * $Revision: 1.1 $
*/
public interface ClientMonitor
{
/**
* Method methodCalled
*
*
*
* @param methodSignature
* @param duration
*
*/
void methodCalled(Class clazz, String methodSignature, long duration, String
annotation );
/**
* Method methodLogging tests if the implementing class intends to do method
logging.
*
*
* @return
*
*/
boolean methodLogging();
/**
* Method serviceSuspended
*
*
*
* @param altrmiRequest
* @param attempt
* @param suggestedWaitMillis
*
*/
void serviceSuspended(Class clazz, Request altrmiRequest, int attempt, int
suggestedWaitMillis );
/**
* Method serviceAbend
*
*
*
* @param attempt
*
*/
void serviceAbend(Class clazz, int attempt, IOException cause);
void invocationFailure(Class clazz, String name, InvocationException ie);
void unexpectedClosedConnection(Class clazz, String name,
ConnectionClosedException cce);
void unexpectedInterruption(Class clazz, String name, InterruptedException ie);
}
1.17 +10 -10
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractClientInvocationHandler.java
Index: AbstractClientInvocationHandler.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractClientInvocationHandler.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- AbstractClientInvocationHandler.java 5 Feb 2003 07:32:07 -0000 1.16
+++ AbstractClientInvocationHandler.java 8 Feb 2003 15:15:44 -0000 1.17
@@ -9,7 +9,7 @@
import org.apache.excalibur.altrmi.client.ClientInvocationHandler;
import org.apache.excalibur.altrmi.client.ConnectionClosedException;
-import org.apache.excalibur.altrmi.client.ConnectionListener;
+import org.apache.excalibur.altrmi.client.ClientMonitor;
import org.apache.excalibur.altrmi.client.ConnectionPinger;
import org.apache.excalibur.altrmi.common.CallbackException;
import org.apache.excalibur.altrmi.common.ConnectionException;
@@ -30,26 +30,26 @@
{
protected ConnectionPinger m_connectionPinger;
- protected ConnectionListener m_connectionListener =
- new DefaultConnectionListener();
+ protected ClientMonitor m_clientMonitor =
+ new DefaultClientMonitor();
protected boolean m_stopped = false;
private ThreadPool m_threadPool;
/**
- * Method setConnectionListener
+ * Method setClientMonitor
*
*
- * @param altrmiConnectionListener
+ * @param connectionMonitor
*
*/
- public void setConnectionListener( ConnectionListener altrmiConnectionListener )
+ public void setClientMonitor( ClientMonitor connectionMonitor )
{
- m_connectionListener = altrmiConnectionListener;
+ m_clientMonitor = connectionMonitor;
}
- public ConnectionListener getConnectionListener()
+ public ClientMonitor getClientMonitor()
{
- return m_connectionListener;
+ return m_clientMonitor;
}
public void setThreadPool(ThreadPool threadPool)
1.16 +4 -4
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractConnectionPinger.java
Index: AbstractConnectionPinger.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractConnectionPinger.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- AbstractConnectionPinger.java 5 Feb 2003 07:32:07 -0000 1.15
+++ AbstractConnectionPinger.java 8 Feb 2003 15:15:44 -0000 1.16
@@ -112,19 +112,19 @@
}
catch( InvocationException ie )
{
-
m_clientInvocationHandler.getConnectionListener().invocationFailure(this.getClass().getName(),
ie);
+
m_clientInvocationHandler.getClientMonitor().invocationFailure(this.getClass(),
this.getClass().getName(), ie);
// no need to ping anymore.
}
catch( ConnectionClosedException cce )
{
-
m_clientInvocationHandler.getConnectionListener().unexpectedClosedConnection(this.getClass().getName(),
cce);
+
m_clientInvocationHandler.getClientMonitor().unexpectedClosedConnection(this.getClass(),
this.getClass().getName(), cce);
// no need to ping anymore.
}
catch( InterruptedException e )
{
if (m_continue)
{
-
m_clientInvocationHandler.getConnectionListener().unexpectedInterruption(this.getClass().getName(),
e);
+
m_clientInvocationHandler.getClientMonitor().unexpectedInterruption(this.getClass(),
this.getClass().getName(), e);
}
}
}
1.9 +6 -6
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractHostContext.java
Index: AbstractHostContext.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractHostContext.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- AbstractHostContext.java 9 Jan 2003 22:55:09 -0000 1.8
+++ AbstractHostContext.java 8 Feb 2003 15:15:44 -0000 1.9
@@ -8,7 +8,7 @@
package org.apache.excalibur.altrmi.client.impl;
import org.apache.excalibur.altrmi.client.ClientInvocationHandler;
-import org.apache.excalibur.altrmi.client.ConnectionListener;
+import org.apache.excalibur.altrmi.client.ClientMonitor;
import org.apache.excalibur.altrmi.client.HostContext;
/**
@@ -49,16 +49,16 @@
}
/**
- * Method setConnectionListener
+ * Method setClientMonitor
*
*
*
- * @param altrmiConnectionListener
+ * @param connectionMonitor
*
*/
- public void setConnectionListener( ConnectionListener altrmiConnectionListener )
+ public void setClientMonitor( ClientMonitor connectionMonitor )
{
- m_altrmiClientInvocationHandler.setConnectionListener(
altrmiConnectionListener );
+ m_altrmiClientInvocationHandler.setClientMonitor( connectionMonitor );
}
public HostContext makeSameVmHostContext(String key) {
1.24 +5 -5
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DefaultProxyHelper.java
Index: DefaultProxyHelper.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DefaultProxyHelper.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- DefaultProxyHelper.java 1 Feb 2003 15:29:56 -0000 1.23
+++ DefaultProxyHelper.java 8 Feb 2003 15:15:44 -0000 1.24
@@ -110,7 +110,7 @@
}
catch (InvocationException ie)
{
-
m_clientInvocationHandler.getConnectionListener().invocationFailure(this.getClass().getName(),
ie);
+
m_clientInvocationHandler.getClientMonitor().invocationFailure(this.getClass(),
this.getClass().getName(), ie);
throw ie;
}
}
@@ -265,7 +265,7 @@
}
catch (InvocationException ie)
{
-
m_clientInvocationHandler.getConnectionListener().invocationFailure(this.getClass().getName(),
ie);
+
m_clientInvocationHandler.getClientMonitor().invocationFailure(this.getClass(),
this.getClass().getName(), ie);
throw ie;
}
}
@@ -295,7 +295,7 @@
}
catch (InvocationException ie)
{
-
m_clientInvocationHandler.getConnectionListener().invocationFailure(this.getClass().getName(),
ie);
+
m_clientInvocationHandler.getClientMonitor().invocationFailure(this.getClass(),
this.getClass().getName(), ie);
throw ie;
}
}
@@ -334,7 +334,7 @@
}
catch (InvocationException ie)
{
-
m_clientInvocationHandler.getConnectionListener().invocationFailure(this.getClass().getName(),
ie);
+
m_clientInvocationHandler.getClientMonitor().invocationFailure(this.getClass(),
this.getClass().getName(), ie);
throw ie;
}
}
1.1
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DefaultClientMonitor.java
Index: DefaultClientMonitor.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.client.impl;
import org.apache.excalibur.altrmi.client.ClientMonitor;
import org.apache.excalibur.altrmi.client.ConnectionClosedException;
import org.apache.excalibur.altrmi.common.InvocationException;
import org.apache.excalibur.altrmi.common.Request;
import java.io.IOException;
/**
* Interface DefaultClientMonitor
*
*
* @author Paul Hammant
* @version * $Revision: 1.1 $
*/
public class DefaultClientMonitor implements ClientMonitor
{
private int m_maxReconnectAttempts;
/**
* Creates a new DefaultClientMonitor.
*/
public DefaultClientMonitor()
{
this( 3 ); // Default to 3 reconnect attempts.
}
/**
* Creates a new DefaultClientMonitor.
*
* @param maxReconnectAttempts Specifies the maximum number of times that
* the client will attempt to reconnect to
* the server if the connection is lost. A
* value of 0 implies that no reconnect
* attempts should be made.
*/
public DefaultClientMonitor( int maxReconnectAttempts )
{
m_maxReconnectAttempts = maxReconnectAttempts;
}
/**
* Method methodCalled
*
*
*
* @param methodSignature
* @param duration
*
*/
public void methodCalled(Class clazz, final String methodSignature, final long
duration, String annotation )
{
// do mothing in default impl, could do logging.
}
/**
* Method methodLogging tests if the implementing class intends to do method
logging.
*
*
* @return
*
*/
public boolean methodLogging()
{
return false;
}
/**
* Method serviceSuspended
*
*
*
* @param altrmiRequest
* @param attempt
* @param suggestedWaitMillis
*
*/
public void serviceSuspended(Class clazz, final Request altrmiRequest, final int
attempt,
final int suggestedWaitMillis )
{
// Lets say that ten retries is too many.
if( attempt == 10 )
{
throw new InvocationException( "Too many retries on suspended service" );
}
printMessage( "AltRMI service suspended, Trying to reconnect (attempt " +
attempt
+ ", waiting for " + suggestedWaitMillis / 1000 + "
seconds)" );
// We are quite happy with the recommended wait time.
try
{
Thread.sleep( suggestedWaitMillis );
}
catch( InterruptedException ie )
{
unexpectedInterruption(this.getClass(), this.getClass().getName(), ie);
}
}
/**
* Method serviceAbend
*
*
*
* @param attempt
*
*/
public void serviceAbend(Class clazz, int attempt, IOException cause)
{
// Lets say that ten retries is too many.
if( attempt >= m_maxReconnectAttempts )
{
String msg;
if ( m_maxReconnectAttempts <= 0 )
{
msg = "Reconnect to abended service disabled.";
}
else
{
msg = "Too many retries on abended service. ";
if (cause != null)
{
msg = msg + "Possible cause of abend (exception=" +
cause.getClass().getName() + "). ";
if (cause.getMessage() != null)
{
msg = msg + "Message= '" + cause.getMessage() + "'";
}
else
{
msg = msg + "No Message in exception.";
}
}
else
{
msg = msg + "Unknown cause of abend.";
}
}
throw new InvocationException( msg );
}
printMessage( "AltRMI service abnormally ended, Trying to reconnect (attempt
"
+ attempt + ")" );
// Increasing wait time.
try
{
Thread.sleep( ( 2 ^ attempt ) * 500 );
}
catch( InterruptedException ie )
{
unexpectedInterruption(this.getClass(), this.getClass().getName(), ie);
}
}
public void invocationFailure(Class clazz, String name, InvocationException ie)
{
}
public void unexpectedClosedConnection(Class clazz, String name,
ConnectionClosedException cce)
{
}
public void unexpectedInterruption(Class clazz, String name,
InterruptedException ie)
{
}
void printMessage(String message) {
System.out.println(message);
}
}
1.1
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DumbClientMonitor.java
Index: DumbClientMonitor.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.client.impl;
import org.apache.excalibur.altrmi.client.ClientMonitor;
import org.apache.excalibur.altrmi.client.ConnectionClosedException;
import org.apache.excalibur.altrmi.common.InvocationException;
import org.apache.excalibur.altrmi.common.Request;
import java.io.IOException;
/**
* Class DumbClientMonitor
*
*
* @author Paul Hammant
* @version * $Revision: 1.1 $
*/
public class DumbClientMonitor implements ClientMonitor
{
/**
* Creates a new DumbClientMonitor.
*/
public DumbClientMonitor()
{
}
/**
* Method methodCalled
*
*
*
* @param methodSignature
* @param duration
*
*/
public void methodCalled(Class clazz, final String methodSignature, final long
duration, String annotation )
{
// do mothing in default impl, could do logging.
}
/**
* Method methodLogging tests if the implementing class intends to do method
logging.
*
*
* @return
*
*/
public boolean methodLogging()
{
return false;
}
/**
* Method serviceSuspended
*
*
*
* @param altrmiRequest
* @param attempt
* @param suggestedWaitMillis
*
*/
public void serviceSuspended(Class clazz, final Request altrmiRequest, final int
attempt,
final int suggestedWaitMillis )
{
throw new InvocationException( "Service suspended" );
}
/**
* Method serviceAbend
*
*
*
* @param attempt
*
*/
public void serviceAbend(Class clazz, int attempt, IOException cause)
{
throw new InvocationException( "AltRMI Service has Abended." );
}
public void invocationFailure(Class clazz, String name, InvocationException ie)
{
}
public void unexpectedClosedConnection(Class clazz, String name,
ConnectionClosedException cce)
{
}
public void unexpectedInterruption(Class clazz, String name,
InterruptedException ie)
{
}
}
1.10 +10 -10
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/direct/AbstractDirectInvocationHandler.java
Index: AbstractDirectInvocationHandler.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/direct/AbstractDirectInvocationHandler.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- AbstractDirectInvocationHandler.java 19 Jan 2003 11:10:00 -0000 1.9
+++ AbstractDirectInvocationHandler.java 8 Feb 2003 15:15:45 -0000 1.10
@@ -8,7 +8,7 @@
package org.apache.excalibur.altrmi.client.impl.direct;
import java.io.IOException;
-import org.apache.excalibur.altrmi.client.ConnectionListener;
+import org.apache.excalibur.altrmi.client.ClientMonitor;
import org.apache.excalibur.altrmi.client.impl.AbstractClientInvocationHandler;
import org.apache.excalibur.altrmi.common.InvocationException;
import org.apache.excalibur.altrmi.common.Reply;
@@ -36,18 +36,18 @@
protected long m_lastRealRequest = System.currentTimeMillis();
/**
- * Method setConnectionListener
+ * Method setClientMonitor
*
*
- * @param altrmiConnectionListener
+ * @param connectionMonitor
*
*/
- public void setConnectionListener( ConnectionListener altrmiConnectionListener )
+ public void setClientMonitor( ClientMonitor connectionMonitor )
{
- super.setConnectionListener( altrmiConnectionListener );
+ super.setClientMonitor( connectionMonitor );
- m_methodLogging = altrmiConnectionListener.methodLogging();
+ m_methodLogging = connectionMonitor.methodLogging();
}
/**
@@ -99,7 +99,7 @@
{
int millis = ( (TryLaterReply)reply ).getSuggestedDelayMillis();
- m_connectionListener.serviceSuspended( request, tries, millis );
+ m_clientMonitor.serviceSuspended(this.getClass(), request,
tries, millis );
again = true;
}
@@ -122,8 +122,8 @@
{
if( request instanceof MethodRequest )
{
- m_connectionListener.methodCalled(
- ( (MethodRequest)request ).getMethodSignature(),
+ m_clientMonitor.methodCalled(
+ this.getClass(), ( (MethodRequest)request
).getMethodSignature(),
System.currentTimeMillis() - start, "" );
}
}
1.11 +9 -9
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/multiple/AbstractMultipleInvocationHandler.java
Index: AbstractMultipleInvocationHandler.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/multiple/AbstractMultipleInvocationHandler.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- AbstractMultipleInvocationHandler.java 19 Jan 2003 22:10:52 -0000 1.10
+++ AbstractMultipleInvocationHandler.java 8 Feb 2003 15:15:45 -0000 1.11
@@ -9,7 +9,7 @@
import java.io.IOException;
import org.apache.excalibur.altrmi.client.ClientInvocationHandler;
-import org.apache.excalibur.altrmi.client.ConnectionListener;
+import org.apache.excalibur.altrmi.client.ClientMonitor;
import org.apache.excalibur.altrmi.client.ConnectionPinger;
import org.apache.excalibur.altrmi.common.ConnectionException;
import org.apache.excalibur.altrmi.common.CallbackException;
@@ -24,24 +24,24 @@
public abstract class AbstractMultipleInvocationHandler implements
ClientInvocationHandler
{
- private ConnectionListener m_clientConnectionListener;
+ private ClientMonitor m_clientMonitor;
protected AbstractMultipleHostContext m_multipleHostContext;
/**
- * Method setConnectionListener
+ * Method setClientMonitor
*
*
- * @param altrmiConnectionListener
+ * @param connectionMonitor
*
*/
- public void setConnectionListener( ConnectionListener altrmiConnectionListener )
+ public void setClientMonitor( ClientMonitor connectionMonitor )
{
- m_clientConnectionListener = altrmiConnectionListener;
+ m_clientMonitor = connectionMonitor;
}
- public ConnectionListener getConnectionListener()
+ public ClientMonitor getClientMonitor()
{
- return m_clientConnectionListener;
+ return m_clientMonitor;
}
protected void setMultipleHostContext( AbstractMultipleHostContext
multipleHostContext )
1.3 +11 -11
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/rmi/RmiClientInvocationHandler.java
Index: RmiClientInvocationHandler.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/rmi/RmiClientInvocationHandler.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- RmiClientInvocationHandler.java 19 Jan 2003 11:10:00 -0000 1.2
+++ RmiClientInvocationHandler.java 8 Feb 2003 15:15:45 -0000 1.3
@@ -13,7 +13,7 @@
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
-import org.apache.excalibur.altrmi.client.ConnectionListener;
+import org.apache.excalibur.altrmi.client.ClientMonitor;
import org.apache.excalibur.altrmi.client.impl.AbstractClientInvocationHandler;
import org.apache.excalibur.altrmi.common.ConnectionException;
import org.apache.excalibur.altrmi.common.InvocationException;
@@ -86,18 +86,18 @@
}
/**
- * Method setConnectionListener
+ * Method setClientMonitor
*
*
- * @param altrmiConnectionListener
+ * @param connectionMonitor
*
*/
- public void setConnectionListener( ConnectionListener altrmiConnectionListener )
+ public void setClientMonitor( ClientMonitor connectionMonitor )
{
- super.setConnectionListener( altrmiConnectionListener );
+ super.setClientMonitor( connectionMonitor );
- m_methodLogging = altrmiConnectionListener.methodLogging();
+ m_methodLogging = connectionMonitor.methodLogging();
}
/**
@@ -164,7 +164,7 @@
{
int millis = ( (TryLaterReply)reply
).getSuggestedDelayMillis();
- m_connectionListener.serviceSuspended( request, tries,
millis );
+ m_clientMonitor.serviceSuspended(this.getClass(), request,
tries, millis );
again = true;
}
@@ -192,7 +192,7 @@
while( !tryReconnect() )
{
- m_connectionListener.serviceAbend( retryConnectTries, re );
+ m_clientMonitor.serviceAbend(this.getClass(),
retryConnectTries, re);
retryConnectTries++;
}
@@ -209,8 +209,8 @@
{
if( request instanceof MethodRequest )
{
- m_connectionListener.methodCalled(
- ( (MethodRequest)request ).getMethodSignature(),
+ m_clientMonitor.methodCalled(
+ this.getClass(), ( (MethodRequest)request
).getMethodSignature(),
System.currentTimeMillis() - start, "" );
}
}
1.18 +11 -11
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/stream/StreamInvocationHandler.java
Index: StreamInvocationHandler.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/stream/StreamInvocationHandler.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- StreamInvocationHandler.java 7 Feb 2003 07:39:04 -0000 1.17
+++ StreamInvocationHandler.java 8 Feb 2003 15:15:45 -0000 1.18
@@ -11,7 +11,7 @@
import java.io.IOException;
import java.io.InterruptedIOException;
import java.net.SocketException;
-import org.apache.excalibur.altrmi.client.ConnectionListener;
+import org.apache.excalibur.altrmi.client.ClientMonitor;
import org.apache.excalibur.altrmi.client.impl.AbstractClientInvocationHandler;
import org.apache.excalibur.altrmi.client.impl.ClientStreamReadWriter;
import org.apache.excalibur.altrmi.common.InvocationException;
@@ -68,18 +68,18 @@
}
/**
- * Method setConnectionListener
+ * Method setClientMonitor
*
*
- * @param altrmiConnectionListener
+ * @param connectionMonitor
*
*/
- public void setConnectionListener( ConnectionListener altrmiConnectionListener )
+ public void setClientMonitor( ClientMonitor connectionMonitor )
{
- super.setConnectionListener( altrmiConnectionListener );
+ super.setClientMonitor( connectionMonitor );
- m_methodLogging = altrmiConnectionListener.methodLogging();
+ m_methodLogging = connectionMonitor.methodLogging();
}
protected void setObjectReadWriter( ClientStreamReadWriter objectReadWriter )
@@ -149,7 +149,7 @@
{
int millis = ( (TryLaterReply)reply
).getSuggestedDelayMillis();
- m_connectionListener.serviceSuspended( request,
tries,
+ m_clientMonitor.serviceSuspended(this.getClass(),
request, tries,
millis
);
again = true;
@@ -178,7 +178,7 @@
while( !tryReconnect() )
{
- m_connectionListener.serviceAbend(
retryConnectTries, ioe );
+ m_clientMonitor.serviceAbend(this.getClass(),
retryConnectTries, ioe);
retryConnectTries++;
}
@@ -197,8 +197,8 @@
{
if( request instanceof MethodRequest )
{
- m_connectionListener.methodCalled(
- ( (MethodRequest)request ).getMethodSignature(),
+ m_clientMonitor.methodCalled(
+ this.getClass(), ( (MethodRequest)request
).getMethodSignature(),
System.currentTimeMillis() - start, "" );
}
}
1.3 +7 -7
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/ServerMonitor.java
Index: ServerMonitor.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/ServerMonitor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ServerMonitor.java 27 Jan 2003 22:18:54 -0000 1.2
+++ ServerMonitor.java 8 Feb 2003 15:15:45 -0000 1.3
@@ -20,15 +20,15 @@
*/
public interface ServerMonitor {
- void closeError(String s, IOException e);
+ void closeError(Class clazz, String s, IOException e);
- void badConnection(String s, BadConnectionException bce);
+ void badConnection(Class clazz, String s, BadConnectionException bce);
- void connectionProblem(String s, IOException ioe);
+ void connectionProblem(Class clazz, String s, IOException ioe);
- void classNotFound(ClassNotFoundException e);
+ void classNotFound(Class clazz, ClassNotFoundException e);
- void unexpectedException(String s, Exception e);
+ void unexpectedException(Class clazz, String s, Exception e);
- void stopServerError(String s, Exception e);
+ void stopServerError(Class clazz, String s, Exception e);
}
1.4 +3 -3
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/AbstractServerStreamReadWriter.java
Index: AbstractServerStreamReadWriter.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/AbstractServerStreamReadWriter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AbstractServerStreamReadWriter.java 5 Feb 2003 07:32:08 -0000 1.3
+++ AbstractServerStreamReadWriter.java 8 Feb 2003 15:15:45 -0000 1.4
@@ -106,7 +106,7 @@
}
catch ( IOException e )
{
- m_serverMonitor.closeError( "AbstractServerStreamReadWriter.close():
Failed closing an AltRMI connection input stream: ", e);
+ m_serverMonitor.closeError(this.getClass(),
"AbstractServerStreamReadWriter.close(): Failed closing an AltRMI connection input
stream: ", e);
}
try
@@ -115,7 +115,7 @@
}
catch ( IOException e )
{
- m_serverMonitor.closeError( "AbstractServerStreamReadWriter.close():
Failed closing an AltRMI connection output stream: ", e);
+ m_serverMonitor.closeError(this.getClass(),
"AbstractServerStreamReadWriter.close(): Failed closing an AltRMI connection output
stream: ", e);
}
}
1.3 +7 -7
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/ConsoleServerMonitor.java
Index: ConsoleServerMonitor.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/ConsoleServerMonitor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ConsoleServerMonitor.java 27 Jan 2003 22:18:54 -0000 1.2
+++ ConsoleServerMonitor.java 8 Feb 2003 15:15:45 -0000 1.3
@@ -23,12 +23,12 @@
public class ConsoleServerMonitor implements ServerMonitor
{
- public void closeError(String s, IOException e)
+ public void closeError(Class clazz, String s, IOException e)
{
System.out.println("[closeError] " + s + " : " + e.getMessage());
}
- public void badConnection(String s, BadConnectionException bce)
+ public void badConnection(Class clazz, String s, BadConnectionException bce)
{
System.out.println("[badConnection] " + s + " : " + bce.getMessage());
}
@@ -38,22 +38,22 @@
System.out.println("[badConnection] " + s + " : " + ioe.getMessage());
}
- public void classNotFound(ClassNotFoundException e)
+ public void classNotFound(Class clazz, ClassNotFoundException e)
{
System.out.println("[classNotFound] " + e.getMessage());
}
- public void unexpectedException(String s, Exception e)
+ public void unexpectedException(Class clazz, String s, Exception e)
{
System.out.println("[unexpectedException] " + s + " : " + e.getMessage());
}
- public void stopServerError(String s, Exception e)
+ public void stopServerError(Class clazz, String s, Exception e)
{
System.out.println("[stopServerError] " + s + " : " + e.getMessage());
}
- public void connectionProblem(String s, IOException ioe)
+ public void connectionProblem(Class clazz, String s, IOException ioe)
{
System.out.println("[connectionProblem] " + s + " : " + ioe.getMessage());
}
1.4 +7 -7
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/LogEnabledServerMonitor.java
Index: LogEnabledServerMonitor.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/LogEnabledServerMonitor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LogEnabledServerMonitor.java 5 Feb 2003 00:28:55 -0000 1.3
+++ LogEnabledServerMonitor.java 8 Feb 2003 15:15:45 -0000 1.4
@@ -35,32 +35,32 @@
}
- public void closeError(String s, IOException e)
+ public void closeError(Class clazz, String s, IOException e)
{
getLogger().error("[closeError] " + s, e);
}
- public void badConnection(String s, BadConnectionException bce)
+ public void badConnection(Class clazz, String s, BadConnectionException bce)
{
getLogger().error("[badConnection] " + s, bce);
}
- public void classNotFound(ClassNotFoundException e)
+ public void classNotFound(Class clazz, ClassNotFoundException e)
{
getLogger().fatalError("[classNotFound]", e);
}
- public void unexpectedException(String s, Exception e)
+ public void unexpectedException(Class clazz, String s, Exception e)
{
getLogger().error("[unexpectedException] " + s, e);
}
- public void stopServerError(String s, Exception e)
+ public void stopServerError(Class clazz, String s, Exception e)
{
getLogger().error("[stopServerError] " + s, e);
}
- public void connectionProblem(String s, IOException ioe)
+ public void connectionProblem(Class clazz, String s, IOException ioe)
{
getLogger().error("[connectionProblem] " + s, ioe);
}
1.3 +7 -7
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/NullServerMonitor.java
Index: NullServerMonitor.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/NullServerMonitor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NullServerMonitor.java 27 Jan 2003 22:18:54 -0000 1.2
+++ NullServerMonitor.java 8 Feb 2003 15:15:45 -0000 1.3
@@ -23,11 +23,11 @@
public class NullServerMonitor implements ServerMonitor
{
- public void closeError(String s, IOException e)
+ public void closeError(Class clazz, String s, IOException e)
{
}
- public void badConnection(String s, BadConnectionException bce)
+ public void badConnection(Class clazz, String s, BadConnectionException bce)
{
}
@@ -35,19 +35,19 @@
{
}
- public void classNotFound(ClassNotFoundException e)
+ public void classNotFound(Class clazz, ClassNotFoundException e)
{
}
- public void unexpectedException(String s, Exception e)
+ public void unexpectedException(Class clazz, String s, Exception e)
{
}
- public void stopServerError(String s, Exception e)
+ public void stopServerError(Class clazz, String s, Exception e)
{
}
- public void connectionProblem(String s, IOException ioe)
+ public void connectionProblem(Class clazz, String s, IOException ioe)
{
}
}
1.17 +7 -7
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/StreamServerConnection.java
Index: StreamServerConnection.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/StreamServerConnection.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- StreamServerConnection.java 5 Feb 2003 00:55:22 -0000 1.16
+++ StreamServerConnection.java 8 Feb 2003 15:15:45 -0000 1.17
@@ -117,13 +117,13 @@
catch (BadConnectionException bce)
{
more = false;
- m_serverMonitor.badConnection("StreamServerConnection.run():
Bad connection #0", bce);
+ m_serverMonitor.badConnection(this.getClass(),
"StreamServerConnection.run(): Bad connection #0", bce);
m_readWriter.close();
}
catch (ConnectionException ace)
{
more = false;
-
m_serverMonitor.connectionProblem("StreamServerConnection.run(): Unexpected
ConnectionException #0", ace);
+ m_serverMonitor.connectionProblem(this.getClass(),
"StreamServerConnection.run(): Unexpected ConnectionException #0", ace);
m_readWriter.close();
}
catch (IOException ioe)
@@ -142,24 +142,24 @@
}
else
{
-
m_serverMonitor.unexpectedException("StreamServerConnection.run(): Unexpected IOE #1",
ioe);
+ m_serverMonitor.unexpectedException(this.getClass(),
"StreamServerConnection.run(): Unexpected IOE #1", ioe);
m_readWriter.close();
}
}
catch (NullPointerException npe)
{
-
m_serverMonitor.unexpectedException("StreamServerConnection.run(): Unexpected NPE",
npe);
+ m_serverMonitor.unexpectedException(this.getClass(),
"StreamServerConnection.run(): Unexpected NPE", npe);
reply = new ExceptionReply(new
InvocationException("NullPointerException on server: " + npe.getMessage()));
}
}
}
catch (IOException e)
{
- m_serverMonitor.unexpectedException("StreamServerConnection.run():
Unexpected IOE #2", e);
+ m_serverMonitor.unexpectedException(this.getClass(),
"StreamServerConnection.run(): Unexpected IOE #2", e);
}
catch (ClassNotFoundException e)
{
- m_serverMonitor.classNotFound(e);
+ m_serverMonitor.classNotFound(this.getClass(), e);
}
m_abstractServer.connectionCompleted(this);
1.4 +7 -7
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/callback/stream/CallbackEnabledCustomStreamReadWriter.java
Index: CallbackEnabledCustomStreamReadWriter.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/callback/stream/CallbackEnabledCustomStreamReadWriter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CallbackEnabledCustomStreamReadWriter.java 5 Feb 2003 07:32:08 -0000
1.3
+++ CallbackEnabledCustomStreamReadWriter.java 8 Feb 2003 15:15:45 -0000
1.4
@@ -107,14 +107,14 @@
if ((ioe instanceof EOFException &&
reqRepBytes.ioeDuringReadInt())
|| ioe instanceof SocketException)
{
- m_serverMonitor.closeError("Close During callback
operation", ioe);
+ m_serverMonitor.closeError(this.getClass(), "Close During
callback operation", ioe);
m_isStopped = true;
notifyBoth();
// restart ?
return;
}
}
- m_serverMonitor.unexpectedException("Problem during reading of
bytes", ioe);
+ m_serverMonitor.unexpectedException(this.getClass(), "Problem
during reading of bytes", ioe);
}
@@ -130,7 +130,7 @@
}
catch (ClassNotFoundException e)
{
- m_serverMonitor.classNotFound(e);
+ m_serverMonitor.classNotFound(this.getClass(), e);
m_request = null;
m_isStopped = true;
return;
@@ -150,7 +150,7 @@
}
catch (ClassNotFoundException e)
{
- m_serverMonitor.classNotFound(e);
+ m_serverMonitor.classNotFound(this.getClass(), e);
m_reply = new ExceptionReply(new
InvocationException("ClassNotFoundException", e));
}
@@ -196,7 +196,7 @@
}
catch (InterruptedException e)
{
- m_serverMonitor.unexpectedException("Wait issue", e);
+ m_serverMonitor.unexpectedException(this.getClass(), "Wait
issue", e);
}
}
}
@@ -353,7 +353,7 @@
}
catch (ConnectionException connectionException)
{
- m_serverMonitor.connectionProblem("Connection issue on lookup",
connectionException);
+ m_serverMonitor.connectionProblem(this.getClass(), "Connection
issue on lookup", connectionException);
}
}
}
1.8 +3 -3
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/piped/PipedStreamServerConnection.java
Index: PipedStreamServerConnection.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/piped/PipedStreamServerConnection.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- PipedStreamServerConnection.java 5 Feb 2003 00:55:23 -0000 1.7
+++ PipedStreamServerConnection.java 8 Feb 2003 15:15:45 -0000 1.8
@@ -68,7 +68,7 @@
catch( IOException e )
{
-
getServerMonitor().closeError("PipedStreamServerConnection.killConnection(): Some
problem during closing of Input Stream", e);
+ getServerMonitor().closeError(this.getClass(),
"PipedStreamServerConnection.killConnection(): Some problem during closing of Input
Stream", e);
}
try
@@ -77,7 +77,7 @@
}
catch( IOException e )
{
-
getServerMonitor().closeError("PipedStreamServerConnection.killConnection(): Some
problem during closing of Output Stream", e);
+ getServerMonitor().closeError(this.getClass(),
"PipedStreamServerConnection.killConnection(): Some problem during closing of Output
Stream", e);
}
}
}
1.9 +3 -3
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/rmi/RmiServer.java
Index: RmiServer.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/rmi/RmiServer.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- RmiServer.java 19 Jan 2003 11:10:01 -0000 1.8
+++ RmiServer.java 8 Feb 2003 15:15:46 -0000 1.9
@@ -116,11 +116,11 @@
}
catch( RemoteException re )
{
- getServerMonitor().stopServerError("RmiServer.stop(): Error stopping
RMI server - RemoteException",re);
+ getServerMonitor().stopServerError(this.getClass(), "RmiServer.stop():
Error stopping RMI server - RemoteException",re);
}
catch( NotBoundException nbe )
{
- getServerMonitor().stopServerError("RmiServer.stop(): Error stopping
RMI server - NotBoundException",nbe);
+ getServerMonitor().stopServerError(this.getClass(), "RmiServer.stop():
Error stopping RMI server - NotBoundException",nbe);
}
setState(STOPPED);
1.17 +2 -2
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/socket/AbstractCompleteSocketStreamServer.java
Index: AbstractCompleteSocketStreamServer.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/socket/AbstractCompleteSocketStreamServer.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- AbstractCompleteSocketStreamServer.java 5 Feb 2003 07:32:08 -0000 1.16
+++ AbstractCompleteSocketStreamServer.java 8 Feb 2003 15:15:46 -0000 1.17
@@ -125,7 +125,7 @@
else
{
-
getServerMonitor().connectionProblem("AbstractCompleteSocketStreamServer.run(): Some
problem connecting client " +
+ getServerMonitor().connectionProblem(this.getClass(),
"AbstractCompleteSocketStreamServer.run(): Some problem connecting client " +
"via sockets: ", ioe);
}
}
1.10 +3 -3
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/socket/AbstractPartialSocketStreamServer.java
Index: AbstractPartialSocketStreamServer.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/socket/AbstractPartialSocketStreamServer.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- AbstractPartialSocketStreamServer.java 5 Feb 2003 00:55:23 -0000 1.9
+++ AbstractPartialSocketStreamServer.java 8 Feb 2003 15:15:46 -0000 1.10
@@ -47,7 +47,7 @@
}
catch( SocketException se )
{
-
getServerMonitor().connectionProblem("AbstractPartialSocketStreamServer.handleConnection():
Some error during " +
+ getServerMonitor().connectionProblem(this.getClass(),
"AbstractPartialSocketStreamServer.handleConnection(): Some error during " +
"socket handling", se);
}
@@ -69,7 +69,7 @@
catch( IOException ioe )
{
-
getServerMonitor().connectionProblem("AbstractPartialSocketStreamServer.handleConnection():
Some problem connecting " +
+ getServerMonitor().connectionProblem(this.getClass(),
"AbstractPartialSocketStreamServer.handleConnection(): Some problem connecting " +
"client via sockets: ", ioe);
}
}
1.7 +2 -2
avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/socket/SocketStreamServerConnection.java
Index: SocketStreamServerConnection.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/socket/SocketStreamServerConnection.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SocketStreamServerConnection.java 5 Feb 2003 00:55:23 -0000 1.6
+++ SocketStreamServerConnection.java 8 Feb 2003 15:15:46 -0000 1.7
@@ -54,7 +54,7 @@
}
catch( IOException e )
{
-
getServerMonitor().closeError("SocketStreamServerConnection.killConnection(): Error
closing Connection",e);
+ getServerMonitor().closeError(this.getClass(),
"SocketStreamServerConnection.killConnection(): Error closing Connection",e);
}
}
}
1.2 +9 -9
avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/multiprocess/AbstractDyingServerTestCase.java
Index: AbstractDyingServerTestCase.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/multiprocess/AbstractDyingServerTestCase.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AbstractDyingServerTestCase.java 7 Feb 2003 07:39:04 -0000 1.1
+++ AbstractDyingServerTestCase.java 8 Feb 2003 15:15:46 -0000 1.2
@@ -9,7 +9,7 @@
import junit.framework.TestCase;
import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
-import org.apache.excalibur.altrmi.client.ConnectionListener;
+import org.apache.excalibur.altrmi.client.ClientMonitor;
import org.apache.excalibur.altrmi.client.ConnectionClosedException;
import org.apache.excalibur.altrmi.client.HostContext;
import org.apache.excalibur.altrmi.test.TestInterface;
@@ -58,7 +58,7 @@
protected void checkHostContext(HostContext hostContext) throws
ConnectionException {
altrmiFactory.setHostContext(hostContext, false);
- hostContext.getClientInvocationHandler().setConnectionListener(new
MockConnectionListener());
+ hostContext.getClientInvocationHandler().setClientMonitor(new
MockClientMonitor());
testClient = (TestInterface) altrmiFactory.lookup("Hello");
testClient.hello2(123);
@@ -89,29 +89,29 @@
}
}
- private class MockConnectionListener implements ConnectionListener {
- public void methodCalled(String methodSignature, long duration, String
annotation) {
+ private class MockClientMonitor implements ClientMonitor {
+ public void methodCalled(Class clazz, String methodSignature, long
duration, String annotation) {
}
public boolean methodLogging() {
return false;
}
- public void serviceSuspended(Request altrmiRequest, int attempt, int
suggestedWaitMillis) {
+ public void serviceSuspended(Class clazz, Request altrmiRequest, int
attempt, int suggestedWaitMillis) {
}
- public void serviceAbend(int attempt, IOException cause) {
+ public void serviceAbend(Class clazz, int attempt, IOException cause) {
abended = true;
throw new InvocationException("yee haa!");
}
- public void invocationFailure(String name, InvocationException ie) {
+ public void invocationFailure(Class clazz, String name, InvocationException
ie) {
}
- public void unexpectedClosedConnection(String name,
ConnectionClosedException cce) {
+ public void unexpectedClosedConnection(Class clazz, String name,
ConnectionClosedException cce) {
}
- public void unexpectedInterruption(String name, InterruptedException ie) {
+ public void unexpectedInterruption(Class clazz, String name,
InterruptedException ie) {
}
}
}
1.8 +7 -7
avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/DummyInvocationHandler.java
Index: DummyInvocationHandler.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/DummyInvocationHandler.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- DummyInvocationHandler.java 5 Feb 2003 07:32:08 -0000 1.7
+++ DummyInvocationHandler.java 8 Feb 2003 15:15:46 -0000 1.8
@@ -13,7 +13,7 @@
import org.apache.excalibur.altrmi.common.CallbackException;
import org.apache.excalibur.altrmi.common.ThreadPool;
import org.apache.excalibur.altrmi.client.ClientInvocationHandler;
-import org.apache.excalibur.altrmi.client.ConnectionListener;
+import org.apache.excalibur.altrmi.client.ClientMonitor;
import org.apache.excalibur.altrmi.client.ConnectionPinger;
@@ -30,7 +30,7 @@
boolean pinged = false;
long lastReq = System.currentTimeMillis();
- private ConnectionListener m_connectionListener;
+ private ClientMonitor m_clientMonitor;
private ThreadPool m_threadContextProvider;
public boolean isPinged()
@@ -63,9 +63,9 @@
throw new java.lang.UnsupportedOperationException();
}
- public void setConnectionListener(ConnectionListener connectionListener)
+ public void setClientMonitor(ClientMonitor clientMonitor)
{
- m_connectionListener = connectionListener;
+ m_clientMonitor = clientMonitor;
}
public void setConnectionPinger(ConnectionPinger connectionPinger)
@@ -88,9 +88,9 @@
throw new java.lang.UnsupportedOperationException();
}
- public ConnectionListener getConnectionListener()
+ public ClientMonitor getClientMonitor()
{
- return m_connectionListener;
+ return m_clientMonitor;
}
public boolean isCallBackEnabled()
1.6 +4 -4
avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/invalidstate/BouncingServerTestCase.java
Index: BouncingServerTestCase.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/invalidstate/BouncingServerTestCase.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- BouncingServerTestCase.java 1 Feb 2003 12:04:03 -0000 1.5
+++ BouncingServerTestCase.java 8 Feb 2003 15:15:46 -0000 1.6
@@ -18,7 +18,7 @@
import org.apache.excalibur.altrmi.test.TestInterface2;
import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
import org.apache.excalibur.altrmi.client.impl.NeverConnectionPinger;
-import org.apache.excalibur.altrmi.client.impl.DumbConnectionListener;
+import org.apache.excalibur.altrmi.client.impl.DumbClientMonitor;
import org.apache.excalibur.altrmi.client.impl.socket.SocketCustomStreamHostContext;
import org.apache.excalibur.altrmi.client.HostContext;
import org.apache.excalibur.altrmi.client.ClientInvocationHandler;
@@ -49,12 +49,12 @@
// Client side setup
altrmiFactory = new ClientSideClassFactory();
- HostContext hc = new SocketCustomStreamHostContext("127.0.0.1", 12101);
+ HostContext hc = new SocketCustomStreamHostContext("127.0.0.1", 12201);
altrmiFactory.setHostContext(hc, false);
ClientInvocationHandler ih = hc.getClientInvocationHandler();
ih.setConnectionPinger(new NeverConnectionPinger());
- ih.setConnectionListener(new DumbConnectionListener());
+ ih.setClientMonitor(new DumbClientMonitor());
TestInterface testClient = (TestInterface)
altrmiFactory.lookup("Hello");
// just a kludge for unit testing given we are intrinsically dealing
with
@@ -91,7 +91,7 @@
private CompleteSocketCustomStreamServer startServer() throws ServerException,
PublicationException
{
- CompleteSocketCustomStreamServer server = new
CompleteSocketCustomStreamServer(12101);
+ CompleteSocketCustomStreamServer server = new
CompleteSocketCustomStreamServer(12201);
TestInterfaceImpl testServer = new TestInterfaceImpl();
PublicationDescription pd = new PublicationDescription(TestInterface.class,
new Class[]{TestInterface3.class, TestInterface2.class});
1.16 +20 -25
avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/socket/CallbackEnabledCustomStreamTestCase.java
Index: CallbackEnabledCustomStreamTestCase.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/socket/CallbackEnabledCustomStreamTestCase.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- CallbackEnabledCustomStreamTestCase.java 7 Feb 2003 07:39:04 -0000 1.15
+++ CallbackEnabledCustomStreamTestCase.java 8 Feb 2003 15:15:46 -0000 1.16
@@ -7,27 +7,22 @@
*/
package org.apache.excalibur.altrmi.test.socket;
+import org.apache.excalibur.altrmi.client.ClientMonitor;
+import org.apache.excalibur.altrmi.client.ConnectionClosedException;
+import org.apache.excalibur.altrmi.client.HostContext;
import org.apache.excalibur.altrmi.client.impl.ClientSideClassFactory;
import
org.apache.excalibur.altrmi.client.impl.callback.socket.CallbackEnabledSocketCustomStreamHostContext;
-import org.apache.excalibur.altrmi.client.HostContext;
-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;
+import org.apache.excalibur.altrmi.server.PublicationDescription;
+import org.apache.excalibur.altrmi.server.impl.NullServerMonitor;
+import
org.apache.excalibur.altrmi.server.impl.callback.socket.CallbackEnabledSocketCustomStreamServer;
+import org.apache.excalibur.altrmi.test.AbstractHelloCallBackTestCase;
import org.apache.excalibur.altrmi.test.TestInterface;
-import org.apache.excalibur.altrmi.test.TestInterfaceImpl;
-import org.apache.excalibur.altrmi.test.TestInterface3;
import org.apache.excalibur.altrmi.test.TestInterface2;
-import org.apache.excalibur.altrmi.test.AbstractHelloCallBackTestCase;
-import
org.apache.excalibur.altrmi.server.impl.callback.socket.CallbackEnabledSocketCustomStreamServer;
-import org.apache.excalibur.altrmi.server.impl.LogEnabledServerMonitor;
-import org.apache.excalibur.altrmi.server.PublicationDescription;
-import org.apache.excalibur.altrmi.common.Request;
-import org.apache.excalibur.altrmi.common.InvocationException;
-import org.apache.avalon.framework.logger.ConsoleLogger;
-import org.apache.avalon.framework.logger.Logger;
-import org.apache.avalon.framework.logger.NullLogger;
+import org.apache.excalibur.altrmi.test.TestInterface3;
+import org.apache.excalibur.altrmi.test.TestInterfaceImpl;
-import java.util.HashMap;
import java.io.IOException;
@@ -54,39 +49,39 @@
PublicationDescription pd = new PublicationDescription(TestInterface.class,
new Class[] { TestInterface3.class, TestInterface2.class });
server.publish(testServer, "Hello", pd);
- server.setServerMonitor(new LogEnabledServerMonitor(new NullLogger()));
+ server.setServerMonitor(new NullServerMonitor());
server.start();
// Client side setup
altrmiFactory = new ClientSideClassFactory();
HostContext hc = new
CallbackEnabledSocketCustomStreamHostContext("127.0.0.1", 10004);
- hc.getClientInvocationHandler().setConnectionListener(new
ConnectionListener() {
- public void methodCalled(String methodSignature, long duration, String
annotation)
+ hc.getClientInvocationHandler().setClientMonitor(new ClientMonitor() {
+ public void methodCalled(Class clazz, String methodSignature, long
duration, String annotation)
{
}
public boolean methodLogging()
{
- return true;
+ return false;
}
- public void serviceSuspended(Request altrmiRequest, int attempt, int
suggestedWaitMillis)
+ public void serviceSuspended(Class clazz, Request altrmiRequest, int
attempt, int suggestedWaitMillis)
{
}
- public void serviceAbend(int attempt, IOException cause)
+ public void serviceAbend(Class clazz, int attempt, IOException cause)
{
}
- public void invocationFailure(String name, InvocationException ie)
+ public void invocationFailure(Class clazz, String name,
InvocationException ie)
{
}
- public void unexpectedClosedConnection(String name,
ConnectionClosedException cce)
+ public void unexpectedClosedConnection(Class clazz, String name,
ConnectionClosedException cce)
{
}
- public void unexpectedInterruption(String name, InterruptedException ie)
+ public void unexpectedInterruption(Class clazz, String name,
InterruptedException ie)
{
}
});
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]