Return-Path: Delivered-To: apmail-jakarta-avalon-cvs-archive@apache.org Received: (qmail 76807 invoked from network); 8 Aug 2002 14:18:45 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 8 Aug 2002 14:18:45 -0000 Received: (qmail 12346 invoked by uid 97); 8 Aug 2002 14:19:08 -0000 Delivered-To: qmlist-jakarta-archive-avalon-cvs@jakarta.apache.org Received: (qmail 12286 invoked by uid 97); 8 Aug 2002 14:19:08 -0000 Mailing-List: contact avalon-cvs-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon CVS List" Reply-To: "Avalon Developers List" Delivered-To: mailing list avalon-cvs@jakarta.apache.org Received: (qmail 12275 invoked by uid 97); 8 Aug 2002 14:19:07 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 8 Aug 2002 14:18:40 -0000 Message-ID: <20020808141840.49737.qmail@icarus.apache.org> From: proyal@apache.org To: jakarta-avalon-excalibur-cvs@apache.org Subject: cvs commit: jakarta-avalon-excalibur/altrmi build.xml default.properties X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N proyal 2002/08/08 07:18:40 Modified: altrmi build.xml default.properties Added: altrmi/src/java/org/apache/excalibur/altrmi/client/impl/subscriber AbstractAltrmiInterfaceLookupFactory.java AbstractSubscriberImpl.java AltrmiInterfaceLookupWrapper.java AltrmiLookupPool.java CallbackEnabledCustomSocketStreamInterfaceLookupFactory.java ConnectionException.java DefaultAltrmiLookupSource.java RmiInterfaceLookupFactory.java SocketObjectStreamInterfaceLookupFactory.java altrmi/src/java/org/apache/excalibur/altrmi/client AbstractSubscriber.java AltrmiLookupSource.java Log: Adding "Subscriber" components to assist in development of altrmi client application. This includes an AltrmiInterfaceLookup connection pool as well as an abstract component to assist in retrieval of the remote interface from the pool Revision Changes Path 1.1 jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/subscriber/AbstractAltrmiInterfaceLookupFactory.java Index: AbstractAltrmiInterfaceLookupFactory.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.subscriber; import java.lang.reflect.Constructor; import org.apache.avalon.excalibur.pool.ObjectFactory; import org.apache.avalon.framework.configuration.Configurable; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.logger.AbstractLogEnabled; import org.apache.excalibur.altrmi.client.AltrmiFactory; import org.apache.excalibur.altrmi.client.AltrmiHostContext; import org.apache.excalibur.altrmi.client.impl.ClientClassAltrmiFactory; import org.apache.excalibur.altrmi.client.impl.PerpetualConnectionPinger; import org.apache.excalibur.altrmi.client.impl.ServerClassAltrmiFactory; import org.apache.excalibur.altrmi.common.AltrmiConnectionException; /** * Abstract base factory to create AltrmiInterfaceLookup instances for the * connection pool. * * Concrete subclasses provide support for the various Altrmi transports * * @author Peter Royal */ public abstract class AbstractAltrmiInterfaceLookupFactory extends AbstractLogEnabled implements ObjectFactory, Configurable { private Constructor m_altrmiFactoryConstructor; private boolean m_isServer; public void configure( Configuration configuration ) throws ConfigurationException { String proxyClassLocation = configuration.getChild( "proxyClassLocation" ).getValue(); if( proxyClassLocation.equals( "client" ) ) { this.m_isServer = false; } else if( proxyClassLocation.equals( "server" ) ) { this.m_isServer = true; } else { throw new ConfigurationException( "proxyClassLocation must be 'client' or 'server'" ); } } private AltrmiFactory createFactory() { if( this.m_isServer ) { return new ServerClassAltrmiFactory( false ); } else { return new ClientClassAltrmiFactory( false ); } } public Object newInstance() throws Exception { final AltrmiFactory factory = createFactory(); final AltrmiHostContext context = createHostContext(); context.getClientInvocationHandler().setConnectionPinger( new PerpetualConnectionPinger() ); factory.setHostContext( context ); if( getLogger().isDebugEnabled() ) getLogger().debug( "AltrmiInterfaceLookup object created" ); return new AltrmiInterfaceLookupWrapper( factory ); } protected abstract AltrmiHostContext createHostContext() throws AltrmiConnectionException; public Class getCreatedClass() { return AltrmiInterfaceLookupWrapper.class; } public void decommission( Object object ) throws Exception { if( object instanceof AltrmiInterfaceLookupWrapper ) { ( ( AltrmiInterfaceLookupWrapper ) object ).dispose(); } } } 1.1 jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/subscriber/AbstractSubscriberImpl.java Index: AbstractSubscriberImpl.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.subscriber; import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.apache.avalon.framework.component.ComponentException; import org.apache.avalon.framework.component.ComponentManager; import org.apache.avalon.framework.component.Composable; import org.apache.avalon.framework.configuration.Configurable; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.logger.AbstractLogEnabled; import org.apache.excalibur.altrmi.client.AbstractSubscriber; import org.apache.excalibur.altrmi.client.AltrmiInterfaceLookup; import org.apache.excalibur.altrmi.client.AltrmiLookupSource; import org.apache.excalibur.altrmi.common.AltrmiAuthentication; import org.apache.excalibur.altrmi.common.AltrmiConnectionException; import org.apache.excalibur.altrmi.common.AltrmiInvocationException; /** * An abstract base class to be used in conjunction with AbstractSubscriber * * To use, create a subclass of AbstractSubscriber and this class, such as: * *
   * public interface MyRemoteInterfaceSubscriber extends AbstractSubscriber
   * {
   *     String ROLE = MyRemoteInterfaceSubscriber.class.getName();
   *
   *     MyRemoteInterface select( AltrmiAuthentication authentication )
   *         throws AltrmiConnectionException;
   * }
   *
   * public class MyRemoteInterfaceSubscriberImpl extends AbstractSubscriberImpl
   *     implements MyRemoteInterfaceSubscriber
   * {
   *
   *     public MyRemoteInterface select( AltrmiAuthentication authentication )
   *         throws AltrmiConnectionException
   *     {
   *          return ( MyRemoteInterface ) lookup( authentication );
   *     }
   * }
   * 
