hammant 2003/07/15 00:08:57
Modified: src/java/org/apache/altrmi/client/impl/socket
SocketObjectStreamInvocationHandler.java
src/java/org/apache/altrmi/client/impl/stream
ClientCustomStreamReadWriter.java
ClientObjectStreamReadWriter.java
StreamInvocationHandler.java
src/java/org/apache/altrmi/client/impl/subscriber
AbstractInterfaceLookupFactory.java
CallbackEnabledCustomSocketStreamInterfaceLookupFactory.java
DefaultLookupSource.java
RmiInterfaceLookupFactory.java
SocketObjectStreamInterfaceLookupFactory.java
Added: src/java/org/apache/altrmi/client/impl/stream
AbstractStreamClientInvocationHandler.java
src/java/org/apache/altrmi/client/impl
AvalonFrameworkClientMonitor.java
Log:
Big Refactor. Removal of accidental duplicate instances. Make comps more
fail-safe
Revision Changes Path
1.4 +14 -10
incubator-altrmi/src/java/org/apache/altrmi/client/impl/socket/SocketObjectStreamInvocationHandler.java
Index: SocketObjectStreamInvocationHandler.java
===================================================================
RCS file:
/home/cvs/incubator-altrmi/src/java/org/apache/altrmi/client/impl/socket/SocketObjectStreamInvocationHandler.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SocketObjectStreamInvocationHandler.java 25 May 2003 17:28:14 -0000
1.3
+++ SocketObjectStreamInvocationHandler.java 15 Jul 2003 07:08:56 -0000
1.4
@@ -58,7 +58,10 @@
import java.io.OutputStream;
import org.apache.altrmi.client.impl.stream.ClientObjectStreamReadWriter;
import org.apache.altrmi.client.impl.ClientStreamReadWriter;
+import org.apache.altrmi.client.ClientMonitor;
+import org.apache.altrmi.client.ConnectionPinger;
import org.apache.altrmi.common.ConnectionException;
+import org.apache.altrmi.common.ThreadPool;
/**
* Class SocketObjectStreamInvocationHandler
@@ -74,20 +77,21 @@
/**
* Const a SocketObjectStreamInvocationHandler.
*
- *
- * @param host the host
- * @param port the port
- * @param classLoader a classloader for deserialization hints.
- *
- * @throws ConnectionException if a problem
- *
+ * @param threadPool
+ * @param clientMonitor
+ * @param connectionPinger
+ * @param host
+ * @param port
+ * @param interfacesClassLoader
+ * @throws ConnectionException
*/
public SocketObjectStreamInvocationHandler(
- String host, int port, ClassLoader classLoader )
+ ThreadPool threadPool, ClientMonitor clientMonitor,
ConnectionPinger connectionPinger,
+ String host, int port, ClassLoader interfacesClassLoader )
throws ConnectionException
{
- super( host, port, classLoader );
+ super( threadPool, clientMonitor, connectionPinger,
interfacesClassLoader, host, port );
//TODO - is this a pending problem? The superclass invokes
createClientStreamReadWriter
// perhaps an init() is needed.
1.4 +5 -5
incubator-altrmi/src/java/org/apache/altrmi/client/impl/stream/ClientCustomStreamReadWriter.java
Index: ClientCustomStreamReadWriter.java
===================================================================
RCS file:
/home/cvs/incubator-altrmi/src/java/org/apache/altrmi/client/impl/stream/ClientCustomStreamReadWriter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ClientCustomStreamReadWriter.java 17 Feb 2003 20:28:06 -0000 1.3
+++ ClientCustomStreamReadWriter.java 15 Jul 2003 07:08:56 -0000 1.4
@@ -103,21 +103,21 @@
m_interfacesClassLoader = interfacesClassLoader;
}
- public synchronized Reply postRequest( Request altrmiRequest )
+ public synchronized Reply postRequest( Request request )
throws IOException, ClassNotFoundException
{
- writeRequest( altrmiRequest );
+ writeRequest( request );
Reply r = readReply();
return r;
}
- private void writeRequest( Request altrmiRequest ) throws IOException
+ private void writeRequest( Request request ) throws IOException
{
- byte[] aBytes = SerializationHelper.getBytesFromInstance(
altrmiRequest );
+ byte[] aBytes = SerializationHelper.getBytesFromInstance( request );
m_dataOutputStream.writeInt( aBytes.length );
m_dataOutputStream.write( aBytes );
1.6 +16 -14
incubator-altrmi/src/java/org/apache/altrmi/client/impl/stream/ClientObjectStreamReadWriter.java
Index: ClientObjectStreamReadWriter.java
===================================================================
RCS file:
/home/cvs/incubator-altrmi/src/java/org/apache/altrmi/client/impl/stream/ClientObjectStreamReadWriter.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ClientObjectStreamReadWriter.java 26 May 2003 10:19:55 -0000 1.5
+++ ClientObjectStreamReadWriter.java 15 Jul 2003 07:08:56 -0000 1.6
@@ -54,15 +54,19 @@
*/
package org.apache.altrmi.client.impl.stream;
-import java.io.*;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-
+import org.apache.altrmi.client.impl.ClientStreamReadWriter;
+import org.apache.altrmi.common.BadConnectionException;
+import org.apache.altrmi.common.ConnectionException;
import org.apache.altrmi.common.Reply;
import org.apache.altrmi.common.Request;
-import org.apache.altrmi.common.ConnectionException;
-import org.apache.altrmi.common.BadConnectionException;
-import org.apache.altrmi.client.impl.ClientStreamReadWriter;
+
+import javax.swing.*;
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
/**
* Class ClientObjectStreamReadWriter
@@ -106,19 +110,17 @@
}
}
- public synchronized Reply postRequest( Request altrmiRequest )
+ public synchronized Reply postRequest( Request request )
throws IOException, ClassNotFoundException
{
-
- writeRequest( altrmiRequest );
-
+ writeRequest( request );
return readReply();
}
- private void writeRequest( Request altrmiRequest ) throws IOException
+ private void writeRequest( Request request ) throws IOException
{
- m_objectOutputStream.writeObject( altrmiRequest );
+ m_objectOutputStream.writeObject( request );
m_objectOutputStream.flush();
//m_objectOutputStream.reset();
1.4 +10 -18
incubator-altrmi/src/java/org/apache/altrmi/client/impl/stream/StreamInvocationHandler.java
Index: StreamInvocationHandler.java
===================================================================
RCS file:
/home/cvs/incubator-altrmi/src/java/org/apache/altrmi/client/impl/stream/StreamInvocationHandler.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- StreamInvocationHandler.java 20 Feb 2003 07:36:58 -0000 1.3
+++ StreamInvocationHandler.java 15 Jul 2003 07:08:56 -0000 1.4
@@ -69,6 +69,7 @@
import org.apache.altrmi.common.NoSuchReferenceReply;
import org.apache.altrmi.client.NotPublishedException;
import org.apache.altrmi.client.NoSuchSessionException;
+import org.apache.altrmi.client.ConnectionPinger;
import org.apache.altrmi.common.NotPublishedReply;
import org.apache.altrmi.common.PublishedNameRequest;
import org.apache.altrmi.common.TryLaterReply;
@@ -76,6 +77,7 @@
import org.apache.altrmi.common.ReplyConstants;
import org.apache.altrmi.common.ClientInvocationAbendReply;
import org.apache.altrmi.common.NoSuchSessionReply;
+import org.apache.altrmi.common.ThreadPool;
/**
* Class StreamInvocationHandler
@@ -96,12 +98,17 @@
* Constructor StreamInvocationHandler
*
*
+ * @param threadPool
+ * @param clientMonitor
+ * @param connectionPinger
* @param interfacesClassLoader
- *
*/
- public StreamInvocationHandler( ClassLoader interfacesClassLoader )
+ public StreamInvocationHandler( ThreadPool threadPool, ClientMonitor
clientMonitor, ConnectionPinger connectionPinger, ClassLoader
interfacesClassLoader )
{
+ super(threadPool, clientMonitor, connectionPinger);
m_interfacesClassLoader = interfacesClassLoader;
+ m_methodLogging = clientMonitor.methodLogging();
+
}
/**
@@ -114,21 +121,6 @@
public ClassLoader getInterfacesClassLoader()
{
return m_interfacesClassLoader;
- }
-
- /**
- * Method setClientMonitor
- *
- *
- * @param connectionMonitor
- *
- */
- public void setClientMonitor( ClientMonitor connectionMonitor )
- {
-
- super.setClientMonitor( connectionMonitor );
-
- m_methodLogging = connectionMonitor.methodLogging();
}
protected void setObjectReadWriter( ClientStreamReadWriter
objectReadWriter )
1.1
incubator-altrmi/src/java/org/apache/altrmi/client/impl/stream/AbstractStreamClientInvocationHandler.java
Index: AbstractStreamClientInvocationHandler.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 1997-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software
* itself, if and wherever such third-party acknowledgments
* normally appear.
*
* 4. The names "Incubator", "AltRMI", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.altrmi.client.impl.stream;
import java.io.EOFException;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.net.SocketException;
import org.apache.altrmi.client.ClientMonitor;
import org.apache.altrmi.client.impl.AbstractClientInvocationHandler;
import org.apache.altrmi.client.impl.ClientStreamReadWriter;
import org.apache.altrmi.client.InvocationException;
import org.apache.altrmi.common.Reply;
import org.apache.altrmi.common.Request;
import org.apache.altrmi.common.MethodRequest;
import org.apache.altrmi.client.NoSuchReferenceException;
import org.apache.altrmi.common.NoSuchReferenceReply;
import org.apache.altrmi.client.NotPublishedException;
import org.apache.altrmi.client.NoSuchSessionException;
import org.apache.altrmi.client.ConnectionPinger;
import org.apache.altrmi.common.NotPublishedReply;
import org.apache.altrmi.common.PublishedNameRequest;
import org.apache.altrmi.common.TryLaterReply;
import org.apache.altrmi.common.RequestConstants;
import org.apache.altrmi.common.ReplyConstants;
import org.apache.altrmi.common.ClientInvocationAbendReply;
import org.apache.altrmi.common.NoSuchSessionReply;
import org.apache.altrmi.common.ThreadPool;
import javax.swing.*;
/**
* Class AbstractStreamClientInvocationHandler
*
*
* @author Paul Hammant
* @version $Revision: 1.1 $
*/
public abstract class AbstractStreamClientInvocationHandler extends
AbstractClientInvocationHandler
{
private ClientStreamReadWriter m_objectReadWriter;
private boolean m_methodLogging = false;
private long m_lastRealRequest = System.currentTimeMillis();
protected final ClassLoader m_interfacesClassLoader;
/**
* Constructor AbstractStreamClientInvocationHandler
*
* @param threadPool
* @param clientMonitor
* @param connectionPinger
* @param interfacesClassLoader
*/
public AbstractStreamClientInvocationHandler(ThreadPool threadPool,
ClientMonitor clientMonitor, ConnectionPinger connectionPinger, ClassLoader
interfacesClassLoader)
{
super(threadPool, clientMonitor, connectionPinger);
m_interfacesClassLoader = interfacesClassLoader;
}
/**
* Method getInterfacesClassLoader
*
*
* @return
*
*/
public ClassLoader getInterfacesClassLoader()
{
return m_interfacesClassLoader;
}
protected void setObjectReadWriter( ClientStreamReadWriter
objectReadWriter )
{
m_objectReadWriter = objectReadWriter;
}
protected void requestWritten()
{
}
/**
* Method handleInvocation
*
*
* @param request
*
* @return
*
*/
public synchronized Reply handleInvocation( Request request )
{
if( request.getRequestCode() != RequestConstants.PINGREQUEST )
{
m_lastRealRequest = System.currentTimeMillis();
}
try
{
while( true )
{
boolean again = true;
Reply reply = null;
int tries = 0;
long start = 0;
if( m_methodLogging )
{
start = System.currentTimeMillis();
}
while( again )
{
tries++;
again = false;
try
{
long t1 = System.currentTimeMillis();
reply = (Reply)m_objectReadWriter.postRequest(
request );
long t2 = System.currentTimeMillis();
if( reply.getReplyCode() >= 100 )
{
// special case for callabcks.
if (reply.getReplyCode() ==
ReplyConstants.CLIENTABEND)
{
ClientInvocationAbendReply abendReply =
(ClientInvocationAbendReply) reply;
throw abendReply.getIOException();
}
if( reply instanceof TryLaterReply )
{
int millis = ( (TryLaterReply)reply
).getSuggestedDelayMillis();
m_clientMonitor.serviceSuspended(this.getClass(), request, tries,
millis );
again = true;
}
else if( reply instanceof NoSuchReferenceReply )
{
throw new NoSuchReferenceException( (
(NoSuchReferenceReply)reply )
.getReferenceID() );
}
else if( reply instanceof NoSuchSessionReply )
{
throw new NoSuchSessionException( (
(NoSuchSessionReply)reply )
.getSessionID() );
}
else if( reply instanceof NotPublishedReply )
{
PublishedNameRequest pnr =
(PublishedNameRequest)request;
throw new NotPublishedException(
pnr.getPublishedServiceName(),
pnr.getObjectName() );
}
}
}
catch( IOException ioe )
{
if(isSafeEnd(ioe))
{
int retryConnectTries = 0;
again = true;
while( !tryReconnect() )
{
m_clientMonitor.serviceAbend(this.getClass(),
retryConnectTries, ioe);
retryConnectTries++;
}
}
else
{
ioe.printStackTrace();
throw new InvocationException(
"IO Exception during invocation to server :"
+ ioe.getMessage() );
}
}
}
if( m_methodLogging )
{
if( request instanceof MethodRequest )
{
m_clientMonitor.methodCalled(
this.getClass(), ( (MethodRequest)request
).getMethodSignature(),
System.currentTimeMillis() - start, "" );
}
}
return reply;
}
}
catch( ClassNotFoundException e )
{
throw new InvocationException( "Class definition missing on
Deserialization: "
+ e.getMessage() );
}
}
private boolean isSafeEnd(IOException ioe) {
if (ioe instanceof SocketException | ioe instanceof EOFException
| ioe instanceof InterruptedIOException) {
return true;
}
if (ioe.getMessage() != null) {
String msg = ioe.getMessage();
if (msg.equals("Read end dead") | msg.equals("Pipe closed")) {
return true;
}
}
return false;
}
/**
* Method getLastRealRequest
*
*
* @return
*
*/
public long getLastRealRequest()
{
return m_lastRealRequest;
}
}
1.4 +6 -11
incubator-altrmi/src/java/org/apache/altrmi/client/impl/subscriber/AbstractInterfaceLookupFactory.java
Index: AbstractInterfaceLookupFactory.java
===================================================================
RCS file:
/home/cvs/incubator-altrmi/src/java/org/apache/altrmi/client/impl/subscriber/AbstractInterfaceLookupFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AbstractInterfaceLookupFactory.java 25 May 2003 16:49:55 -0000
1.3
+++ AbstractInterfaceLookupFactory.java 15 Jul 2003 07:08:56 -0000
1.4
@@ -64,12 +64,11 @@
import org.apache.altrmi.client.Factory;
import org.apache.altrmi.client.HostContext;
import org.apache.altrmi.client.impl.ClientSideClassFactory;
-import org.apache.altrmi.client.impl.PerpetualConnectionPinger;
import org.apache.altrmi.client.impl.ServerSideClassFactory;
import org.apache.altrmi.common.ConnectionException;
/**
- * Abstract base factory to create <code>InterfaceLookup</code> instances
for the
+ * Abstract base m_factory to create <code>InterfaceLookup</code> instances
for the
* connection pool.
*
* Concrete subclasses provide support for the various AltRMI transports
@@ -79,7 +78,7 @@
public abstract class AbstractInterfaceLookupFactory extends
AbstractLogEnabled
implements ObjectFactory, Configurable
{
- private Constructor m_altrmiFactoryConstructor;
+ private Constructor m_factoryConstructor;
private boolean m_isServer;
public void configure( Configuration configuration ) throws
ConfigurationException
@@ -100,25 +99,21 @@
}
}
- private Factory createFactory()
+ private Factory createFactory(HostContext context) throws
ConnectionException
{
if( this.m_isServer )
{
- return new ServerSideClassFactory();
+ return new ServerSideClassFactory(context, false);
}
else
{
- return new ClientSideClassFactory();
+ return new ClientSideClassFactory(context, false);
}
}
public Object newInstance() throws Exception
{
- final Factory factory = createFactory();
- final HostContext context = createHostContext();
-
- context.getClientInvocationHandler().setConnectionPinger( new
PerpetualConnectionPinger() );
- factory.setHostContext( context );
+ final Factory factory = createFactory(createHostContext());
if( getLogger().isDebugEnabled() )
getLogger().debug( "InterfaceLookup object created" );
1.3 +5 -2
incubator-altrmi/src/java/org/apache/altrmi/client/impl/subscriber/CallbackEnabledCustomSocketStreamInterfaceLookupFactory.java
Index: CallbackEnabledCustomSocketStreamInterfaceLookupFactory.java
===================================================================
RCS file:
/home/cvs/incubator-altrmi/src/java/org/apache/altrmi/client/impl/subscriber/CallbackEnabledCustomSocketStreamInterfaceLookupFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CallbackEnabledCustomSocketStreamInterfaceLookupFactory.java 17 Feb
2003 20:28:06 -0000 1.2
+++ CallbackEnabledCustomSocketStreamInterfaceLookupFactory.java 15 Jul
2003 07:08:56 -0000 1.3
@@ -58,7 +58,10 @@
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.altrmi.client.HostContext;
import
org.apache.altrmi.client.impl.callback.socket.CallbackEnabledSocketCustomStreamHostContext;
+import org.apache.altrmi.client.impl.DefaultClientMonitor;
+import org.apache.altrmi.client.impl.PerpetualConnectionPinger;
import org.apache.altrmi.common.ConnectionException;
+import org.apache.altrmi.common.DefaultThreadPool;
/**
* Factory for CallbackEnabledSocketCustomStream transport
@@ -82,6 +85,6 @@
protected HostContext createHostContext() throws ConnectionException
{
- return new CallbackEnabledSocketCustomStreamHostContext( m_host,
m_port );
+ return new
CallbackEnabledSocketCustomStreamHostContext.WithCurrentClassLoader( new
DefaultThreadPool(), new DefaultClientMonitor(), new
PerpetualConnectionPinger(), m_host, m_port );
}
}
1.3 +6 -6
incubator-altrmi/src/java/org/apache/altrmi/client/impl/subscriber/DefaultLookupSource.java
Index: DefaultLookupSource.java
===================================================================
RCS file:
/home/cvs/incubator-altrmi/src/java/org/apache/altrmi/client/impl/subscriber/DefaultLookupSource.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DefaultLookupSource.java 17 Feb 2003 20:28:06 -0000 1.2
+++ DefaultLookupSource.java 15 Jul 2003 07:08:56 -0000 1.3
@@ -72,11 +72,11 @@
* <pre>
* <altrmi-subscriber>
* <pool-controller min="3" max="50"/>
- * <factory
class="org.apache.altrmi.client.impl.subscriber.SocketObjectStreamInterfaceLookupFactory">
+ * <m_factory
class="org.apache.altrmi.client.impl.subscriber.SocketObjectStreamInterfaceLookupFactory">
* <proxyClassLocation>client</proxyClassLocation>
* <host>localhost</host>
* <port>1234</port>
- * </factory>
+ * </m_factory>
* </altrmi-subscriber>
* </pre>
* <p>
@@ -89,9 +89,9 @@
* <li>The <code>max</code> attribute is used to set the maximum number of
connections which
* will be opened. (Defaults to "3")</li>
*
- * <li>The <code>factory</code> element is used to set the factory used to
create
+ * <li>The <code>m_factory</code> element is used to set the m_factory used
to create
* <code>InterfaceLookup</code> instances. The <code>class</code>
attribute contains
- * the name of the class to use. This configuration block is also passed
to the factory
+ * the name of the class to use. This configuration block is also passed
to the m_factory
* to configure it.
* </li>
* </ul>
@@ -122,7 +122,7 @@
final Configuration controller = configuration.getChild(
"pool-controller" );
final int min = controller.getAttributeAsInteger( "min", 1 );
final int max = controller.getAttributeAsInteger( "max", 3 );
- final Configuration fconfig = configuration.getChild( "factory"
);
+ final Configuration fconfig = configuration.getChild(
"m_factory" );
final int l_max;
final int l_min;
1.3 +2 -2
incubator-altrmi/src/java/org/apache/altrmi/client/impl/subscriber/RmiInterfaceLookupFactory.java
Index: RmiInterfaceLookupFactory.java
===================================================================
RCS file:
/home/cvs/incubator-altrmi/src/java/org/apache/altrmi/client/impl/subscriber/RmiInterfaceLookupFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- RmiInterfaceLookupFactory.java 17 Feb 2003 20:28:06 -0000 1.2
+++ RmiInterfaceLookupFactory.java 15 Jul 2003 07:08:56 -0000 1.3
@@ -81,6 +81,6 @@
protected HostContext createHostContext() throws ConnectionException
{
- return new RmiHostContext( m_host, m_port );
+ return new RmiHostContext.WithSimpleDefaults( m_host, m_port );
}
}
1.3 +5 -2
incubator-altrmi/src/java/org/apache/altrmi/client/impl/subscriber/SocketObjectStreamInterfaceLookupFactory.java
Index: SocketObjectStreamInterfaceLookupFactory.java
===================================================================
RCS file:
/home/cvs/incubator-altrmi/src/java/org/apache/altrmi/client/impl/subscriber/SocketObjectStreamInterfaceLookupFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SocketObjectStreamInterfaceLookupFactory.java 17 Feb 2003 20:28:06
-0000 1.2
+++ SocketObjectStreamInterfaceLookupFactory.java 15 Jul 2003 07:08:56
-0000 1.3
@@ -58,7 +58,10 @@
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.altrmi.client.HostContext;
import org.apache.altrmi.client.impl.socket.SocketObjectStreamHostContext;
+import org.apache.altrmi.client.impl.DefaultClientMonitor;
+import org.apache.altrmi.client.impl.PerpetualConnectionPinger;
import org.apache.altrmi.common.ConnectionException;
+import org.apache.altrmi.common.DefaultThreadPool;
/**
* Factory for SocketObjectStream transport
@@ -81,6 +84,6 @@
protected HostContext createHostContext() throws ConnectionException
{
- return new SocketObjectStreamHostContext( m_host, m_port );
+ return new SocketObjectStreamHostContext( new DefaultThreadPool(),
new DefaultClientMonitor(), new PerpetualConnectionPinger(),
this.getClass().getClassLoader(), m_host, m_port );
}
}
1.1
incubator-altrmi/src/java/org/apache/altrmi/client/impl/AvalonFrameworkClientMonitor.java
Index: AvalonFrameworkClientMonitor.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 1997-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software
* itself, if and wherever such third-party acknowledgments
* normally appear.
*
* 4. The names "Incubator", "AltRMI", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.altrmi.client.impl;
import org.apache.avalon.framework.logger.Logger;
public class AvalonFrameworkClientMonitor extends DefaultClientMonitor
{
private final Logger m_logger;
public AvalonFrameworkClientMonitor(Logger logger)
{
m_logger = logger;
}
void printMessage(String message)
{
m_logger.info(message);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]