* * Alternatively, the MyRemoteInterfaceSubscriberImpl.select could be written as * *
   *     public MyRemoteInterface select( AltrmiAuthentication authentication )
   *     {
   *          try {
   *              return ( MyRemoteInterface ) lookup( authentication );
   *          }
   *          catch( AltrmiConnectionException e )
   *          {
   *              throw new CascadingRuntimeException( "Unable to select remote interface", e );
   *          }
   *     }
   * 
* * This class is Composable and expects to have a AltrmiLookupSource * available in its ComponentManager * * @author Peter Royal */ public abstract class AbstractSubscriberImpl extends AbstractLogEnabled implements Composable, Configurable, AbstractSubscriber { private int m_retryCount; private String m_publication; private AltrmiLookupSource m_lookupSource; private Map m_subscriptions = Collections.synchronizedMap( new HashMap() ); public void compose( ComponentManager componentManager ) throws ComponentException { m_lookupSource = ( AltrmiLookupSource ) componentManager.lookup( AltrmiLookupSource.ROLE ); } public void configure( Configuration configuration ) throws ConfigurationException { m_publication = configuration.getChild( "publication" ).getValue(); m_retryCount = configuration.getChild( "retry-count" ).getValueAsInteger( 10 ); } protected Object lookup( AltrmiAuthentication authentication ) throws AltrmiConnectionException { for( int i = 0; i < this.m_retryCount; i++ ) { AltrmiInterfaceLookup lookup = this.m_lookupSource.get(); try { Object dup; Object iface = lookup.lookup( this.m_publication, authentication ); if( getLogger().isDebugEnabled() ) getLogger().debug( "lookup [iface: " + iface + ", hash: " + iface.hashCode() + "]" ); if( ( dup = this.m_subscriptions.put( iface, lookup ) ) != null ) { getLogger().warn( "Duplicate subscription detected [iface: " + iface + ", dup: " + dup + ", hash: " + iface.hashCode() + ", class: " + iface.getClass().getName() + "]" ); } return iface; } catch( AltrmiInvocationException e ) { getLogger().error( "Exception looking up publication [pub: " + this.m_publication + "]", e ); lookup.close(); } } return null; } public void release( Object o ) { if( o != null ) { final AltrmiInterfaceLookup lookup = ( AltrmiInterfaceLookup ) this.m_subscriptions.remove( o ); if( lookup == null ) { throw new RuntimeException( "Object was never subscribed [object: " + o + "]" ); } else { lookup.close(); } } } } 1.1 jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/subscriber/AltrmiInterfaceLookupWrapper.java Index: AltrmiInterfaceLookupWrapper.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.subscriber; import org.apache.avalon.excalibur.pool.Pool; import org.apache.avalon.excalibur.pool.Poolable; import org.apache.avalon.framework.activity.Disposable; import org.apache.avalon.framework.logger.AbstractLogEnabled; import org.apache.excalibur.altrmi.client.AltrmiInterfaceLookup; import org.apache.excalibur.altrmi.common.AltrmiAuthentication; import org.apache.excalibur.altrmi.common.AltrmiConnectionException; import org.apache.excalibur.altrmi.common.AltrmiInvocationException; /** * The AbstractAltrmiInterfaceLookupFactory uses this class to wrap the * AltrmiInterfaceLookup objects it returns so they can be transparently pooled. * * An AltrmiInterfaceLookup is deemed broken if the lookup * operation returns an exception. Broken AltrmiInterfaceLookup instances will * be removed from the pool when returned. * * @author Peter Royal * @version $Revision: 1.1 $ */ public class AltrmiInterfaceLookupWrapper extends AbstractLogEnabled implements AltrmiInterfaceLookup, Poolable, Disposable { protected final AltrmiInterfaceLookup m_lookup; protected Pool m_pool; private boolean m_broken = false; /** * Private default constructor so that it cannot be instantiated any * other way than we desire. */ private AltrmiInterfaceLookupWrapper() { this.m_lookup = null; } /** * @param lookup AltrmiInterfaceLookup instance to wrap */ public AltrmiInterfaceLookupWrapper( final AltrmiInterfaceLookup lookup ) { this.m_lookup = lookup; } protected void setPool( Pool pool ) { this.m_pool = pool; } public boolean isBroken() { return this.m_broken; } public void close() { m_pool.put( this ); } public void dispose() { this.m_lookup.close(); } public Object lookup( String publishedServiceName ) throws AltrmiConnectionException { return this.m_lookup.lookup( publishedServiceName ); } public Object lookup( String publishedServiceName, AltrmiAuthentication altrmiAuthentication ) throws AltrmiConnectionException { try { return this.m_lookup.lookup( publishedServiceName, altrmiAuthentication ); } catch( AltrmiConnectionException e ) { this.m_broken = true; throw e; } catch( AltrmiInvocationException e ) { this.m_broken = true; throw e; } } public String[] list() { return this.m_lookup.list(); } public String getTextToSignForAuthentication() { return this.m_lookup.getTextToSignForAuthentication(); } } 1.1 jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/subscriber/AltrmiLookupPool.java Index: AltrmiLookupPool.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.subscriber; import org.apache.avalon.excalibur.pool.DefaultPoolController; import org.apache.avalon.excalibur.pool.Poolable; import org.apache.avalon.excalibur.pool.SoftResourceLimitingPool; import org.apache.avalon.framework.activity.Disposable; import org.apache.avalon.framework.activity.Initializable; /** * The Pool implementation for AltrmiInterfaceLookup's. * * @author Peter Royal * @author Berin Loritsch * @version CVS $Revision: 1.1 $ $Date: 2002/08/08 14:18:39 $ */ public class AltrmiLookupPool extends SoftResourceLimitingPool implements Disposable, Initializable { private boolean m_noConnections = false; public AltrmiLookupPool( final AbstractAltrmiInterfaceLookupFactory factory, final DefaultPoolController controller, final int min, final int max ) throws Exception { super( factory, controller, min, max ); } public void initialize() throws Exception { this.grow( this.m_min ); if( this.size() > 0 ) { m_initialized = true; } else { m_noConnections = true; } } protected final Poolable newPoolable() throws Exception { AltrmiInterfaceLookupWrapper wrapper = ( AltrmiInterfaceLookupWrapper ) super.newPoolable(); wrapper.setPool( this ); return wrapper; } public Poolable get() throws Exception { if( !m_initialized ) { if( m_noConnections ) { throw new IllegalStateException( "There are no connections in the pool, check your settings." ); } } AltrmiInterfaceLookupWrapper obj = ( AltrmiInterfaceLookupWrapper ) super.get(); if( obj.isBroken() ) { if( getLogger().isDebugEnabled() ) getLogger().debug( "AltrmiInterfaceLookup was broken, creating one to take its place" ); try { super.lock(); if( m_active.contains( obj ) ) { m_active.remove( obj ); } this.removePoolable( obj ); obj = ( AltrmiInterfaceLookupWrapper ) this.newPoolable(); m_active.add( obj ); } catch( Exception e ) { if( getLogger().isWarnEnabled() ) getLogger().warn( "Could not get an open connection", e ); throw e; } finally { super.unlock(); } } return obj; } } 1.1 jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/subscriber/CallbackEnabledCustomSocketStreamInterfaceLookupFactory.java Index: CallbackEnabledCustomSocketStreamInterfaceLookupFactory.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.subscriber; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.excalibur.altrmi.client.AltrmiHostContext; import org.apache.excalibur.altrmi.client.impl.callback.socket.CallbackEnabledSocketCustomStreamHostContext; import org.apache.excalibur.altrmi.common.AltrmiConnectionException; /** * Factory for CallbackEnabledSocketCustomStream transport * * @author Peter Royal * @version $Revision: 1.1 $ */ public class CallbackEnabledCustomSocketStreamInterfaceLookupFactory extends AbstractAltrmiInterfaceLookupFactory { private String m_host; private int m_port; public void configure( Configuration configuration ) throws ConfigurationException { super.configure( configuration ); m_port = configuration.getChild( "port" ).getValueAsInteger(); m_host = configuration.getChild( "host" ).getValue(); } protected AltrmiHostContext createHostContext() throws AltrmiConnectionException { return new CallbackEnabledSocketCustomStreamHostContext( m_host, m_port ); } } 1.1 jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/subscriber/ConnectionException.java Index: ConnectionException.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.subscriber; import org.apache.avalon.framework.CascadingRuntimeException; /** * Exception thrown for problems relating to the connection between client and server * * @author Peter Royal * @version CVS $Revision: 1.1 $ $Date: 2002/08/08 14:18:39 $ */ public class ConnectionException extends CascadingRuntimeException { public ConnectionException( final String message, final Throwable throwable ) { super( message, throwable ); } } 1.1 jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/subscriber/DefaultAltrmiLookupSource.java Index: DefaultAltrmiLookupSource.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.subscriber; import org.apache.avalon.excalibur.pool.DefaultPoolController; import org.apache.avalon.framework.activity.Disposable; import org.apache.avalon.framework.configuration.Configurable; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.logger.AbstractLogEnabled; import org.apache.avalon.framework.thread.ThreadSafe; import org.apache.excalibur.altrmi.client.AltrmiInterfaceLookup; import org.apache.excalibur.altrmi.client.AltrmiLookupSource; /** * The Default implementation of an AltrmiLookupSource. * *

* Configuration Example: *

   *  <altrmi-subscriber>
   *     <pool-controller min="3" max="50"/>
   *      <factory class="org.apache.excalibur.altrmi.client.impl.subscriber.SocketObjectStreamInterfaceLookupFactory">
   *          <proxyClassLocation>client</proxyClassLocation>
   *          <host>localhost</host>
   *          <port>1234</port>
   *      </factory>
   *  </altrmi-subscriber>
   * 
*

* Configuration Attributes: *

    *
  • The min attribute is used to set the minimum size of the AltrmiInterfaceLookup * pool. When first initialized, this number of connections will be automatically created and be * ready for use. (Defaults to "1")
  • * *
  • The max attribute is used to set the maximum number of connections which * will be opened. (Defaults to "3")
  • * *
  • The factory element is used to set the factory used to create * AltrmiInterfaceLookup instances. The class attribute contains * the name of the class to use. This configuration block is also passed to the factory * to configure it. *
  • *
* * @author Peter Royal * @author Berin Loritsch * @version CVS $Revision: 1.1 $ $Date: 2002/08/08 14:18:39 $ */ public class DefaultAltrmiLookupSource extends AbstractLogEnabled implements AltrmiLookupSource, Disposable, Configurable, ThreadSafe { protected AltrmiLookupPool m_pool; /** * Configure and set up DB connection. Here we set the connection * information needed to create the Connection objects. It must * be called only once. * * @param conf The Configuration object needed to describe the * connection. * * @throws ConfigurationException */ public void configure( final Configuration configuration ) throws ConfigurationException { if( null == m_pool ) { 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 int l_max; final int l_min; // Validate the min and max pool size values. if( min < 1 ) { if( getLogger().isWarnEnabled() ) { getLogger().warn( "Min number of connections specified must be at least 1." ); } l_min = 1; } else { l_min = min; } if( max < 1 ) { if( getLogger().isWarnEnabled() ) { getLogger().warn( "Max number of connections specified must be at least 1." ); } l_max = 1; } else { if( max < min ) { if( getLogger().isWarnEnabled() ) { getLogger().warn( "Maximum number of connections specified must be " + "more than the minimum number of connections." ); } l_max = min + 1; } else { l_max = max; } } try { final DefaultPoolController poolController = new DefaultPoolController( l_max / 4 ); final AbstractAltrmiInterfaceLookupFactory factory = createFactory( fconfig ); m_pool = new AltrmiLookupPool( factory, poolController, l_min, l_max ); m_pool.enableLogging( getLogger() ); m_pool.initialize(); } catch( Exception e ) { throw new ConfigurationException( "Error configuring AltrmiLookupSource", e ); } } } private AbstractAltrmiInterfaceLookupFactory createFactory( final Configuration fconfig ) throws Exception { final ClassLoader loader = Thread.currentThread().getContextClassLoader(); final String className = fconfig.getAttribute( "class" ); final AbstractAltrmiInterfaceLookupFactory factory = ( AbstractAltrmiInterfaceLookupFactory ) loader.loadClass(className).newInstance(); setupLogger( factory ); factory.configure( fconfig ); return factory; } /** Get the database connection */ public AltrmiInterfaceLookup get() { try { return ( AltrmiInterfaceLookup ) m_pool.get(); } catch( final Exception e ) { throw new ConnectionException( e.getMessage(), e ); } } /** Dispose properly of the pool */ public void dispose() { m_pool.dispose(); m_pool = null; } } 1.1 jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/subscriber/RmiInterfaceLookupFactory.java Index: RmiInterfaceLookupFactory.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.subscriber; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.excalibur.altrmi.client.AltrmiHostContext; import org.apache.excalibur.altrmi.client.impl.rmi.RmiHostContext; import org.apache.excalibur.altrmi.common.AltrmiConnectionException; /** * Factory for RMI transport * * @author Peter Royal * @version $Revision: 1.1 $ */ public class RmiInterfaceLookupFactory extends AbstractAltrmiInterfaceLookupFactory { private String m_host; private int m_port; public void configure( Configuration configuration ) throws ConfigurationException { super.configure( configuration ); m_port = configuration.getChild( "port" ).getValueAsInteger(); m_host = configuration.getChild( "host" ).getValue(); } protected AltrmiHostContext createHostContext() throws AltrmiConnectionException { return new RmiHostContext( m_host, m_port ); } } 1.1 jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/subscriber/SocketObjectStreamInterfaceLookupFactory.java Index: SocketObjectStreamInterfaceLookupFactory.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.subscriber; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.excalibur.altrmi.client.AltrmiHostContext; import org.apache.excalibur.altrmi.client.impl.socket.SocketObjectStreamHostContext; import org.apache.excalibur.altrmi.common.AltrmiConnectionException; /** * Factory for SocketObjectStream transport * * @author Peter Royal * @version $Revision: 1.1 $ */ public class SocketObjectStreamInterfaceLookupFactory extends AbstractAltrmiInterfaceLookupFactory { private String m_host; private int m_port; public void configure( Configuration configuration ) throws ConfigurationException { super.configure( configuration ); m_port = configuration.getChild( "port" ).getValueAsInteger(); m_host = configuration.getChild( "host" ).getValue(); } protected AltrmiHostContext createHostContext() throws AltrmiConnectionException { return new SocketObjectStreamHostContext( m_host, m_port ); } } 1.1 jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/AbstractSubscriber.java Index: AbstractSubscriber.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.avalon.framework.component.Component; /** * This interface is a weird beast. It is not intended to be used directly, rather * developers should create a subclass of this interface and provide a method such as * *
   *  YourRemoteInterface select( AltrmiAuthentication authentication );
   * 
* * Your subclassed interface can then be used in your application so application components * can lookup strongly-typed versions of the remote interfaces. * * @see AbstractSubscriberImpl * @author Peter Royal * @version $Revision: 1.1 $ */ public interface AbstractSubscriber extends Component { void release( Object subscriber ); } 1.1 jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/AltrmiLookupSource.java Index: AltrmiLookupSource.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.avalon.framework.component.Component; /** * The AltrmiLookupSource is a component that will return an * AltrmiInterfaceLookup. * * @see DefaultAltrmiLookupSource * @author Peter Royal * @version $Revision: 1.1 $ */ public interface AltrmiLookupSource extends Component { String ROLE = AltrmiLookupSource.class.getName(); /** * Get an AltrmiInterfaceLookup. * * @return an AltrmiInterfaceLookup */ AltrmiInterfaceLookup get(); } 1.29 +3 -1 jakarta-avalon-excalibur/altrmi/build.xml Index: build.xml =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/build.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- build.xml 8 Aug 2002 07:31:12 -0000 1.28 +++ build.xml 8 Aug 2002 14:18:39 -0000 1.29 @@ -13,6 +13,7 @@ + @@ -48,7 +49,8 @@ - + + For additional commands, e-mail: