avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/callback/socket CallbackEnabledSocketCustomStreamReadWriter.java CallbackEnabledSocketCustomStreamServer.java PartialCallbackEnabledSocketCustomStreamServer.java
Date Sun, 21 Apr 2002 12:19:34 GMT
hammant     02/04/21 05:19:33

  Modified:    altrmi/src/java/org/apache/excalibur/altrmi/client
                        ProxyHelper.java
               altrmi/src/java/org/apache/excalibur/altrmi/client/impl
                        AbstractAltrmiFactory.java
                        AbstractClientInvocationHandler.java
                        AbstractConnectionPinger.java
                        AbstractFactoryHelper.java AbstractHostContext.java
                        AbstractInterfaceLookupFactory.java
                        ClientClassAltrmiFactory.java
                        DefaultConnectionListener.java
                        DefaultConnectionPinger.java
                        DefaultInterfaceLookupFactory.java
                        DefaultProxyHelper.java
                        PerpetualConnectionPinger.java
                        ServerClassAltrmiFactory.java
                        TransportedClassLoader.java
               altrmi/src/java/org/apache/excalibur/altrmi/client/impl/callback/socket
                        CallbackEnabledSocketCustomStreamInvocationHandler.java
               altrmi/src/java/org/apache/excalibur/altrmi/client/impl/direct
                        AbstractDirectInvocationHandler.java
                        DirectHostContext.java DirectInvocationHandler.java
                        DirectMarshalledInvocationHandler.java
               altrmi/src/java/org/apache/excalibur/altrmi/client/impl/multiple
                        RotatingMultipleInvocationHandler.java
               altrmi/src/java/org/apache/excalibur/altrmi/client/impl/piped
                        AbstractPipedStreamInvocationHandler.java
               altrmi/src/java/org/apache/excalibur/altrmi/client/impl/rmi
                        RmiInvocationHandler.java
               altrmi/src/java/org/apache/excalibur/altrmi/client/impl/stream
                        StreamInvocationHandler.java
               altrmi/src/java/org/apache/excalibur/altrmi/common
                        AltrmiCallbackException.java
                        ClassRetrievalFailedReply.java
                        ExposedObjectProxy.java
               altrmi/src/java/org/apache/excalibur/altrmi/generator
                        ProxyGeneratorImpl.java
               altrmi/src/java/org/apache/excalibur/altrmi/javacompiler
                        JavaCompiler.java SunJavaCompiler.java
               altrmi/src/java/org/apache/excalibur/altrmi/server/impl
                        AbstractServer.java AltrmiSession.java
                        DefaultAuthenticator.java
                        ServerCustomStreamReadWriter.java
                        ServerObjectStreamReadWriter.java
                        ServerStreamReadWriter.java
                        StreamServerConnection.java
               altrmi/src/java/org/apache/excalibur/altrmi/server/impl/adapters
                        InvocationHandlerAdapter.java
               altrmi/src/java/org/apache/excalibur/altrmi/server/impl/callback/socket
                        CallbackEnabledSocketCustomStreamReadWriter.java
                        CallbackEnabledSocketCustomStreamServer.java
                        PartialCallbackEnabledSocketCustomStreamServer.java
  Log:
  Fix bracing and speed up argument fixing in
  
  Revision  Changes    Path
  1.3       +2 -2      jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/ProxyHelper.java
  
  Index: ProxyHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/ProxyHelper.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ProxyHelper.java	21 Apr 2002 09:42:01 -0000	1.2
  +++ ProxyHelper.java	21 Apr 2002 12:19:32 -0000	1.3
  @@ -16,7 +16,7 @@
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
    * @author Vinay Chandrasekharan <a href="mailto:vinay_chandran@users.sourceforge.net">vinay_chandran@users.sourceforge.net</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public interface ProxyHelper
   {
  @@ -50,7 +50,7 @@
        * @throws Throwable
        *
        */
  -    Object processObjectRequest(String methodSignature, Object[] args) throws Throwable;
  +    Object processObjectRequest(String methodSignature, Object[] args, Class[] argClasses) throws Throwable;
   
       /**
        * Method processVoidRequest
  
  
  
  1.4       +95 -43    jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractAltrmiFactory.java
  
  Index: AbstractAltrmiFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractAltrmiFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AbstractAltrmiFactory.java	18 Apr 2002 06:35:41 -0000	1.3
  +++ AbstractAltrmiFactory.java	21 Apr 2002 12:19:32 -0000	1.4
  @@ -30,6 +30,7 @@
   import java.util.Vector;
   
   import java.io.IOException;
  +
   import java.lang.ref.WeakReference;
   
   
  @@ -39,9 +40,10 @@
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
    * @author Peter Royal <a href="mailto:proyal@managingpartners.com">proyal@managingpartners.com</a>
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    */
  -public abstract class AbstractAltrmiFactory implements AltrmiFactory {
  +public abstract class AbstractAltrmiFactory implements AltrmiFactory
  +{
   
       protected AbstractHostContext mHostContext;
       protected final HashMap mRefObjs = new HashMap();
  @@ -49,16 +51,15 @@
       private transient String mTextToSign;
       protected Long mSession;
   
  -
       /**
        * Constructor AbstractAltrmiFactory
        *
        *
        * @param beanOnly
  -     * @param classLoader
        *
        */
  -    public AbstractAltrmiFactory(boolean beanOnly) {
  +    public AbstractAltrmiFactory(boolean beanOnly)
  +    {
           mBeanOnly = beanOnly;
       }
   
  @@ -69,7 +70,8 @@
        * @return
        *
        */
  -    public final boolean isBeanOnly() {
  +    public final boolean isBeanOnly()
  +    {
           return mBeanOnly;
       }
   
  @@ -82,9 +84,11 @@
        *
        *
        */
  -    public final void setHostContext(AltrmiHostContext hostContext) throws IOException {
  +    public final void setHostContext(AltrmiHostContext hostContext) throws IOException
  +    {
   
  -        if (mHostContext == null) {
  +        if (mHostContext == null)
  +        {
               mHostContext = (AbstractHostContext) hostContext;
           }
   
  @@ -93,10 +97,13 @@
           AltrmiReply ar =
               mHostContext.getInvocationHandler().handleInvocation(new OpenConnectionRequest());
   
  -        if (ar instanceof OpenConnectionReply) {
  +        if (ar instanceof OpenConnectionReply)
  +        {
               mTextToSign = ((OpenConnectionReply) ar).getTextToSign();
               mSession = ((OpenConnectionReply) ar).getSession();
  -        } else {
  +        }
  +        else
  +        {
   
               //TODO
           }
  @@ -115,55 +122,76 @@
        *
        */
       public Object lookup(String publishedServiceName, AltrmiAuthentication altrmiAuthentication)
  -            throws AltrmiConnectionException {
  +            throws AltrmiConnectionException
  +    {
   
           AltrmiReply ar =
               mHostContext.getInvocationHandler()
  -                .handleInvocation(new LookupRequest(publishedServiceName, altrmiAuthentication, mSession));
  +                .handleInvocation(new LookupRequest(publishedServiceName, altrmiAuthentication,
  +                                                    mSession));
   
  -        if (ar.getReplyCode() >= AltrmiReply.PROBLEMREPLY) {
  -            if (ar instanceof NotPublishedReply) {
  +        if (ar.getReplyCode() >= AltrmiReply.PROBLEMREPLY)
  +        {
  +            if (ar instanceof NotPublishedReply)
  +            {
                   throw new AltrmiConnectionException("Service " + publishedServiceName
                                                       + " not published");
  -            } else if (ar instanceof ExceptionReply) {
  +            }
  +            else if (ar instanceof ExceptionReply)
  +            {
                   ExceptionReply er = (ExceptionReply) ar;
   
                   throw (AltrmiConnectionException) er.getReplyException();
  -            } else {
  +            }
  +            else
  +            {
                   throw new AltrmiConnectionException("Problem doing lookup on service");
               }
  -        } else if (ar instanceof ExceptionReply) {
  +        }
  +        else if (ar instanceof ExceptionReply)
  +        {
               ExceptionReply er = (ExceptionReply) ar;
               Throwable t = er.getReplyException();
   
  -            if (t instanceof AltrmiConnectionException) {
  +            if (t instanceof AltrmiConnectionException)
  +            {
                   throw (AltrmiConnectionException) t;
  -            } else if (t instanceof Error) {
  +            }
  +            else if (t instanceof Error)
  +            {
                   throw (Error) t;
  -            } else if (t instanceof RuntimeException) {
  +            }
  +            else if (t instanceof RuntimeException)
  +            {
                   throw (RuntimeException) t;
  -            } else {
  +            }
  +            else
  +            {
                   throw new AltrmiConnectionException("Problem doing lookup on service [exception: "
                                                       + t.getMessage() + "]");
               }
  -        } else if (!(ar instanceof LookupReply)) {
  -            throw new UnsupportedOperationException("Unexpected reply to lookup [reply: " + ar + "]");
  +        }
  +        else if (!(ar instanceof LookupReply))
  +        {
  +            throw new UnsupportedOperationException("Unexpected reply to lookup [reply: " + ar
  +                                                    + "]");
           }
   
           LookupReply lr = (LookupReply) ar;
           DefaultProxyHelper baseObj = new DefaultProxyHelper(this,
  -                                                        mHostContext.getInvocationHandler(),
  -                                                        publishedServiceName, "Main",
  -                                                        lr.getReferenceID(), mSession);
  +                                                            mHostContext.getInvocationHandler(),
  +                                                            publishedServiceName, "Main",
  +                                                            lr.getReferenceID(), mSession);
           Object retVal = getInstance(publishedServiceName, "Main", baseObj, isBeanOnly());
   
           baseObj.registerImplObject(retVal);
   
           return retVal;
  -     }
  -
  +    }
   
  -    protected abstract Class getFacadeClass(String publishedServiceName, String objectName, boolean beanOnly) throws AltrmiConnectionException, ClassNotFoundException;
  +    protected abstract Class getFacadeClass(
  +        String publishedServiceName, String objectName, boolean beanOnly)
  +            throws AltrmiConnectionException, ClassNotFoundException;
   
       protected abstract Object getInstance(
           String publishedServiceName, String objectName, DefaultProxyHelper proxyHelper,
  @@ -180,10 +208,14 @@
        *
        *
        */
  -    public final void registerReferenceObject(Object obj, Long referenceID) {
  -        synchronized(this) {
  +    public final void registerReferenceObject(Object obj, Long referenceID)
  +    {
  +
  +        synchronized (this)
  +        {
               mRefObjs.put(referenceID, new WeakReference(obj));
           }
  +
           //Object o = mRefObjs.get(referenceID);
       }
   
  @@ -196,7 +228,8 @@
        * @return
        *
        */
  -    public final Long getReferenceID(AltrmiProxy obj) {
  +    public final Long getReferenceID(AltrmiProxy obj)
  +    {
           return obj.altrmiGetReferenceID(this);
       }
   
  @@ -209,20 +242,31 @@
        * @return
        *
        */
  -    public final Object getImplObj(Long referenceID) {
  +    public final Object getImplObj(Long referenceID)
  +    {
  +
           WeakReference wr = null;
  -        synchronized(this) {
  -             wr = (WeakReference) mRefObjs.get(referenceID);
  +
  +        synchronized (this)
  +        {
  +            wr = (WeakReference) mRefObjs.get(referenceID);
           }
  -        if (wr == null) {
  +
  +        if (wr == null)
  +        {
               return null;
           }
  +
           //System.out.println("size = " + mRefObjs.size());
           Object obj = wr.get();
  -        if (obj == null) {
  +
  +        if (obj == null)
  +        {
  +
               //System.out.println(" none for " + referenceID);
               mRefObjs.remove(referenceID);
           }
  +
           return obj;
       }
   
  @@ -237,7 +281,8 @@
        * @throws AltrmiConnectionException
        *
        */
  -    public final Object lookup(String publishedServiceName) throws AltrmiConnectionException {
  +    public final Object lookup(String publishedServiceName) throws AltrmiConnectionException
  +    {
           return lookup(publishedServiceName, null);
       }
   
  @@ -248,21 +293,28 @@
        * @return
        *
        */
  -    public String getTextToSignForAuthentication() {
  +    public String getTextToSignForAuthentication()
  +    {
           return mTextToSign;
       }
   
       /**
        *  Method list
        */
  -    public String[] list() {
  +    public String[] list()
  +    {
   
           AltrmiReply ar = mHostContext.getInvocationHandler().handleInvocation(new ListRequest());
   
  -        if (ar instanceof ListReply) {
  +        if (ar instanceof ListReply)
  +        {
               return ((ListReply) ar).getListOfPublishedObjects();
  -        } else {
  -            return new String[]{};
  +        }
  +        else
  +        {
  +            return new String[]
  +            {
  +            };
           }
       }
   }
  
  
  
  1.2       +50 -12    jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractClientInvocationHandler.java
  
  Index: AbstractClientInvocationHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractClientInvocationHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractClientInvocationHandler.java	3 Apr 2002 11:29:50 -0000	1.1
  +++ AbstractClientInvocationHandler.java	21 Apr 2002 12:19:32 -0000	1.2
  @@ -26,14 +26,16 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
  -public abstract class AbstractClientInvocationHandler implements AltrmiInvocationHandler, AltrmiClientInvocationHandler {
  +public abstract class AbstractClientInvocationHandler
  +        implements AltrmiInvocationHandler, AltrmiClientInvocationHandler
  +{
   
       protected AltrmiConnectionPinger mConnectionPinger;
       protected AltrmiConnectionListener mAltrmiConnectionListener =
           new DefaultConnectionListener();
  -    protected boolean mStopped =false;
  +    protected boolean mStopped = false;
   
       /**
        * Method setAltrmiConnectionListener
  @@ -42,32 +44,59 @@
        * @param altrmiConnectionListener
        *
        */
  -    public void setAltrmiConnectionListener(AltrmiConnectionListener altrmiConnectionListener) {
  +    public void setAltrmiConnectionListener(AltrmiConnectionListener altrmiConnectionListener)
  +    {
           mAltrmiConnectionListener = altrmiConnectionListener;
       }
   
  -    public void initialize() throws IOException {
  +    /**
  +     * Method initialize
  +     *
  +     *
  +     * @throws IOException
  +     *
  +     */
  +    public void initialize() throws IOException
  +    {
   
  -        if (mConnectionPinger == null) {
  +        if (mConnectionPinger == null)
  +        {
               mConnectionPinger = new DefaultConnectionPinger();
           }
  +
           mConnectionPinger.setAltrmiInvocationHandler(this);
           mConnectionPinger.start();
       }
   
  -    public void close() {
  +    /**
  +     * Method close
  +     *
  +     *
  +     */
  +    public void close()
  +    {
  +
           mConnectionPinger.stop();
  +
           mStopped = true;
       }
   
  -    public void ping() {
  -        if (mStopped) {
  +    /**
  +     * Method ping
  +     *
  +     *
  +     */
  +    public void ping()
  +    {
  +
  +        if (mStopped)
  +        {
               throw new AltrmiConnectionClosedException("Connection closed");
           }
  +
           AltrmiReply ar = handleInvocation(new PingRequest());
       }
   
  -
       protected abstract boolean tryReconnect();
   
       /**
  @@ -77,11 +106,20 @@
        * @param connectionPinger
        *
        */
  -    public void setConnectionPinger(AltrmiConnectionPinger connectionPinger) {
  +    public void setConnectionPinger(AltrmiConnectionPinger connectionPinger)
  +    {
           mConnectionPinger = connectionPinger;
       }
   
  -    public ClassLoader getInterfacesClassLoader() {
  +    /**
  +     * Method getInterfacesClassLoader
  +     *
  +     *
  +     * @return
  +     *
  +     */
  +    public ClassLoader getInterfacesClassLoader()
  +    {
           return AbstractClientInvocationHandler.class.getClassLoader();
       }
   }
  
  
  
  1.2       +24 -13    jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractConnectionPinger.java
  
  Index: AbstractConnectionPinger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractConnectionPinger.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractConnectionPinger.java	3 Apr 2002 11:29:50 -0000	1.1
  +++ AbstractConnectionPinger.java	21 Apr 2002 12:19:32 -0000	1.2
  @@ -22,9 +22,10 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version * $Revision: 1.1 $
  + * @version * $Revision: 1.2 $
    */
  -public abstract class AbstractConnectionPinger implements AltrmiConnectionPinger, Runnable {
  +public abstract class AbstractConnectionPinger implements AltrmiConnectionPinger, Runnable
  +{
   
       protected AltrmiClientInvocationHandler mAltrmiInvocationHandler;
       protected boolean mContinue = true;
  @@ -40,7 +41,8 @@
        * @param giveupIntervalSeconds
        *
        */
  -    public AbstractConnectionPinger(int pingIntervalSeconds, int giveupIntervalSeconds) {
  +    public AbstractConnectionPinger(int pingIntervalSeconds, int giveupIntervalSeconds)
  +    {
           mPingInterval = pingIntervalSeconds * 1000;
           mGiveupInterval = giveupIntervalSeconds * 1000;
       }
  @@ -50,7 +52,8 @@
        *
        *
        */
  -    public AbstractConnectionPinger() {
  +    public AbstractConnectionPinger()
  +    {
           mPingInterval = 10 * 1000;       // ten seconds
           mGiveupInterval = 100 * 1000;    // one hundred seconds.
       }
  @@ -61,8 +64,8 @@
        *
        *
        */
  -    public void setAltrmiInvocationHandler(
  -            AltrmiClientInvocationHandler altrmiInvocationHandler) {
  +    public void setAltrmiInvocationHandler(AltrmiClientInvocationHandler altrmiInvocationHandler)
  +    {
           mAltrmiInvocationHandler = altrmiInvocationHandler;
       }
   
  @@ -71,7 +74,8 @@
        *
        *
        */
  -    public void start() {
  +    public void start()
  +    {
   
           mThread = new Thread(this);
   
  @@ -83,8 +87,8 @@
        *
        *
        */
  -    public void stop() {
  -
  +    public void stop()
  +    {
           mContinue = false;
       }
   
  @@ -93,18 +97,25 @@
        *
        *
        */
  -    public void run() {
  +    public void run()
  +    {
   
  -        try {
  -            while (mContinue) {
  +        try
  +        {
  +            while (mContinue)
  +            {
                   Thread.sleep(mPingInterval);
                   ping();
               }
  -        } catch (AltrmiConnectionClosedException cce) {
  +        }
  +        catch (AltrmiConnectionClosedException cce)
  +        {
               System.out.println("Pinger Connection closed");
   
               // no need to ping anymore.
  -        } catch (InterruptedException e) {
  +        }
  +        catch (InterruptedException e)
  +        {
               System.out.println("Pinger Interrupted!");
   
               // do nothing.
  
  
  
  1.2       +19 -9     jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractFactoryHelper.java
  
  Index: AbstractFactoryHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractFactoryHelper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractFactoryHelper.java	3 Apr 2002 11:29:50 -0000	1.1
  +++ AbstractFactoryHelper.java	21 Apr 2002 12:19:32 -0000	1.2
  @@ -24,16 +24,19 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
  -public abstract class AbstractFactoryHelper implements AltrmiInterfaceLookupFactory {
  +public abstract class AbstractFactoryHelper implements AltrmiInterfaceLookupFactory
  +{
   
  -    protected String[] processFactoryString(String factoryString) {
  +    protected String[] processFactoryString(String factoryString)
  +    {
   
           Vector terms = new Vector();
           StringTokenizer st = new StringTokenizer(factoryString, ":");
   
  -        while (st.hasMoreTokens()) {
  +        while (st.hasMoreTokens())
  +        {
               terms.add(st.nextToken());
           }
   
  @@ -44,13 +47,19 @@
           return retval;
       }
   
  -    protected AltrmiFactory createAltrmiFactory(String type, boolean beanOnly) {
  +    protected AltrmiFactory createAltrmiFactory(String type, boolean beanOnly)
  +    {
   
  -        if (type.equalsIgnoreCase("s")) {
  +        if (type.equalsIgnoreCase("s"))
  +        {
               return new ServerClassAltrmiFactory(beanOnly);
  -        } else if (type.equalsIgnoreCase("c")) {
  +        }
  +        else if (type.equalsIgnoreCase("c"))
  +        {
               return new ClientClassAltrmiFactory(beanOnly);
  -        } else {
  +        }
  +        else
  +        {
               return null;
           }
       }
  @@ -67,7 +76,8 @@
        *
        */
       public final AltrmiInterfaceLookup getAltrmiInterfaceLookup(String factoryString)
  -            throws AltrmiConnectionException {
  +            throws AltrmiConnectionException
  +    {
           return getAltrmiInterfaceLookup(factoryString, this.getClass().getClassLoader());
       }
   }
  
  
  
  1.2       +9 -7      jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractHostContext.java
  
  Index: AbstractHostContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractHostContext.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractHostContext.java	3 Apr 2002 11:29:50 -0000	1.1
  +++ AbstractHostContext.java	21 Apr 2002 12:19:32 -0000	1.2
  @@ -21,9 +21,10 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
  -public abstract class AbstractHostContext implements AltrmiHostContext {
  +public abstract class AbstractHostContext implements AltrmiHostContext
  +{
   
       protected final AltrmiClientInvocationHandler mAltrmiClientInvocationHandler;
   
  @@ -35,8 +36,8 @@
        * @param altrmiClientInvocationHandler
        *
        */
  -    public AbstractHostContext(
  -            AltrmiClientInvocationHandler altrmiClientInvocationHandler) {
  +    public AbstractHostContext(AltrmiClientInvocationHandler altrmiClientInvocationHandler)
  +    {
           mAltrmiClientInvocationHandler = altrmiClientInvocationHandler;
       }
   
  @@ -47,7 +48,8 @@
        * @return
        *
        */
  -    public AltrmiClientInvocationHandler getInvocationHandler() {
  +    public AltrmiClientInvocationHandler getInvocationHandler()
  +    {
           return mAltrmiClientInvocationHandler;
       }
   
  @@ -59,8 +61,8 @@
        * @param altrmiConnectionListener
        *
        */
  -    public void setAltrmiConnectionListener(AltrmiConnectionListener altrmiConnectionListener) {
  +    public void setAltrmiConnectionListener(AltrmiConnectionListener altrmiConnectionListener)
  +    {
           mAltrmiClientInvocationHandler.setAltrmiConnectionListener(altrmiConnectionListener);
       }
  -
   }
  
  
  
  1.2       +32 -10    jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractInterfaceLookupFactory.java
  
  Index: AbstractInterfaceLookupFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/AbstractInterfaceLookupFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractInterfaceLookupFactory.java	3 Apr 2002 11:29:50 -0000	1.1
  +++ AbstractInterfaceLookupFactory.java	21 Apr 2002 12:19:32 -0000	1.2
  @@ -22,13 +22,15 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
  -public class AbstractInterfaceLookupFactory implements AltrmiInterfaceLookupFactory {
  +public class AbstractInterfaceLookupFactory implements AltrmiInterfaceLookupFactory
  +{
   
       private Vector factories = new Vector();
   
  -    protected void addFactory(String factoryStringPrefix, AltrmiInterfaceLookupFactory factory) {
  +    protected void addFactory(String factoryStringPrefix, AltrmiInterfaceLookupFactory factory)
  +    {
           factories.add(new Factory(factoryStringPrefix, factory));
       }
   
  @@ -44,16 +46,34 @@
        *
        */
       public final AltrmiInterfaceLookup getAltrmiInterfaceLookup(String factoryString)
  -            throws AltrmiConnectionException {
  +            throws AltrmiConnectionException
  +    {
           return getAltrmiInterfaceLookup(factoryString, this.getClass().getClassLoader());
       }
   
  +    /**
  +     * Method getAltrmiInterfaceLookup
  +     *
  +     *
  +     * @param factoryString
  +     * @param interfacesClassLoader
  +     *
  +     * @return
  +     *
  +     * @throws AltrmiConnectionException
  +     *
  +     */
       public AltrmiInterfaceLookup getAltrmiInterfaceLookup(
  -            String factoryString, ClassLoader interfacesClassLoader) throws AltrmiConnectionException {
  -        for (int i = 0; i < factories.size(); i++) {
  +            String factoryString, ClassLoader interfacesClassLoader)
  +                throws AltrmiConnectionException
  +    {
  +
  +        for (int i = 0; i < factories.size(); i++)
  +        {
               Factory factory = (Factory) factories.elementAt(i);
   
  -            if (factoryString.startsWith(factory.factoryStringPrefix)) {
  +            if (factoryString.startsWith(factory.factoryStringPrefix))
  +            {
                   return factory.altrmiInterfaceLookupFactory
                       .getAltrmiInterfaceLookup(factoryString, interfacesClassLoader);
               }
  @@ -67,9 +87,10 @@
        *
        *
        * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  -     * @version $Revision: 1.1 $
  +     * @version $Revision: 1.2 $
        */
  -    private class Factory {
  +    private class Factory
  +    {
   
           private String factoryStringPrefix;
           private AltrmiInterfaceLookupFactory altrmiInterfaceLookupFactory;
  @@ -83,7 +104,8 @@
            *
            */
           public Factory(String factoryStringPrefix,
  -                       AltrmiInterfaceLookupFactory altrmiInterfaceLookupFactory) {
  +                       AltrmiInterfaceLookupFactory altrmiInterfaceLookupFactory)
  +        {
               this.factoryStringPrefix = factoryStringPrefix;
               this.altrmiInterfaceLookupFactory = altrmiInterfaceLookupFactory;
           }
  
  
  
  1.4       +34 -21    jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/ClientClassAltrmiFactory.java
  
  Index: ClientClassAltrmiFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/ClientClassAltrmiFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ClientClassAltrmiFactory.java	18 Apr 2002 06:35:41 -0000	1.3
  +++ ClientClassAltrmiFactory.java	21 Apr 2002 12:19:32 -0000	1.4
  @@ -8,6 +8,8 @@
    */
   package org.apache.excalibur.altrmi.client.impl;
   
  +
  +
   import org.apache.excalibur.altrmi.common.AltrmiConnectionException;
   
   import java.lang.reflect.InvocationTargetException;
  @@ -19,9 +21,10 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    */
  -public class ClientClassAltrmiFactory extends AbstractAltrmiFactory {
  +public class ClientClassAltrmiFactory extends AbstractAltrmiFactory
  +{
   
       /**
        * Constructor ClientClassAltrmiFactory
  @@ -30,23 +33,25 @@
        * @param beanOnly
        *
        */
  -    public ClientClassAltrmiFactory(boolean beanOnly) {
  +    public ClientClassAltrmiFactory(boolean beanOnly)
  +    {
           super(beanOnly);
       }
   
  -//    public ClientClassAltrmiFactory(boolean beanOnly, ClassLoader classLoader) {
  -  //      super(beanOnly, classLoader);
  -    //}
   
  -    protected Class getFacadeClass(String publishedServiceName, String objectName, boolean beanOnly) throws AltrmiConnectionException, ClassNotFoundException {
  +    protected Class getFacadeClass(
  +            String publishedServiceName, String objectName, boolean beanOnly)
  +                throws AltrmiConnectionException, ClassNotFoundException
  +    {
  +
           String code = "2";
   
  -        if (beanOnly) {
  +        if (beanOnly)
  +        {
               code = "";
           }
   
  -        return Class.forName("AltrmiGenerated" + code + publishedServiceName + "_"
  -                                        + objectName);
  +        return Class.forName("AltrmiGenerated" + code + publishedServiceName + "_" + objectName);
       }
   
       /**
  @@ -62,28 +67,35 @@
        *
        */
       protected Object getInstance(
  -            String publishedServiceName, String objectName, DefaultProxyHelper proxyHelper,
  -            boolean beanOnly)
  -                throws AltrmiConnectionException {
  -
  -
  +            String publishedServiceName, String objectName, DefaultProxyHelper proxyHelper, boolean beanOnly)
  +                throws AltrmiConnectionException
  +    {
   
  -        try {
  +        try
  +        {
               Class clazz = getFacadeClass(publishedServiceName, objectName, beanOnly);
               Constructor[] constructors = clazz.getConstructors();
               Object retVal = constructors[0].newInstance(new Object[]{ proxyHelper });
   
               return retVal;
  -        } catch (InvocationTargetException ite) {
  +        }
  +        catch (InvocationTargetException ite)
  +        {
               throw new AltrmiConnectionException("Generated class not instantiated : "
                                                   + ite.getTargetException().getMessage());
  -        } catch (ClassNotFoundException cnfe) {
  +        }
  +        catch (ClassNotFoundException cnfe)
  +        {
               throw new AltrmiConnectionException("Generated class not found during lookup : "
                                                   + cnfe.getMessage());
  -        } catch (InstantiationException ie) {
  +        }
  +        catch (InstantiationException ie)
  +        {
               throw new AltrmiConnectionException(
                   "Generated class not instantiable during lookup : " + ie.getMessage());
  -        } catch (IllegalAccessException iae) {
  +        }
  +        catch (IllegalAccessException iae)
  +        {
               throw new AltrmiConnectionException(
                   "Illegal access to generated class during lookup : " + iae.getMessage());
           }
  @@ -94,7 +106,8 @@
        *
        *
        */
  -    public void close() {
  +    public void close()
  +    {
           mHostContext.getInvocationHandler().close();
       }
   }
  
  
  
  1.2       +27 -12    jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DefaultConnectionListener.java
  
  Index: DefaultConnectionListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DefaultConnectionListener.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultConnectionListener.java	3 Apr 2002 11:29:50 -0000	1.1
  +++ DefaultConnectionListener.java	21 Apr 2002 12:19:32 -0000	1.2
  @@ -21,9 +21,10 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version * $Revision: 1.1 $
  + * @version * $Revision: 1.2 $
    */
  -public class DefaultConnectionListener implements AltrmiConnectionListener {
  +public class DefaultConnectionListener implements AltrmiConnectionListener
  +{
   
       /**
        * Method methodCalled
  @@ -34,7 +35,9 @@
        * @param duration
        *
        */
  -    public void methodCalled(final String methodSignature, final long duration) {
  +    public void methodCalled(final String methodSignature, final long duration)
  +    {
  +
           // do mothing in default impl, could do logging.
       }
   
  @@ -45,7 +48,8 @@
        * @return
        *
        */
  -    public boolean methodLogging() {
  +    public boolean methodLogging()
  +    {
           return true;
       }
   
  @@ -60,10 +64,12 @@
        *
        */
       public void serviceSuspended(final AltrmiRequest altrmiRequest, final int attempt,
  -                                 final int suggestedWaitMillis) {
  +                                 final int suggestedWaitMillis)
  +    {
   
           // Lets say that ten retries is too many.
  -        if (attempt == 10) {
  +        if (attempt == 10)
  +        {
               throw new AltrmiInvocationException("Too many retries on suspended service");
           }
   
  @@ -71,10 +77,14 @@
                              + ", waiting for " + suggestedWaitMillis / 1000 + " seconds)");
   
           // We are quite happy with the recommended wait time.
  -        try {
  +        try
  +        {
               Thread.sleep(suggestedWaitMillis);
  -        } catch (InterruptedException ie) {
  +        }
  +        catch (InterruptedException ie)
  +        {
               System.out.println("InterruptedException in Listener " + ie.getMessage());
  +
               // TODO ?
           }
       }
  @@ -87,10 +97,12 @@
        * @param attempt
        *
        */
  -    public void serviceAbend(int attempt) {
  +    public void serviceAbend(int attempt)
  +    {
   
           // Lets say that ten retries is too many.
  -        if (attempt == 3) {
  +        if (attempt == 3)
  +        {
               throw new AltrmiInvocationException("Too many retries on abended service");
           }
   
  @@ -98,9 +110,12 @@
                              + attempt + ")");
   
           // Increasing wait time.
  -        try {
  +        try
  +        {
               Thread.sleep((2 ^ attempt) * 500);
  -        } catch (InterruptedException ie) {
  +        }
  +        catch (InterruptedException ie)
  +        {
               System.out.println("InterruptedException in Listener " + ie.getMessage());
   
               // TODO ?
  
  
  
  1.2       +28 -8     jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DefaultConnectionPinger.java
  
  Index: DefaultConnectionPinger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DefaultConnectionPinger.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultConnectionPinger.java	3 Apr 2002 11:29:50 -0000	1.1
  +++ DefaultConnectionPinger.java	21 Apr 2002 12:19:32 -0000	1.2
  @@ -22,25 +22,45 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version * $Revision: 1.1 $
  + * @version * $Revision: 1.2 $
    */
  -public class DefaultConnectionPinger extends AbstractConnectionPinger {
  +public class DefaultConnectionPinger extends AbstractConnectionPinger
  +{
   
  -    public DefaultConnectionPinger(int pingIntervalSeconds, int giveupIntervalSeconds) {
  +    /**
  +     * Constructor DefaultConnectionPinger
  +     *
  +     *
  +     * @param pingIntervalSeconds
  +     * @param giveupIntervalSeconds
  +     *
  +     */
  +    public DefaultConnectionPinger(int pingIntervalSeconds, int giveupIntervalSeconds)
  +    {
           super(pingIntervalSeconds, giveupIntervalSeconds);
       }
   
  -    public DefaultConnectionPinger() {
  +    /**
  +     * Constructor DefaultConnectionPinger
  +     *
  +     *
  +     */
  +    public DefaultConnectionPinger()
  +    {
       }
   
  -    protected void ping() {
  +    protected void ping()
  +    {
  +
           if (mAltrmiInvocationHandler.getLastRealRequest()
  -                > (System.currentTimeMillis() - (mGiveupInterval))) {
  +                > (System.currentTimeMillis() - (mGiveupInterval)))
  +        {
               mAltrmiInvocationHandler.ping();
  -        } else {
  +        }
  +        else
  +        {
   
               //TODO should be restartable after reconnect of socket.
  -
               mContinue = false;
   
               // if more than 100 seconds since last request, stop pinging
  
  
  
  1.2       +39 -25    jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DefaultInterfaceLookupFactory.java
  
  Index: DefaultInterfaceLookupFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DefaultInterfaceLookupFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultInterfaceLookupFactory.java	3 Apr 2002 11:29:50 -0000	1.1
  +++ DefaultInterfaceLookupFactory.java	21 Apr 2002 12:19:32 -0000	1.2
  @@ -8,6 +8,8 @@
    */
   package org.apache.excalibur.altrmi.client.impl;
   
  +
  +
   import org.apache.excalibur.altrmi.client.AltrmiInterfaceLookupFactory;
   
   
  @@ -16,43 +18,55 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
  -public class DefaultInterfaceLookupFactory extends AbstractInterfaceLookupFactory {
  -
  -    public static final String[] SUPPORTEDSTREAMS = new String[] {
  -        "SocketObjectStream",
  -        "SocketCustomStream",
  -        "RMI"
  -    };
  -
  +public class DefaultInterfaceLookupFactory extends AbstractInterfaceLookupFactory
  +{
   
  +    public static final String[] SUPPORTEDSTREAMS = new String[]{ "SocketObjectStream",
  +                                                                  "SocketCustomStream", "RMI" };
   
       /**
        * Constructor DefaultInterfaceLookupFactory
        *
        *
        */
  -    public DefaultInterfaceLookupFactory() {
  +    public DefaultInterfaceLookupFactory()
  +    {
   
  -        try {
  -            addFactory("SocketObjectStream:", (AltrmiInterfaceLookupFactory) Class.forName("org.apache.excalibur.altrmi.client.impl.socket.SocketObjectStreamFactoryHelper").newInstance());
  -        } catch (ClassNotFoundException cnfe) {
  -        } catch (InstantiationException ie) {
  -        } catch (IllegalAccessException iae) {
  +        try
  +        {
  +            addFactory(
  +                "SocketObjectStream:",
  +                (AltrmiInterfaceLookupFactory) Class.forName(
  +                    "org.apache.excalibur.altrmi.client.impl.socket.SocketObjectStreamFactoryHelper")
  +                        .newInstance());
           }
  -        try {
  -            addFactory("SocketCustomStream:", (AltrmiInterfaceLookupFactory) Class.forName("org.apache.excalibur.altrmi.client.impl.socket.SocketCustomStreamFactoryHelper").newInstance());
  -        } catch (ClassNotFoundException cnfe) {
  -        } catch (InstantiationException ie) {
  -        } catch (IllegalAccessException iae) {
  +        catch (ClassNotFoundException cnfe){}
  +        catch (InstantiationException ie){}
  +        catch (IllegalAccessException iae){}
  +
  +        try
  +        {
  +            addFactory(
  +                "SocketCustomStream:",
  +                (AltrmiInterfaceLookupFactory) Class.forName(
  +                    "org.apache.excalibur.altrmi.client.impl.socket.SocketCustomStreamFactoryHelper")
  +                        .newInstance());
           }
  -        try {
  -            addFactory("RMI:", (AltrmiInterfaceLookupFactory) Class.forName("org.apache.excalibur.altrmi.client.impl.rmi.RmiFactoryHelper").newInstance());
  -        } catch (ClassNotFoundException cnfe) {
  -        } catch (InstantiationException ie) {
  -        } catch (IllegalAccessException iae) {
  +        catch (ClassNotFoundException cnfe){}
  +        catch (InstantiationException ie){}
  +        catch (IllegalAccessException iae){}
  +
  +        try
  +        {
  +            addFactory("RMI:", (AltrmiInterfaceLookupFactory) Class
  +                .forName("org.apache.excalibur.altrmi.client.impl.rmi.RmiFactoryHelper")
  +                    .newInstance());
           }
  +        catch (ClassNotFoundException cnfe){}
  +        catch (InstantiationException ie){}
  +        catch (IllegalAccessException iae){}
   
           // TODO - add the rest.
       }
  
  
  
  1.6       +10 -26    jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DefaultProxyHelper.java
  
  Index: DefaultProxyHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DefaultProxyHelper.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DefaultProxyHelper.java	21 Apr 2002 09:42:01 -0000	1.5
  +++ DefaultProxyHelper.java	21 Apr 2002 12:19:32 -0000	1.6
  @@ -44,7 +44,7 @@
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
    * @author Vinay Chandrasekharan <a href="mailto:vinay_chandran@users.sourceforge.net">vinay_chandran@users.sourceforge.net</a>
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
    */
   public final class DefaultProxyHelper implements ProxyHelper
   {
  @@ -261,10 +261,10 @@
        * @throws Throwable
        *
        */
  -    public Object processObjectRequest(String methodSignature, Object[] args) throws Throwable
  +    public Object processObjectRequest(String methodSignature, Object[] args, Class[] argClasses) throws Throwable
       {
   
  -        marshallCorrection(methodSignature, args);
  +        marshallCorrection(methodSignature, args, argClasses);
   
           MethodRequest request = new MethodRequest(mPublishedServiceName, mObjectName,
                                                     methodSignature, args, mReferenceID, mSession);
  @@ -389,32 +389,16 @@
           }
       }
   
  -    private void marshallCorrection(String methodSignature, Object[] args)
  +    private void marshallCorrection(String methodSignature, Object[] args, Class[] argClasses)
       {
   
  -        String _methodArgumentClasses =
  -            methodSignature.substring(methodSignature.indexOf("(") + 1,
  -                                      methodSignature.lastIndexOf(")"));
  -        StringTokenizer _methodArgumentClassTokens = new StringTokenizer(_methodArgumentClasses,
  -                                                         ",");
  -
           for (int i = 0; i < args.length; i++)
           {
  -            String _sArgClass = _methodArgumentClassTokens.nextToken().trim();
  -            Class _cArgClass = null;
  -
  -            try
  -            {
  -                _cArgClass = Class.forName(_sArgClass);
  -            }
  -            catch (ClassNotFoundException cnfe)
  -            {
  -                System.err.println("Class " + _sArgClass + " Not Found");
  -            }
  +            Class argClass = argClasses[i];
   
               //check whether its one of those remote ref that we got from the server
               //TODO : todo
  -            if (args[i] instanceof AltrmiProxy)
  +            if (argClass != null && args[i] instanceof AltrmiProxy)
               {
                   AltrmiProxy proxy = (AltrmiProxy) args[i];
   
  @@ -425,7 +409,7 @@
                       args[i] = makeFacadeRefHolder(proxy, objName);
                   }
               }
  -            else if (mbIsCallbackAware)
  +            else if (argClass != null && mbIsCallbackAware)
               {
                   String publishedName =
                       mCallbackEnabledSocketCustomStreamInvocationHandler.getPublishedName(args[i]);
  @@ -438,17 +422,17 @@
                   }
                   else                                  //check whether its Publish'able
                   {
  -                    if (!_cArgClass.isInterface())    //Hey do we handle only interfaces?
  +                    if (!argClass.isInterface())    //Hey do we handle only interfaces?
                       {
                           continue;
                       }
   
  -                    if (_cArgClass.isAssignableFrom(args[i].getClass()))
  +                    if (argClass.isAssignableFrom(args[i].getClass()))
                       {
                           try
                           {
                               mCallbackEnabledSocketCustomStreamInvocationHandler
  -                                .exposeObject(args[i], _cArgClass);
  +                                .exposeObject(args[i], argClass);
                           }
                           catch (AltrmiCallbackException ace)
                           {
  
  
  
  1.2       +22 -6     jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/PerpetualConnectionPinger.java
  
  Index: PerpetualConnectionPinger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/PerpetualConnectionPinger.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PerpetualConnectionPinger.java	3 Apr 2002 11:29:50 -0000	1.1
  +++ PerpetualConnectionPinger.java	21 Apr 2002 12:19:32 -0000	1.2
  @@ -23,19 +23,35 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version * $Revision: 1.1 $
  + * @version * $Revision: 1.2 $
    */
  -public class PerpetualConnectionPinger extends AbstractConnectionPinger {
  +public class PerpetualConnectionPinger extends AbstractConnectionPinger
  +{
   
  -    public PerpetualConnectionPinger(int pingIntervalSeconds, int giveupIntervalSeconds) {
  +    /**
  +     * Constructor PerpetualConnectionPinger
  +     *
  +     *
  +     * @param pingIntervalSeconds
  +     * @param giveupIntervalSeconds
  +     *
  +     */
  +    public PerpetualConnectionPinger(int pingIntervalSeconds, int giveupIntervalSeconds)
  +    {
           super(pingIntervalSeconds, giveupIntervalSeconds);
       }
   
  -    public PerpetualConnectionPinger() {
  +    /**
  +     * Constructor PerpetualConnectionPinger
  +     *
  +     *
  +     */
  +    public PerpetualConnectionPinger()
  +    {
       }
   
  -    protected void ping() {
  +    protected void ping()
  +    {
           AltrmiReply ar = mAltrmiInvocationHandler.handleInvocation(new PingRequest());
       }
  -
   }
  
  
  
  1.5       +92 -56    jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/ServerClassAltrmiFactory.java
  
  Index: ServerClassAltrmiFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/ServerClassAltrmiFactory.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ServerClassAltrmiFactory.java	18 Apr 2002 06:35:41 -0000	1.4
  +++ ServerClassAltrmiFactory.java	21 Apr 2002 12:19:32 -0000	1.5
  @@ -8,6 +8,8 @@
    */
   package org.apache.excalibur.altrmi.client.impl;
   
  +
  +
   import org.apache.excalibur.altrmi.common.AltrmiConnectionException;
   import org.apache.excalibur.altrmi.common.ClassReply;
   import org.apache.excalibur.altrmi.common.AltrmiReply;
  @@ -17,6 +19,7 @@
   import org.apache.excalibur.altrmi.common.NotPublishedException;
   
   import java.util.HashMap;
  +
   import java.lang.reflect.Constructor;
   import java.lang.reflect.InvocationTargetException;
   
  @@ -26,13 +29,13 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
  -public class ServerClassAltrmiFactory extends AbstractAltrmiFactory {
  +public class ServerClassAltrmiFactory extends AbstractAltrmiFactory
  +{
   
       private HashMap mPublishedServiceClassLoaders = new HashMap();
   
  -
       /**
        * Constructor ServerClassAltrmiFactory
        *
  @@ -40,91 +43,119 @@
        * @param beanOnly
        *
        */
  -    public ServerClassAltrmiFactory(boolean beanOnly) {
  +    public ServerClassAltrmiFactory(boolean beanOnly)
  +    {
           super(beanOnly);
       }
   
  -    protected Class getFacadeClass(String publishedServiceName, String objectName, boolean beanOnly) throws AltrmiConnectionException, ClassNotFoundException{
  +    protected Class getFacadeClass(
  +            String publishedServiceName, String objectName, boolean beanOnly)
  +                throws AltrmiConnectionException, ClassNotFoundException
  +    {
   
           String code = "2";
   
  -        if (beanOnly) {
  +        if (beanOnly)
  +        {
               code = "";
           }
   
  -            TransportedClassLoader tcl = null;
  -            String beanClassName = "AltrmiGenerated" + publishedServiceName + "_" + objectName;
  -            String iiClassName = "AltrmiGenerated2" + publishedServiceName + "_" + objectName;
  -            String className = "AltrmiGenerated" + code + publishedServiceName + "_" + objectName;
  -
  -            if (mPublishedServiceClassLoaders.containsKey(beanClassName)) {
  -                tcl = (TransportedClassLoader) mPublishedServiceClassLoaders.get(beanClassName);
  -            } else {
  -                ClassReply cr = null;
  -
  -                try {
  -                    AltrmiReply ar =
  -                        mHostContext.getInvocationHandler()
  -                            .handleInvocation(new ClassRequest(publishedServiceName, objectName));
  -
  -                    if (ar.getReplyCode() >= AltrmiReply.PROBLEMREPLY) {
  -                        if (ar instanceof RequestFailedReply) {
  -                            throw new AltrmiConnectionException(((RequestFailedReply) ar)
  -                                .getFailureReason());
  -                        } else if (ar instanceof ClassRetrievalFailedReply) {
  -                            ClassRetrievalFailedReply crfr = (ClassRetrievalFailedReply) ar;
  -
  -                            throw new AltrmiConnectionException("Class Retrieval Failed - " + crfr.getReason());
  -                        }    //TODO others.
  +        TransportedClassLoader tcl = null;
  +        String beanClassName = "AltrmiGenerated" + publishedServiceName + "_" + objectName;
  +        String iiClassName = "AltrmiGenerated2" + publishedServiceName + "_" + objectName;
  +        String className = "AltrmiGenerated" + code + publishedServiceName + "_" + objectName;
  +
  +        if (mPublishedServiceClassLoaders.containsKey(beanClassName))
  +        {
  +            tcl = (TransportedClassLoader) mPublishedServiceClassLoaders.get(beanClassName);
  +        }
  +        else
  +        {
  +            ClassReply cr = null;
  +
  +            try
  +            {
  +                AltrmiReply ar =
  +                    mHostContext.getInvocationHandler()
  +                        .handleInvocation(new ClassRequest(publishedServiceName, objectName));
  +
  +                if (ar.getReplyCode() >= AltrmiReply.PROBLEMREPLY)
  +                {
  +                    if (ar instanceof RequestFailedReply)
  +                    {
  +                        throw new AltrmiConnectionException(((RequestFailedReply) ar)
  +                            .getFailureReason());
                       }
  -
  -                    cr = (ClassReply) ar;
  -                } catch (NotPublishedException npe) {
  -                    throw new AltrmiConnectionException("Service " + publishedServiceName
  -                                                        + " not published on Server");
  +                    else if (ar instanceof ClassRetrievalFailedReply)
  +                    {
  +                        ClassRetrievalFailedReply crfr = (ClassRetrievalFailedReply) ar;
  +
  +                        throw new AltrmiConnectionException("Class Retrieval Failed - "
  +                                                            + crfr.getReason());
  +                    }    //TODO others.
                   }
   
  -                tcl = new TransportedClassLoader(mHostContext.getInvocationHandler().getInterfacesClassLoader());
  +                cr = (ClassReply) ar;
  +            }
  +            catch (NotPublishedException npe)
  +            {
  +                throw new AltrmiConnectionException("Service " + publishedServiceName
  +                                                    + " not published on Server");
  +            }
   
  -                tcl.add(beanClassName, cr.getBeanClassBytes());
  +            tcl = new TransportedClassLoader(mHostContext.getInvocationHandler()
  +                .getInterfacesClassLoader());
   
  -                try {
  -                    byte[] bytes = cr.getInterfaceImplClassBytes();
  +            tcl.add(beanClassName, cr.getBeanClassBytes());
   
  -                    tcl.add(iiClassName, bytes);
  -                } catch (NoClassDefFoundError ncdfe) {
  +            try
  +            {
  +                byte[] bytes = cr.getInterfaceImplClassBytes();
   
  -                    // do nothing.  It's a fundamental error to have no interfaces
  -                    // on theclient side.  This is a development issue or the user
  -                    // is poking with a smart tool like beanshell which can use
  -                    // introspection to invoke methods.
  -                }
  +                tcl.add(iiClassName, bytes);
  +            }
  +            catch (NoClassDefFoundError ncdfe)
  +            {
   
  -                mPublishedServiceClassLoaders.put(beanClassName, tcl);
  +                // do nothing.  It's a fundamental error to have no interfaces
  +                // on theclient side.  This is a development issue or the user
  +                // is poking with a smart tool like beanshell which can use
  +                // introspection to invoke methods.
               }
  -            return tcl.loadClass(className);
  +
  +            mPublishedServiceClassLoaders.put(beanClassName, tcl);
  +        }
  +
  +        return tcl.loadClass(className);
       }
   
       protected Object getInstance(
               String publishedServiceName, String objectName, DefaultProxyHelper proxyHelper, boolean beanOnly)
  -                throws AltrmiConnectionException {
  +                throws AltrmiConnectionException
  +    {
   
           String code = "2";
   
  -        if (beanOnly) {
  +        if (beanOnly)
  +        {
               code = "";
           }
   
  -        try {
  +        try
  +        {
               Class clazz = getFacadeClass(publishedServiceName, objectName, beanOnly);
               Constructor[] constructors = clazz.getConstructors();
               Object retVal = constructors[0].newInstance(new Object[]{ proxyHelper });
   
               return retVal;
  -        } catch (InvocationTargetException ite) {
  +        }
  +        catch (InvocationTargetException ite)
  +        {
               throw new AltrmiConnectionException("Generated class not instantiated : "
                                                   + ite.getTargetException().getMessage());
  -        } catch (ClassNotFoundException cnfe) {
  +        }
  +        catch (ClassNotFoundException cnfe)
  +        {
               System.out.println("---**");
               cnfe.printStackTrace();
               System.out.println("---**");
  @@ -133,10 +164,14 @@
   
               throw new AltrmiConnectionException("Generated class not found during lookup : "
                                                   + cnfe.getMessage());
  -        } catch (InstantiationException ie) {
  +        }
  +        catch (InstantiationException ie)
  +        {
               throw new AltrmiConnectionException(
                   "Generated class not instantiable during lookup : " + ie.getMessage());
  -        } catch (IllegalAccessException iae) {
  +        }
  +        catch (IllegalAccessException iae)
  +        {
               throw new AltrmiConnectionException(
                   "Illegal access to generated class during lookup : " + iae.getMessage());
           }
  @@ -147,7 +182,8 @@
        *
        *
        */
  -    public void close() {
  +    public void close()
  +    {
           mHostContext.getInvocationHandler().close();
       }
   }
  
  
  
  1.2       +7 -4      jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/TransportedClassLoader.java
  
  Index: TransportedClassLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/TransportedClassLoader.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TransportedClassLoader.java	3 Apr 2002 11:29:50 -0000	1.1
  +++ TransportedClassLoader.java	21 Apr 2002 12:19:32 -0000	1.2
  @@ -15,9 +15,10 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
  -public final class TransportedClassLoader extends ClassLoader {
  +public final class TransportedClassLoader extends ClassLoader
  +{
   
       /**
        * Constructor TransportedClassLoader
  @@ -26,7 +27,8 @@
        * @param parent
        *
        */
  -    public TransportedClassLoader(ClassLoader parent) {
  +    public TransportedClassLoader(ClassLoader parent)
  +    {
           super(parent);
       }
   
  @@ -38,7 +40,8 @@
        * @param classBytes
        *
        */
  -    public void add(String className, byte[] classBytes) {
  +    public void add(String className, byte[] classBytes)
  +    {
           this.defineClass(className, classBytes, 0, classBytes.length);
       }
   }
  
  
  
  1.3       +5 -4      jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/callback/socket/CallbackEnabledSocketCustomStreamInvocationHandler.java
  
  Index: CallbackEnabledSocketCustomStreamInvocationHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/callback/socket/CallbackEnabledSocketCustomStreamInvocationHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CallbackEnabledSocketCustomStreamInvocationHandler.java	21 Apr 2002 09:42:01 -0000	1.2
  +++ CallbackEnabledSocketCustomStreamInvocationHandler.java	21 Apr 2002 12:19:32 -0000	1.3
  @@ -24,7 +24,7 @@
    * Class CallbackEnabledSocketCustomStreamInvocationHandler
    *
    * @author <a href="mailto:vinayc77@yahoo.com">Vinay Chandran</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public final class CallbackEnabledSocketCustomStreamInvocationHandler
           extends AbstractSocketStreamInvocationHandler {
  @@ -38,7 +38,7 @@
           super(host, port, classLoader);
       }
   
  -	/* 
  +	/*
   	 * @see AbstractSocketStreamInvocationHandler#createClientStreamReadWriter(InputStream, OutputStream)
   	 */
       protected ClientStreamReadWriter createClientStreamReadWriter(
  @@ -50,7 +50,7 @@
           return mCallbackEnabledClientCustomStreamReadWriter;
       }
   
  -	
  +
   	public boolean exposeObject(Object tobeExposedObject,Class tobeExposedInterface) throws AltrmiCallbackException
   	{
   		return mCallbackEnabledClientCustomStreamReadWriter.exposeObject(tobeExposedObject,tobeExposedInterface);
  @@ -60,7 +60,8 @@
   		return mCallbackEnabledClientCustomStreamReadWriter.getPublishedName(tobeExposedObject);
   	}
   
  -    public boolean isCallbackEnabled() {
  +    public boolean isCallbackEnabled()
  +    {
           return true;
       }
   
  
  
  
  1.2       +2 -2      jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/direct/AbstractDirectInvocationHandler.java
  
  Index: AbstractDirectInvocationHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/direct/AbstractDirectInvocationHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractDirectInvocationHandler.java	3 Apr 2002 11:29:50 -0000	1.1
  +++ AbstractDirectInvocationHandler.java	21 Apr 2002 12:19:32 -0000	1.2
  @@ -33,7 +33,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public abstract class AbstractDirectInvocationHandler extends AbstractClientInvocationHandler
   {
  @@ -98,7 +98,7 @@
                   ioe.printStackTrace();
               }
   
  -            //if ((reply instanceof ProblemReply)) { // slower by 11%
  +            //if ((reply instanceof ProblemReply))  // slower by 11%
               if (reply.getReplyCode() >= 100)
               {
                   if (reply instanceof TryLaterReply)
  
  
  
  1.2       +1 -4      jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/direct/DirectHostContext.java
  
  Index: DirectHostContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/direct/DirectHostContext.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DirectHostContext.java	3 Apr 2002 11:29:50 -0000	1.1
  +++ DirectHostContext.java	21 Apr 2002 12:19:32 -0000	1.2
  @@ -20,7 +20,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class DirectHostContext extends AbstractHostContext
   {
  @@ -39,7 +39,4 @@
       {
           super(new DirectInvocationHandler(altrmiInvocationHandler));
       }
  -
  -    //public void setAltrmiConnectionListener(AltrmiConnectionListener altrmiConnectionListener) {
  -    //}
   }
  
  
  
  1.3       +3 -2      jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/direct/DirectInvocationHandler.java
  
  Index: DirectInvocationHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/direct/DirectInvocationHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DirectInvocationHandler.java	21 Apr 2002 09:42:01 -0000	1.2
  +++ DirectInvocationHandler.java	21 Apr 2002 12:19:32 -0000	1.3
  @@ -32,7 +32,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public final class DirectInvocationHandler extends AbstractDirectInvocationHandler
   {
  @@ -59,7 +59,8 @@
           return mAltrmiInvocationHandler.handleInvocation(request);
       }
   
  -    public boolean isCallbackEnabled() {
  +    public boolean isCallbackEnabled()
  +    {
           return false;
       }
   
  
  
  
  1.3       +10 -2     jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/direct/DirectMarshalledInvocationHandler.java
  
  Index: DirectMarshalledInvocationHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/direct/DirectMarshalledInvocationHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DirectMarshalledInvocationHandler.java	21 Apr 2002 09:42:01 -0000	1.2
  +++ DirectMarshalledInvocationHandler.java	21 Apr 2002 12:19:32 -0000	1.3
  @@ -35,7 +35,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public final class DirectMarshalledInvocationHandler extends AbstractDirectInvocationHandler
   {
  @@ -116,7 +116,15 @@
           return mInterfacesClassLoader;
       }
   
  -    public boolean isCallbackEnabled() {
  +    /**
  +     * Method isCallbackEnabled
  +     *
  +     *
  +     * @return
  +     *
  +     */
  +    public boolean isCallbackEnabled()
  +    {
           return false;
       }
   
  
  
  
  1.3       +10 -2     jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/multiple/RotatingMultipleInvocationHandler.java
  
  Index: RotatingMultipleInvocationHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/multiple/RotatingMultipleInvocationHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RotatingMultipleInvocationHandler.java	21 Apr 2002 09:42:01 -0000	1.2
  +++ RotatingMultipleInvocationHandler.java	21 Apr 2002 12:19:32 -0000	1.3
  @@ -23,7 +23,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public class RotatingMultipleInvocationHandler extends AbstractMultipleInvocationHandler
   {
  @@ -116,7 +116,15 @@
           }
       }
   
  -    public boolean isCallbackEnabled() {
  +    /**
  +     * Method isCallbackEnabled
  +     *
  +     *
  +     * @return
  +     *
  +     */
  +    public boolean isCallbackEnabled()
  +    {
           return false;
       }
   
  
  
  
  1.3       +10 -2     jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/piped/AbstractPipedStreamInvocationHandler.java
  
  Index: AbstractPipedStreamInvocationHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/piped/AbstractPipedStreamInvocationHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractPipedStreamInvocationHandler.java	21 Apr 2002 09:42:01 -0000	1.2
  +++ AbstractPipedStreamInvocationHandler.java	21 Apr 2002 12:19:32 -0000	1.3
  @@ -31,7 +31,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public abstract class AbstractPipedStreamInvocationHandler extends StreamInvocationHandler
   {
  @@ -84,7 +84,15 @@
       protected abstract ClientStreamReadWriter createClientStreamReadWriter(
           InputStream in, OutputStream out) throws IOException;
   
  -    public boolean isCallbackEnabled() {
  +    /**
  +     * Method isCallbackEnabled
  +     *
  +     *
  +     * @return
  +     *
  +     */
  +    public boolean isCallbackEnabled()
  +    {
           return false;
       }
   
  
  
  
  1.3       +10 -2     jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/rmi/RmiInvocationHandler.java
  
  Index: RmiInvocationHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/rmi/RmiInvocationHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RmiInvocationHandler.java	21 Apr 2002 09:42:02 -0000	1.2
  +++ RmiInvocationHandler.java	21 Apr 2002 12:19:33 -0000	1.3
  @@ -41,7 +41,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public final class RmiInvocationHandler extends AbstractClientInvocationHandler
   {
  @@ -231,7 +231,15 @@
           return mLastRealRequest;
       }
   
  -    public boolean isCallbackEnabled() {
  +    /**
  +     * Method isCallbackEnabled
  +     *
  +     *
  +     * @return
  +     *
  +     */
  +    public boolean isCallbackEnabled()
  +    {
           return false;
       }
   
  
  
  
  1.3       +10 -2     jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/stream/StreamInvocationHandler.java
  
  Index: StreamInvocationHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/stream/StreamInvocationHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StreamInvocationHandler.java	21 Apr 2002 09:42:02 -0000	1.2
  +++ StreamInvocationHandler.java	21 Apr 2002 12:19:33 -0000	1.3
  @@ -38,7 +38,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public abstract class StreamInvocationHandler extends AbstractClientInvocationHandler
   {
  @@ -230,7 +230,15 @@
           return mLastRealRequest;
       }
   
  -    public boolean isCallbackEnabled() {
  +    /**
  +     * Method isCallbackEnabled
  +     *
  +     *
  +     * @return
  +     *
  +     */
  +    public boolean isCallbackEnabled()
  +    {
           return false;
       }
   }
  
  
  
  1.2       +3 -2      jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/common/AltrmiCallbackException.java
  
  Index: AltrmiCallbackException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/common/AltrmiCallbackException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AltrmiCallbackException.java	10 Apr 2002 22:46:18 -0000	1.1
  +++ AltrmiCallbackException.java	21 Apr 2002 12:19:33 -0000	1.2
  @@ -16,7 +16,7 @@
    *
    *
    * @author <a href="mailto:vinayc77@yahoo.com">Vinay Chandran</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class AltrmiCallbackException extends Exception {
   
  @@ -27,7 +27,8 @@
        * @param s
        *
        */
  -    public AltrmiCallbackException (String s) {
  +    public AltrmiCallbackException (String s)
  +    {
           super(s);
       }
   }
  
  
  
  1.4       +3 -2      jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/common/ClassRetrievalFailedReply.java
  
  Index: ClassRetrievalFailedReply.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/common/ClassRetrievalFailedReply.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ClassRetrievalFailedReply.java	10 Apr 2002 22:33:10 -0000	1.3
  +++ ClassRetrievalFailedReply.java	21 Apr 2002 12:19:33 -0000	1.4
  @@ -18,7 +18,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    */
   public final class ClassRetrievalFailedReply extends AltrmiReply
   {
  @@ -41,7 +41,8 @@
           mReason = reason;
       }
   
  -    public String getReason() {
  +    public String getReason()
  +    {
           return mReason;
       }
   
  
  
  
  1.2       +11 -5     jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/common/ExposedObjectProxy.java
  
  Index: ExposedObjectProxy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/common/ExposedObjectProxy.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ExposedObjectProxy.java	10 Apr 2002 22:46:18 -0000	1.1
  +++ ExposedObjectProxy.java	21 Apr 2002 12:19:33 -0000	1.2
  @@ -20,7 +20,7 @@
    * when sent across to the server as the argument.
    *
    * @author <a href="mailto:vinayc77@yahoo.com">Vinay Chandran</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public final class ExposedObjectProxy extends AltrmiReply {
   
  @@ -35,7 +35,8 @@
        * @param interfaceImplClassBytes
        *
        */
  -    public ExposedObjectProxy(String publishedName) {
  +    public ExposedObjectProxy(String publishedName)
  +    {
   		this.mPublishedName=publishedName;
       }
   
  @@ -44,7 +45,10 @@
        *
        *
        */
  -    public ExposedObjectProxy() {}    // for Externalization
  +    public ExposedObjectProxy()
  +    {
  +         // for Externalization
  +    }
   
   
       /**
  @@ -54,7 +58,8 @@
        * @return
        *
        */
  -    public String getPublishedName() {
  +    public String getPublishedName()
  +    {
           return mPublishedName;
       }
   
  @@ -65,7 +70,8 @@
        * @return
        *
        */
  -    public int getReplyCode() {
  +    public int getReplyCode()
  +    {
           return CLASSREPLY;
       }
   
  
  
  
  1.5       +6 -2      jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/generator/ProxyGeneratorImpl.java
  
  Index: ProxyGeneratorImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/generator/ProxyGeneratorImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ProxyGeneratorImpl.java	21 Apr 2002 09:42:02 -0000	1.4
  +++ ProxyGeneratorImpl.java	21 Apr 2002 12:19:33 -0000	1.5
  @@ -32,7 +32,7 @@
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
    * @author Mike Miller of www.gac.com
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public class ProxyGeneratorImpl extends AbstractMethodHandler implements ProxyGenerator
   {
  @@ -330,6 +330,9 @@
                       mClassSource.println("{");
                       mClassSource.println("    Object[] args = new Object[" + argTypes.length
                                            + "];");
  +                    mClassSource.println("    Class[] argClasses = new Class[" + argTypes.length
  +                                         + "];");
  +
   
                       for (int i = 0; i < argTypes.length; i++)
                       {
  @@ -369,7 +372,7 @@
                           {
                               mClassSource.println(
                                   "      Object retVal = mProxyHelper.processObjectRequest(\""
  -                                + methodSignature.toString() + "\",args);");
  +                                + methodSignature.toString() + "\",args,argClasses);");
                               generateReturnLine(rClass);
                           }
                       }
  @@ -555,6 +558,7 @@
           else
           {
               mClassSource.println("    args[" + i + "] = v" + i + ";");
  +            mClassSource.println("    argClasses[" + i + "] = " + clazz.getName() + ".class;");
           }
       }
   
  
  
  
  1.2       +0 -9      jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/javacompiler/JavaCompiler.java
  
  Index: JavaCompiler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/javacompiler/JavaCompiler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JavaCompiler.java	3 Apr 2002 11:29:54 -0000	1.1
  +++ JavaCompiler.java	21 Apr 2002 12:19:33 -0000	1.2
  @@ -141,15 +141,6 @@
           this.outdir = outdir;
       }
   
  -    // Removed - we manage ourself the buffer and return it as string.
  -    // It can be added later if someone really need that.
  -    //     /**
  -    //      * Set where you want the compiler output (messages) to go
  -    //      */
  -    //     public void setMsgOutput(OutputStream out) {
  -    //       this.out = out;
  -    //     }
  -
       /**
        * Method getCompilerMessage
        *
  
  
  
  1.2       +0 -4      jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/javacompiler/SunJavaCompiler.java
  
  Index: SunJavaCompiler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/javacompiler/SunJavaCompiler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SunJavaCompiler.java	3 Apr 2002 11:29:54 -0000	1.1
  +++ SunJavaCompiler.java	21 Apr 2002 12:19:33 -0000	1.2
  @@ -103,10 +103,6 @@
               args = new String[]{ "-classpath", classpath, "-d", outdir, source };
           }
   
  -        //for (int i = 0; i < args.length; i++) {
  -        //    String arg = args[i];
  -        //    System.out.println("Arg " + i + "=" + arg);
  -        //}
           return compiler.compile(args);
       }
   }
  
  
  
  1.3       +52 -24    jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/AbstractServer.java
  
  Index: AbstractServer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/AbstractServer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractServer.java	10 Apr 2002 23:36:58 -0000	1.2
  +++ AbstractServer.java	21 Apr 2002 12:19:33 -0000	1.3
  @@ -36,10 +36,11 @@
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
    * @author Vinay Chandrasekharan <a href="mailto:vinay_chandran@users.sourceforge.net">vinay_chandran@users.sourceforge.net</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public abstract class AbstractServer extends AbstractMethodHandler
  -        implements AltrmiServer, LogEnabled {
  +        implements AltrmiServer, LogEnabled
  +{
   
       private Vector mConnections = new Vector();
       protected InvocationHandlerAdapter mInovcationHandlerAdapter;
  @@ -55,7 +56,8 @@
        *
        *
        */
  -    public AbstractServer() {
  +    public AbstractServer()
  +    {
           mInovcationHandlerAdapter = new InvocationHandlerAdapter();
       }
   
  @@ -66,7 +68,8 @@
        * @param inovcationHandlerAdapter
        *
        */
  -    public AbstractServer(InvocationHandlerAdapter inovcationHandlerAdapter) {
  +    public AbstractServer(InvocationHandlerAdapter inovcationHandlerAdapter)
  +    {
           mInovcationHandlerAdapter = inovcationHandlerAdapter;
       }
   
  @@ -77,14 +80,26 @@
        * @param logger
        *
        */
  -    public void enableLogging(Logger logger) {
  +    public void enableLogging(Logger logger)
  +    {
           mLogger = logger;
       }
   
  -    public synchronized Logger getLogger() {
  -        if (mLogger == null) {
  +    /**
  +     * Method getLogger
  +     *
  +     *
  +     * @return
  +     *
  +     */
  +    public synchronized Logger getLogger()
  +    {
  +
  +        if (mLogger == null)
  +        {
               mLogger = new ConsoleLogger();
           }
  +
           return mLogger;
       }
   
  @@ -96,7 +111,8 @@
        *
        *
        */
  -    public final void setClassRetriever(ClassRetriever classRetriever) {
  +    public final void setClassRetriever(ClassRetriever classRetriever)
  +    {
           mInovcationHandlerAdapter.setClassRetriever(classRetriever);
       }
   
  @@ -108,7 +124,8 @@
        *
        *
        */
  -    public final void setAuthenticator(AltrmiAuthenticator altrmiAuthenticator) {
  +    public final void setAuthenticator(AltrmiAuthenticator altrmiAuthenticator)
  +    {
           mInovcationHandlerAdapter.setAuthenticator(altrmiAuthenticator);
       }
   
  @@ -121,7 +138,8 @@
        * @return
        *
        */
  -    public AltrmiReply handleInvocation(AltrmiRequest request) {
  +    public AltrmiReply handleInvocation(AltrmiRequest request)
  +    {
           return mInovcationHandlerAdapter.handleInvocation(request);
       }
   
  @@ -129,7 +147,8 @@
        * Method suspend
        *
        */
  -    public void suspend() {
  +    public void suspend()
  +    {
           mInovcationHandlerAdapter.suspend();
       }
   
  @@ -137,7 +156,8 @@
        * Method resume
        *
        */
  -    public void resume() {
  +    public void resume()
  +    {
           mInovcationHandlerAdapter.resume();
       }
   
  @@ -145,7 +165,8 @@
        * Method connectionStart
        *
        */
  -    protected void connectionStart(AltrmiServerConnection altrmiConnection) {
  +    protected void connectionStart(AltrmiServerConnection altrmiConnection)
  +    {
           mConnections.add(altrmiConnection);
       }
   
  @@ -153,15 +174,18 @@
        * Method connectionCompleted
        *
        */
  -    protected void connectionCompleted(AltrmiServerConnection altrmiConnection) {
  +    protected void connectionCompleted(AltrmiServerConnection altrmiConnection)
  +    {
           mConnections.remove(altrmiConnection);
       }
   
  -    protected void killAllConnections() {
  +    protected void killAllConnections()
  +    {
   
           Iterator it = mConnections.iterator();
   
  -        while (it.hasNext()) {
  +        while (it.hasNext())
  +        {
               AltrmiServerConnection asc = (AltrmiServerConnection) it.next();
   
               asc.endConnection();
  @@ -178,7 +202,8 @@
        *
        */
       public void publish(Object impl, String asName, Class interfaceToExpose)
  -            throws PublicationException {
  +            throws PublicationException
  +    {
           mInovcationHandlerAdapter.publish(impl, asName, interfaceToExpose);
       }
   
  @@ -192,7 +217,8 @@
        *
        */
       public void publish(Object impl, String asName, PublicationDescription publicationDescription)
  -            throws PublicationException {
  +            throws PublicationException
  +    {
           mInovcationHandlerAdapter.publish(impl, asName, publicationDescription);
       }
   
  @@ -204,7 +230,8 @@
        * @param asName
        *
        */
  -    public void unPublish(Object impl, String asName) throws PublicationException {
  +    public void unPublish(Object impl, String asName) throws PublicationException
  +    {
           mInovcationHandlerAdapter.unPublish(impl, asName);
       }
   
  @@ -218,7 +245,8 @@
        *
        */
       public void replacePublished(Object oldImpl, String asName, Object withImpl)
  -            throws PublicationException {
  +            throws PublicationException
  +    {
           mInovcationHandlerAdapter.replacePublished(oldImpl, asName, withImpl);
       }
   
  @@ -232,8 +260,8 @@
        * @return
        *
        */
  -    public MethodInvocationHandler getMethodInvocationHandler(MethodRequest mr,
  -                                                              String objectName) {
  +    public MethodInvocationHandler getMethodInvocationHandler(MethodRequest mr, String objectName)
  +    {
           return mInovcationHandlerAdapter.getMethodInvocationHandler(mr, objectName);
       }
   
  @@ -246,8 +274,8 @@
        * @return
        *
        */
  -    public MethodInvocationHandler getMethodInvocationHandler(String publishedName) {
  +    public MethodInvocationHandler getMethodInvocationHandler(String publishedName)
  +    {
           return mInovcationHandlerAdapter.getMethodInvocationHandler(publishedName);
       }
  -
   }
  
  
  
  1.2       +10 -5     jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/AltrmiSession.java
  
  Index: AltrmiSession.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/AltrmiSession.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AltrmiSession.java	3 Apr 2002 11:29:55 -0000	1.1
  +++ AltrmiSession.java	21 Apr 2002 12:19:33 -0000	1.2
  @@ -18,9 +18,10 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
  -public class AltrmiSession {
  +public class AltrmiSession
  +{
   
       private Long mSession;
       private HashMap mBeansInUse = new HashMap();
  @@ -32,7 +33,8 @@
        * @param session
        *
        */
  -    public AltrmiSession(Long session) {
  +    public AltrmiSession(Long session)
  +    {
           mSession = session;
       }
   
  @@ -43,7 +45,8 @@
        * @return
        *
        */
  -    public Long getSession() {
  +    public Long getSession()
  +    {
           return mSession;
       }
   
  @@ -55,7 +58,8 @@
        * @param bean
        *
        */
  -    public void addBeanInUse(Long referenceID, Object bean) {
  +    public void addBeanInUse(Long referenceID, Object bean)
  +    {
           mBeansInUse.put(referenceID, bean);
       }
   
  @@ -66,7 +70,8 @@
        * @param referenceID
        *
        */
  -    public void removeBeanInUse(Long referenceID) {
  +    public void removeBeanInUse(Long referenceID)
  +    {
           mBeansInUse.remove(referenceID);
       }
   }
  
  
  
  1.2       +7 -5      jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/DefaultAuthenticator.java
  
  Index: DefaultAuthenticator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/DefaultAuthenticator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultAuthenticator.java	3 Apr 2002 11:29:55 -0000	1.1
  +++ DefaultAuthenticator.java	21 Apr 2002 12:19:33 -0000	1.2
  @@ -20,9 +20,10 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
  -public class DefaultAuthenticator implements AltrmiAuthenticator {
  +public class DefaultAuthenticator implements AltrmiAuthenticator
  +{
   
       /**
        * Method checkAuthority
  @@ -31,13 +32,13 @@
        * @param auth
        * @param publishedService
        *
  -     * @return
        *
        * @throws AltrmiAuthenticationException
        *
        */
       public void checkAuthority(AltrmiAuthentication auth, String publishedService)
  -            throws AltrmiAuthenticationException {
  +            throws AltrmiAuthenticationException
  +    {
       }
   
       /**
  @@ -47,7 +48,8 @@
        * @return
        *
        */
  -    public String getTextToSign() {
  +    public String getTextToSign()
  +    {
           return "random" + Math.random() + "-" + Math.random() + "-" + Math.random() + "!";
       }
   }
  
  
  
  1.3       +19 -10    jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/ServerCustomStreamReadWriter.java
  
  Index: ServerCustomStreamReadWriter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/ServerCustomStreamReadWriter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ServerCustomStreamReadWriter.java	6 Apr 2002 11:44:23 -0000	1.2
  +++ ServerCustomStreamReadWriter.java	21 Apr 2002 12:19:33 -0000	1.3
  @@ -25,29 +25,34 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
  -public class ServerCustomStreamReadWriter extends ServerStreamReadWriter {
  +public class ServerCustomStreamReadWriter extends ServerStreamReadWriter
  +{
   
       private DataInputStream mDataInputStream;
       private DataOutputStream mDataOutputStream;
   
  -    protected void initialize() throws IOException {
  +    protected void initialize() throws IOException
  +    {
           mDataInputStream = new DataInputStream(mInputStream);
           mDataOutputStream = new DataOutputStream(new BufferedOutputStream(mOutputStream));
       }
   
       protected synchronized AltrmiRequest writeReplyAndGetRequest(AltrmiReply altrmiReply)
  -            throws IOException, ClassNotFoundException {
  +            throws IOException, ClassNotFoundException
  +    {
   
  -        if (altrmiReply != null) {
  +        if (altrmiReply != null)
  +        {
               writeReply(altrmiReply);
           }
   
           return readRequest();
       }
   
  -    private void writeReply(AltrmiReply altrmiReply) throws IOException {
  +    private void writeReply(AltrmiReply altrmiReply) throws IOException
  +    {
   
           byte[] aBytes = SerializationHelper.getBytesFromInstance(altrmiReply);
   
  @@ -56,19 +61,24 @@
           mDataOutputStream.flush();
       }
   
  -    private AltrmiRequest readRequest() throws IOException, ClassNotFoundException {
  +    private AltrmiRequest readRequest() throws IOException, ClassNotFoundException
  +    {
   
           int byteArraySize = mDataInputStream.readInt();
           byte[] byteArray = new byte[byteArraySize];
           int pos = 0;
           int cnt = 0;
  +
           // Loop here until the entire array has been read in.
  -        while( pos < byteArraySize )
  +        while (pos < byteArraySize)
           {
  -            int read = mDataInputStream.read( byteArray, pos, byteArraySize - pos );
  +            int read = mDataInputStream.read(byteArray, pos, byteArraySize - pos);
  +
               pos += read;
  +
               cnt++;
           }
  +
           /*
           if (cnt > 1)
           {
  @@ -76,7 +86,6 @@
                   " reads to read all, " + byteArraySize + ", required bytes." );
           }
           */
  -
           return (AltrmiRequest) SerializationHelper.getInstanceFromBytes(byteArray);
       }
   }
  
  
  
  1.2       +50 -17    jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/ServerObjectStreamReadWriter.java
  
  Index: ServerObjectStreamReadWriter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/ServerObjectStreamReadWriter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ServerObjectStreamReadWriter.java	3 Apr 2002 11:29:55 -0000	1.1
  +++ ServerObjectStreamReadWriter.java	21 Apr 2002 12:19:33 -0000	1.2
  @@ -18,6 +18,7 @@
   import java.io.InputStream;
   import java.io.OutputStream;
   import java.io.IOException;
  +
   import java.lang.reflect.Constructor;
   
   
  @@ -26,47 +27,78 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
  -public class ServerObjectStreamReadWriter extends ServerStreamReadWriter {
  +public class ServerObjectStreamReadWriter extends ServerStreamReadWriter
  +{
   
       private ObjectInputStream mObjectInputStream;
       private ObjectOutputStream mObjectOutputStream;
       private String mObjectOutputStreamClassName = "java.io.ObjectOutputStream";
       private String mObjectInputStreamClassName = "java.io.ObjectInputStream";
   
  -    public ServerObjectStreamReadWriter() {
  +    /**
  +     * Constructor ServerObjectStreamReadWriter
  +     *
  +     *
  +     */
  +    public ServerObjectStreamReadWriter()
  +    {
       }
   
  -    public ServerObjectStreamReadWriter(String objectOutputStreamClassName, String objectInputStreamClassName) {
  +    /**
  +     * Constructor ServerObjectStreamReadWriter
  +     *
  +     *
  +     * @param objectOutputStreamClassName
  +     * @param objectInputStreamClassName
  +     *
  +     */
  +    public ServerObjectStreamReadWriter(String objectOutputStreamClassName,
  +                                        String objectInputStreamClassName)
  +    {
           mObjectOutputStreamClassName = objectOutputStreamClassName;
           mObjectInputStreamClassName = objectInputStreamClassName;
       }
   
  -    protected void initialize() throws IOException {
  -        try {
  +    protected void initialize() throws IOException
  +    {
  +
  +        try
  +        {
               Class clazz = Class.forName(mObjectInputStreamClassName);
  -            Constructor con = clazz.getConstructor(new Class[] {InputStream.class});
  -            mObjectInputStream = (ObjectInputStream) con.newInstance(new Object[] {mInputStream});
  +            Constructor con = clazz.getConstructor(new Class[]{ InputStream.class });
   
  +            mObjectInputStream = (ObjectInputStream) con.newInstance(new Object[]{
  +                mInputStream });
               clazz = Class.forName(mObjectOutputStreamClassName);
  -            con = clazz.getConstructor(new Class[] {OutputStream.class});
  -            mObjectOutputStream = (ObjectOutputStream) con.newInstance(new Object[] {mOutputStream});
  -        } catch (Exception e) {
  -            e.printStackTrace();
  -            throw new IOException("Some problem instantiating ObjectStream classes: " + e.getMessage());
  +            con = clazz.getConstructor(new Class[]{ OutputStream.class });
  +            mObjectOutputStream = (ObjectOutputStream) con.newInstance(new Object[]{
  +                mOutputStream });
           }
  +        catch (Exception e)
  +        {
  +            e.printStackTrace();
   
  +            throw new IOException("Some problem instantiating ObjectStream classes: "
  +                                  + e.getMessage());
  +        }
       }
   
  -    protected synchronized AltrmiRequest writeReplyAndGetRequest(AltrmiReply altrmiReply) throws IOException, ClassNotFoundException {
  -        if (altrmiReply != null) {
  +    protected synchronized AltrmiRequest writeReplyAndGetRequest(AltrmiReply altrmiReply)
  +            throws IOException, ClassNotFoundException
  +    {
  +
  +        if (altrmiReply != null)
  +        {
               writeReply(altrmiReply);
           }
  +
           return readRequest();
       }
   
  -    private void writeReply(AltrmiReply altrmiReply) throws IOException {
  +    private void writeReply(AltrmiReply altrmiReply) throws IOException
  +    {
   
           mObjectOutputStream.writeObject(altrmiReply);
           mObjectOutputStream.flush();
  @@ -74,7 +106,8 @@
           //mObjectOutputStream.reset();
       }
   
  -    private AltrmiRequest readRequest() throws IOException, ClassNotFoundException {
  +    private AltrmiRequest readRequest() throws IOException, ClassNotFoundException
  +    {
           return (AltrmiRequest) mObjectInputStream.readObject();
       }
   }
  
  
  
  1.2       +5 -3      jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/ServerStreamReadWriter.java
  
  Index: ServerStreamReadWriter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/ServerStreamReadWriter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ServerStreamReadWriter.java	3 Apr 2002 11:29:55 -0000	1.1
  +++ ServerStreamReadWriter.java	21 Apr 2002 12:19:33 -0000	1.2
  @@ -25,9 +25,10 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
  -public abstract class ServerStreamReadWriter {
  +public abstract class ServerStreamReadWriter
  +{
   
       protected InputStream mInputStream;
       protected OutputStream mOutputStream;
  @@ -45,7 +46,8 @@
        *
        */
       public final void setStreams(InputStream inputStream, OutputStream outputStream)
  -            throws IOException, ClassCastException {
  +            throws IOException, ClassCastException
  +    {
           mInputStream = inputStream;
           mOutputStream = outputStream;
       }
  
  
  
  1.3       +53 -24    jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/StreamServerConnection.java
  
  Index: StreamServerConnection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/StreamServerConnection.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StreamServerConnection.java	6 Apr 2002 11:46:08 -0000	1.2
  +++ StreamServerConnection.java	21 Apr 2002 12:19:33 -0000	1.3
  @@ -34,16 +34,17 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
  -public abstract class StreamServerConnection implements Runnable, AltrmiServerConnection, LogEnabled {
  +public abstract class StreamServerConnection
  +        implements Runnable, AltrmiServerConnection, LogEnabled
  +{
   
       private AbstractServer mAbstractServer;
       private boolean mEndConnection = false;
       private ServerStreamReadWriter mReadWriter;
       private Logger mLogger;
   
  -
       /**
        * Constructor StreamServerConnection
        *
  @@ -53,12 +54,21 @@
        *
        */
       public StreamServerConnection(AbstractServer abstractServer,
  -                                  ServerStreamReadWriter readWriter) {
  +                                  ServerStreamReadWriter readWriter)
  +    {
           mAbstractServer = abstractServer;
           mReadWriter = readWriter;
       }
   
  -    public void enableLogging(Logger logger) {
  +    /**
  +     * Method enableLogging
  +     *
  +     *
  +     * @param logger
  +     *
  +     */
  +    public void enableLogging(Logger logger)
  +    {
           mLogger = logger;
       }
   
  @@ -67,20 +77,25 @@
        *
        *
        */
  -    public void run() {
  +    public void run()
  +    {
   
           mAbstractServer.connectionStart(this);
   
  -        try {
  +        try
  +        {
               mReadWriter.initialize();
   
               boolean more = true;
               AltrmiRequest request = null;
               AltrmiReply reply = null;
   
  -            while (more) {
  -                try {
  -                    if (request != null) {
  +            while (more)
  +            {
  +                try
  +                {
  +                    if (request != null)
  +                    {
                           reply = mAbstractServer.handleInvocation(request);
                       }
   
  @@ -89,30 +104,44 @@
                       // http://developer.java.sun.com/developer/bugParade/bugs/4499841.html
                       // halves the performance though.
                       //oOS.reset();
  -                    if (mEndConnection) {
  +                    if (mEndConnection)
  +                    {
                           reply = new EndConnectionReply();
                           more = false;
                       }
  -                } catch (IOException ioe) {
  +                }
  +                catch (IOException ioe)
  +                {
                       more = false;
  -                    if (ioe instanceof EOFException) {
  +
  +                    if (ioe instanceof EOFException)
  +                    {
                           mLogger.info("One Connection closed. (EOF)");
  -                    } else if (ioe instanceof SocketException
  -                            || ioe.getClass().getName().equals("java.net.SocketTimeoutException")
  -                            || ioe instanceof InterruptedIOException
  -                            || (ioe.getMessage() != null
  -                            && (ioe.getMessage().equals("Write end dead")
  -                            || ioe.getMessage().equals("Pipe broken")))) {
  +                    }
  +                    else if ((ioe instanceof SocketException)
  +                             || ioe.getClass().getName().equals("java.net.SocketTimeoutException")
  +                             || (ioe instanceof InterruptedIOException)
  +                             || ((ioe.getMessage() != null)
  +                                 && (ioe.getMessage().equals("Write end dead")
  +                                     || ioe.getMessage().equals("Pipe broken"))))
  +                    {
  +
                           // TODO implement implementation indepandant logger
                           mLogger.info("One Connection closed.");
  -                    } else {
  +                    }
  +                    else
  +                    {
                           mLogger.error("Unexpected IOE in StreamServerConnection #1", ioe);
                       }
                   }
               }
  -        } catch (IOException e) {
  +        }
  +        catch (IOException e)
  +        {
               mLogger.error("Unexpected IOE in StreamServerConnection #2", e);
  -        } catch (ClassNotFoundException e) {
  +        }
  +        catch (ClassNotFoundException e)
  +        {
               mLogger.error("Unexpected ClassNotFoundException in StreamServerConnection", e);
           }
   
  @@ -124,7 +153,8 @@
        *
        *
        */
  -    public void endConnection() {
  +    public void endConnection()
  +    {
           mEndConnection = true;
       }
   
  @@ -134,5 +164,4 @@
        *
        */
       protected abstract void killConnection();
  -
   }
  
  
  
  1.5       +23 -12    jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/adapters/InvocationHandlerAdapter.java
  
  Index: InvocationHandlerAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/adapters/InvocationHandlerAdapter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- InvocationHandlerAdapter.java	21 Apr 2002 09:42:02 -0000	1.4
  +++ InvocationHandlerAdapter.java	21 Apr 2002 12:19:33 -0000	1.5
  @@ -55,7 +55,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public class InvocationHandlerAdapter extends PublicationAdapter
           implements AltrmiInvocationHandler
  @@ -157,7 +157,8 @@
           }
       }
   
  -    private AltrmiReply doMethodFacadeRequest(AltrmiRequest request) {
  +    private AltrmiReply doMethodFacadeRequest(AltrmiRequest request)
  +    {
           MethodFacadeRequest mFacReq = (MethodFacadeRequest) request;
           String publishedThing = mFacReq.getPublishedServiceName() + "_"
                                   + mFacReq.getObjectName();
  @@ -210,7 +211,8 @@
           }
       }
   
  -    private AltrmiReply doMethodFacadeRequestArray(Object methodReply, MethodFacadeRequest mFacReq) {
  +    private AltrmiReply doMethodFacadeRequestArray(Object methodReply, MethodFacadeRequest mFacReq)
  +    {
           Object[] beanImpls = (Object[]) methodReply;
           Long[] refs = new Long[beanImpls.length];
           String[] objectNames = new String[beanImpls.length];
  @@ -259,7 +261,8 @@
           return new MethodFacadeArrayReply(refs, objectNames);
       }
   
  -    private AltrmiReply doMethodFacadeRequestNonArray(Object beanImpl, MethodFacadeRequest mFacReq) {
  +    private AltrmiReply doMethodFacadeRequestNonArray(Object beanImpl, MethodFacadeRequest mFacReq)
  +    {
   
           MethodInvocationHandler mainMethodInvocationHandler = (MethodInvocationHandler)
                   mPublishedObjects.get(mFacReq.getPublishedServiceName() + "_Main");
  @@ -293,7 +296,8 @@
           return new MethodFacadeReply(newRef, objectName);
       }
   
  -    private AltrmiReply doMethodRequest(AltrmiRequest request) {
  +    private AltrmiReply doMethodRequest(AltrmiRequest request)
  +    {
           MethodRequest mReq = (MethodRequest) request;
           String publishedThing = mReq.getPublishedServiceName() + "_" + mReq.getObjectName();
   
  @@ -308,7 +312,8 @@
           return methodInvocationHandler.handleMethodInvocation(mReq);
       }
   
  -    private AltrmiReply doLookupRequest(AltrmiRequest request) {
  +    private AltrmiReply doLookupRequest(AltrmiRequest request)
  +    {
           LookupRequest lr = (LookupRequest) request;
   
           try
  @@ -325,7 +330,8 @@
           return new LookupReply(new Long(0));
       }
   
  -    private AltrmiReply doClassRequest(AltrmiRequest request) {
  +    private AltrmiReply doClassRequest(AltrmiRequest request)
  +    {
           ClassRequest cr = (ClassRequest) request;
           String publishedThing = cr.getPublishedServiceName() + "_" + cr.getObjectName();
   
  @@ -342,7 +348,8 @@
           }
       }
   
  -    private AltrmiReply doOpenConnectionRequest() {
  +    private AltrmiReply doOpenConnectionRequest()
  +    {
           Long session = getNewSession();
   
           mSessions.put(session, new AltrmiSession(session));
  @@ -350,7 +357,8 @@
           return new OpenConnectionReply(mAltrmiAuthenticator.getTextToSign(), session);
       }
   
  -    private AltrmiReply doListRequest() {
  +    private AltrmiReply doListRequest()
  +    {
           //return the list of published objects to the server
           Iterator iterator = mPublishedObjects.keySet().iterator();
           Vector vecOfPublishedObjectNames = new Vector();
  @@ -373,7 +381,8 @@
           return new ListReply(_listOfPublishedObjectNames);
       }
   
  -    private AltrmiReply doGarbageCollectionRequest(AltrmiRequest request) {
  +    private AltrmiReply doGarbageCollectionRequest(AltrmiRequest request)
  +    {
           GarbageCollectionRequest gcr = (GarbageCollectionRequest) request;
           String publishedThing = gcr.getPublishedServiceName() + "_" + gcr.getObjectName();
   
  @@ -389,10 +398,12 @@
           }
   
           AltrmiSession sess = (AltrmiSession) mSessions.get(gcr.getSession());
  -        if (sess == null) {
  +        if (sess == null)
  +        {
               System.out.println("DEBUG- GC on missing session -" + gcr.getSession());
           }
  -        if (gcr.getReferenceID() == null) {
  +        if (gcr.getReferenceID() == null)
  +        {
               System.out.println("DEBUG- GC on missing referenceID -" + gcr.getReferenceID());
           }
           sess.removeBeanInUse(gcr.getReferenceID());
  
  
  
  1.2       +284 -243  jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/callback/socket/CallbackEnabledSocketCustomStreamReadWriter.java
  
  Index: CallbackEnabledSocketCustomStreamReadWriter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/callback/socket/CallbackEnabledSocketCustomStreamReadWriter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CallbackEnabledSocketCustomStreamReadWriter.java	20 Apr 2002 17:39:44 -0000	1.1
  +++ CallbackEnabledSocketCustomStreamReadWriter.java	21 Apr 2002 12:19:33 -0000	1.2
  @@ -44,194 +44,219 @@
   /**
    * CallbackEnabledSocketCustomStreamReadWriter
    *  This StreamReadWriter is responsible for unmarshalling
  - * 	exposedClient objects too and devliering it to the Remote Object.
  + *      exposedClient objects too and devliering it to the Remote Object.
    *  The calls made for the exposed Client Object is also marshalled
  - * 	out here with the aid of the internal InvocationHandler.
  + *      out here with the aid of the internal InvocationHandler.
    *  The callbacks are multiplexed over the same connection and thus
  - * 	there are no extra network connections needed to enable callbacks.
  + *      there are no extra network connections needed to enable callbacks.
    *
    * @author <a href="mailto:vinayc77@yahoo.com">Vinay Chandran</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
  -public class CallbackEnabledSocketCustomStreamReadWriter extends ServerStreamReadWriter implements Runnable
  +public class CallbackEnabledSocketCustomStreamReadWriter extends ServerStreamReadWriter
  +        implements Runnable
   {
   
       private DataInputStream mDataInputStream;
       private DataOutputStream mDataOutputStream;
  -	private Thread mMessageLoopThread =null;
  -	private boolean mIsStopped=false;
  -	private Object mRequestLock= new Object();
  -	private Object mReplyLock= new Object();
  -    private AltrmiRequest mRequest=null;
  -    private AltrmiReply mReply=null;
  -	private CallbackServerClientReadWriter mCallbackServerClientReadWriter;
  -	private CallbackStreamInvocationHandler mCallbackStreamInvocationHandler;
  -	private CallbackHostContext mCallbackHostContext;
  -	private CallbackServerClassAltrmiFactory  mAltrmiFactory;
  -
  -
  -	/*
  -	 * @see ServerStreamReadWriter#initialize()
  -	 */
  -    protected void initialize() throws IOException {
  +    private Thread mMessageLoopThread = null;
  +    private boolean mIsStopped = false;
  +    private Object mRequestLock = new Object();
  +    private Object mReplyLock = new Object();
  +    private AltrmiRequest mRequest = null;
  +    private AltrmiReply mReply = null;
  +    private CallbackServerClientReadWriter mCallbackServerClientReadWriter;
  +    private CallbackStreamInvocationHandler mCallbackStreamInvocationHandler;
  +    private CallbackHostContext mCallbackHostContext;
  +    private CallbackServerClassAltrmiFactory mAltrmiFactory;
  +
  +    /*
  +     * @see ServerStreamReadWriter#initialize()
  +     */
  +    protected void initialize() throws IOException
  +    {
  +
           mDataInputStream = new DataInputStream(mInputStream);
           mDataOutputStream = new DataOutputStream(new BufferedOutputStream(mOutputStream));
  -		//start the receiving message loop
  -		mMessageLoopThread =  new Thread(this);
  -		mMessageLoopThread.start();
  -	
  -    }
  -
  -	/**
  -	 * Message Loop . 
  -	 * Notifies the Reply or Request monitor depending upon the type of message.
  -	 * @see Runnable#run()
  -	 */
  -	public void run()
  -	{
  -		mCallbackServerClientReadWriter  = new CallbackServerClientReadWriter(this);
  -		mCallbackStreamInvocationHandler =  new CallbackStreamInvocationHandler(this.getClass().getClassLoader());
  -		mCallbackStreamInvocationHandler.setObjectReadWriter(mCallbackServerClientReadWriter);
  -		mCallbackHostContext	=  new CallbackHostContext(mCallbackStreamInvocationHandler);
  -		mAltrmiFactory	= new CallbackServerClassAltrmiFactory(false);
  -		mAltrmiFactory.setInitializedHostContext(mCallbackHostContext);
  -
  -		while(!mIsStopped)
  -		{
  -	        try 
  -	        {
  -				//recv packets from the client
  -	        	int byteArraySize = (int) mDataInputStream.readInt();
  -			    byte[] byteArray = new byte[byteArraySize];
  -			    mDataInputStream.read(byteArray);
  -			    Object obj=SerializationHelper.getInstanceFromBytes(byteArray);
  -				
  -				//interpret it as a request or reply & notify the corresponding listeners
  -				// SHLD we need a queue here to hold the arriving packets
  -				// TODO:WORKAROUND: Dont receive until the data is handled some way
  -				if(obj instanceof AltrmiRequest)
  -				{
  -				    mRequest=(AltrmiRequest)obj;
  -					synchronized(mRequestLock)
  -					{
  -						mRequestLock.notify();
  -					}
  -				}
  -				else if(obj instanceof AltrmiReply)
  -				{
  -				    mReply=(AltrmiReply)obj;
  -					synchronized(mReplyLock)
  -					{
  -						mReplyLock.notify();
  -					}
  -				}
  -				else
  -				{
  -					//SHLD never occur
  -				}
  -
  -			}
  -			catch(java.net.SocketException se) 
  -			{
  -				mIsStopped=true;
  -				synchronized(mRequestLock)
  -				{
  -					mRequestLock.notify();
  -				}
  -				synchronized(mReplyLock)
  -				{
  -					mReplyLock.notify();
  -				}
  -				return;
  -			} 
  -			catch(IOException e) 
  -			{
  -				e.printStackTrace();
  -				mIsStopped=true;
  -				return;
  -			} 
  -			catch(ClassNotFoundException ce) 
  -			{
  -				ce.printStackTrace();
  -				mIsStopped=true;
  -				return;
  -			}
  -		}
  -		
  -	}
  -
  -	
  -
  -	/**
  -	 * Method getRequestFromMessageLoop.
  -	 * @return AltrmiRequest
  -	 */
  -	private AltrmiRequest getRequestFromMessageLoop()
  -	{
  -		//if(_replyQueue.size()==0)
  -		if(mRequest==null)
  -		{
  -			synchronized(mRequestLock)
  -			{
  -				try 
  -				{
  -					mRequestLock.wait();
  -				} 
  -				catch(InterruptedException e) 
  -				{
  -					e.printStackTrace();
  -				}
  -			}
  -		}
  -		return mRequest;
  -	}
  -
  -	/**
  -	 * Method getReplyFromMessageLoop.
  -	 * @return AltrmiReply
  -	 */
  -	private AltrmiReply getReplyFromMessageLoop()
  -	{
  -
  -		//if(_replyQueue.size()==0)
  -		if(mReply==null)
  -		{
  -
  -			synchronized(mReplyLock)
  -			{
  -				try 
  -				{
  -					mReplyLock.wait();
  -				} 
  -				catch(InterruptedException e) 
  -				{
  -					e.printStackTrace();
  -				}
  -			}
  -		}
  -		return mReply;
  -	}
  -
  -	/*
  -	 * @see ServerStreamReadWriter#writeReplyAndGetRequest(AltrmiReply)
  -	 */
  -    protected  AltrmiRequest writeReplyAndGetRequest(AltrmiReply altrmiReply)
  -            throws IOException, ClassNotFoundException {
   
  -        if (altrmiReply != null) {
  +        //start the receiving message loop
  +        mMessageLoopThread = new Thread(this);
  +
  +        mMessageLoopThread.start();
  +    }
  +
  +    /**
  +     * Message Loop .
  +     * Notifies the Reply or Request monitor depending upon the type of message.
  +     * @see Runnable#run()
  +     */
  +    public void run()
  +    {
  +
  +        mCallbackServerClientReadWriter = new CallbackServerClientReadWriter(this);
  +        mCallbackStreamInvocationHandler =
  +            new CallbackStreamInvocationHandler(this.getClass().getClassLoader());
  +
  +        mCallbackStreamInvocationHandler.setObjectReadWriter(mCallbackServerClientReadWriter);
  +
  +        mCallbackHostContext = new CallbackHostContext(mCallbackStreamInvocationHandler);
  +        mAltrmiFactory = new CallbackServerClassAltrmiFactory(false);
  +
  +        mAltrmiFactory.setInitializedHostContext(mCallbackHostContext);
  +
  +        while (!mIsStopped)
  +        {
  +            try
  +            {
  +
  +                //recv packets from the client
  +                int byteArraySize = (int) mDataInputStream.readInt();
  +                byte[] byteArray = new byte[byteArraySize];
  +
  +                mDataInputStream.read(byteArray);
  +
  +                Object obj = SerializationHelper.getInstanceFromBytes(byteArray);
  +
  +                //interpret it as a request or reply & notify the corresponding listeners
  +                // SHLD we need a queue here to hold the arriving packets
  +                // TODO:WORKAROUND: Dont receive until the data is handled some way
  +                if (obj instanceof AltrmiRequest)
  +                {
  +                    mRequest = (AltrmiRequest) obj;
  +
  +                    synchronized (mRequestLock)
  +                    {
  +                        mRequestLock.notify();
  +                    }
  +                }
  +                else if (obj instanceof AltrmiReply)
  +                {
  +                    mReply = (AltrmiReply) obj;
  +
  +                    synchronized (mReplyLock)
  +                    {
  +                        mReplyLock.notify();
  +                    }
  +                }
  +                else
  +                {
  +
  +                    //SHLD never occur
  +                }
  +            }
  +            catch (java.net.SocketException se)
  +            {
  +                mIsStopped = true;
  +
  +                synchronized (mRequestLock)
  +                {
  +                    mRequestLock.notify();
  +                }
  +
  +                synchronized (mReplyLock)
  +                {
  +                    mReplyLock.notify();
  +                }
  +
  +                return;
  +            }
  +            catch (IOException e)
  +            {
  +                e.printStackTrace();
  +
  +                mIsStopped = true;
  +
  +                return;
  +            }
  +            catch (ClassNotFoundException ce)
  +            {
  +                ce.printStackTrace();
  +
  +                mIsStopped = true;
  +
  +                return;
  +            }
  +        }
  +    }
  +
  +    /**
  +     * Method getRequestFromMessageLoop.
  +     * @return AltrmiRequest
  +     */
  +    private AltrmiRequest getRequestFromMessageLoop()
  +    {
  +
  +        //if(_replyQueue.size()==0)
  +        if (mRequest == null)
  +        {
  +            synchronized (mRequestLock)
  +            {
  +                try
  +                {
  +                    mRequestLock.wait();
  +                }
  +                catch (InterruptedException e)
  +                {
  +                    e.printStackTrace();
  +                }
  +            }
  +        }
  +
  +        return mRequest;
  +    }
  +
  +    /**
  +     * Method getReplyFromMessageLoop.
  +     * @return AltrmiReply
  +     */
  +    private AltrmiReply getReplyFromMessageLoop()
  +    {
  +
  +        //if(_replyQueue.size()==0)
  +        if (mReply == null)
  +        {
  +            synchronized (mReplyLock)
  +            {
  +                try
  +                {
  +                    mReplyLock.wait();
  +                }
  +                catch (InterruptedException e)
  +                {
  +                    e.printStackTrace();
  +                }
  +            }
  +        }
  +
  +        return mReply;
  +    }
  +
  +    /*
  +     * @see ServerStreamReadWriter#writeReplyAndGetRequest(AltrmiReply)
  +     */
  +    protected AltrmiRequest writeReplyAndGetRequest(AltrmiReply altrmiReply)
  +            throws IOException, ClassNotFoundException
  +    {
  +
  +        if (altrmiReply != null)
  +        {
               writeReply(altrmiReply);
           }
  -		AltrmiRequest req= readRequest();
  -		mRequest=null;
  +
  +        AltrmiRequest req = readRequest();
  +
  +        mRequest = null;
  +
           return req;
       }
   
  -	/**
  -	 * Method writeReply.
  -	 * @param altrmiReply
  -	 * @throws IOException
  -	 */
  -    private void writeReply(AltrmiReply altrmiReply) throws IOException {
  +    /**
  +     * Method writeReply.
  +     * @param altrmiReply
  +     * @throws IOException
  +     */
  +    private void writeReply(AltrmiReply altrmiReply) throws IOException
  +    {
   
           byte[] aBytes = SerializationHelper.getBytesFromInstance(altrmiReply);
   
  @@ -240,94 +265,110 @@
           mDataOutputStream.flush();
       }
   
  -	/**
  -	 * Method readRequest.
  -	 * @return AltrmiRequest
  -	 * @throws IOException
  -	 * @throws ClassNotFoundException
  -	 */
  -    private AltrmiRequest readRequest() throws IOException, ClassNotFoundException {
  -
  -		AltrmiRequest altrmiRequest=getRequestFromMessageLoop();
  -		if(altrmiRequest instanceof MethodRequest)
  -			correctArgs(((MethodRequest)altrmiRequest).getArgs());
  +    /**
  +     * Method readRequest.
  +     * @return AltrmiRequest
  +     * @throws IOException
  +     * @throws ClassNotFoundException
  +     */
  +    private AltrmiRequest readRequest() throws IOException, ClassNotFoundException
  +    {
  +
  +        AltrmiRequest altrmiRequest = getRequestFromMessageLoop();
  +
  +        if (altrmiRequest instanceof MethodRequest)
  +        {
  +            correctArgs(((MethodRequest) altrmiRequest).getArgs());
  +        }
  +
           return altrmiRequest;
       }
   
  -//client side    
  -	/**
  -	 * Method postRequest.
  -	 * @param altrmiRequest
  -	 * @return AltrmiReply
  -	 * @throws IOException
  -	 * @throws ClassNotFoundException
  -	 */
  -	protected  AltrmiReply postRequest(AltrmiRequest altrmiRequest)
  -            throws IOException, ClassNotFoundException {
  -
  -		if(mIsStopped)
  -			throw new AltrmiConnectionClosedException("Client Closed Connection");
  -		writeRequest(altrmiRequest);
  +    //client side    
  +
  +    /**
  +     * Method postRequest.
  +     * @param altrmiRequest
  +     * @return AltrmiReply
  +     * @throws IOException
  +     * @throws ClassNotFoundException
  +     */
  +    protected AltrmiReply postRequest(AltrmiRequest altrmiRequest)
  +            throws IOException, ClassNotFoundException
  +    {
  +
  +        if (mIsStopped)
  +        {
  +            throw new AltrmiConnectionClosedException("Client Closed Connection");
  +        }
  +
  +        writeRequest(altrmiRequest);
  +
           AltrmiReply r = readReply();
  -		if(r==null)
  -			throw new java.io.InterruptedIOException("Client Connection Closed");
   
  -        mReply=null;
  +        if (r == null)
  +        {
  +            throw new java.io.InterruptedIOException("Client Connection Closed");
  +        }
  +
  +        mReply = null;
  +
           return r;
       }
   
  -	/**
  -	 * Method writeRequest.
  -	 * @param altrmiRequest
  -	 * @throws IOException
  -	 */
  -    private void writeRequest(AltrmiRequest altrmiRequest) throws IOException {
  +    /**
  +     * Method writeRequest.
  +     * @param altrmiRequest
  +     * @throws IOException
  +     */
  +    private void writeRequest(AltrmiRequest altrmiRequest) throws IOException
  +    {
   
           byte[] aBytes = SerializationHelper.getBytesFromInstance(altrmiRequest);
   
           mDataOutputStream.writeInt(aBytes.length);
           mDataOutputStream.write(aBytes);
           mDataOutputStream.flush();
  +    }
   
  +    /**
  +     * Method readReply.
  +     * @return AltrmiReply
  +     * @throws IOException
  +     * @throws ClassNotFoundException
  +     */
  +    private AltrmiReply readReply() throws IOException, ClassNotFoundException
  +    {
  +        return getReplyFromMessageLoop();
       }
   
  -	/**
  -	 * Method readReply.
  -	 * @return AltrmiReply
  -	 * @throws IOException
  -	 * @throws ClassNotFoundException
  -	 */
  -    private AltrmiReply readReply() throws IOException, ClassNotFoundException {
  -		
  -		return getReplyFromMessageLoop();
  -    }
  -
  -	
  -	/**
  -	 * Method correctArgs.
  -	 * 	UnMarshall the arguments .
  -	 * @param args
  -	 */
  -	public void correctArgs(Object[] args)
  -	{
  -		for (int i = 0; i < args.length; i++) 
  -		{
  -			if(args[i] instanceof ExposedObjectProxy)
  -			{
  -				ExposedObjectProxy exposedObjectProxy =(ExposedObjectProxy)args[i];
  -
  -				try
  -				{
  -					//lookup the client-side exported object.
  -					Object obj = mAltrmiFactory.lookup(exposedObjectProxy.getPublishedName());
  -					args[i]=obj;
  -
  -				}
  -				catch(Exception altrmiConnectionException)
  -				{
  -					altrmiConnectionException.printStackTrace();
  -				}
  -			}
  -		}
  -	}
  +    /**
  +     * Method correctArgs.
  +     *      UnMarshall the arguments .
  +     * @param args
  +     */
  +    public void correctArgs(Object[] args)
  +    {
  +
  +        for (int i = 0; i < args.length; i++)
  +        {
  +            if (args[i] instanceof ExposedObjectProxy)
  +            {
  +                ExposedObjectProxy exposedObjectProxy = (ExposedObjectProxy) args[i];
  +
  +                try
  +                {
  +
  +                    //lookup the client-side exported object.
  +                    Object obj = mAltrmiFactory.lookup(exposedObjectProxy.getPublishedName());
  +
  +                    args[i] = obj;
  +                }
  +                catch (Exception altrmiConnectionException)
  +                {
  +                    altrmiConnectionException.printStackTrace();
  +                }
  +            }
  +        }
  +    }
   }
  
  
  
  1.2       +40 -17    jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/callback/socket/CallbackEnabledSocketCustomStreamServer.java
  
  Index: CallbackEnabledSocketCustomStreamServer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/callback/socket/CallbackEnabledSocketCustomStreamServer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CallbackEnabledSocketCustomStreamServer.java	20 Apr 2002 17:39:44 -0000	1.1
  +++ CallbackEnabledSocketCustomStreamServer.java	21 Apr 2002 12:19:33 -0000	1.2
  @@ -29,32 +29,55 @@
    * Class CallbackEnabledSocketCustomStreamServer
    *
    *@author <a href="mailto:vinayc77@yahoo.com">Vinay Chandran</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
  -public class CallbackEnabledSocketCustomStreamServer extends AbstractCompleteSocketStreamServer {
  +public class CallbackEnabledSocketCustomStreamServer extends AbstractCompleteSocketStreamServer
  +{
   
  -
  -	/*
  -	 * @see AbstractCompleteSocketStreamServer#AbstractCompleteSocketStreamServer(int)
  -	 */
  -    public CallbackEnabledSocketCustomStreamServer(int port) throws AltrmiServerException {
  +    /*
  +     * @see AbstractCompleteSocketStreamServer#AbstractCompleteSocketStreamServer(int)
  +     */
  +
  +    /**
  +     * Constructor CallbackEnabledSocketCustomStreamServer
  +     *
  +     *
  +     * @param port
  +     *
  +     * @throws AltrmiServerException
  +     *
  +     */
  +    public CallbackEnabledSocketCustomStreamServer(int port) throws AltrmiServerException
  +    {
           super(port);
       }
   
  -	/*
  -	 * @see AbstractCompleteSocketStreamServer#AbstractCompleteSocketStreamServer(InvocationHandlerAdapter, int)
  -	 */
  -    public CallbackEnabledSocketCustomStreamServer(InvocationHandlerAdapter invocationHandlerAdapter, int port) throws AltrmiServerException {
  +    /*
  +     * @see AbstractCompleteSocketStreamServer#AbstractCompleteSocketStreamServer(InvocationHandlerAdapter, int)
  +     */
  +
  +    /**
  +     * Constructor CallbackEnabledSocketCustomStreamServer
  +     *
  +     *
  +     * @param invocationHandlerAdapter
  +     * @param port
  +     *
  +     * @throws AltrmiServerException
  +     *
  +     */
  +    public CallbackEnabledSocketCustomStreamServer(
  +            InvocationHandlerAdapter invocationHandlerAdapter, int port)
  +                throws AltrmiServerException
  +    {
           super(invocationHandlerAdapter, port);
       }
   
  -
  -
  -	/*
  -	 * @see AbstractCompleteSocketStreamServer#createServerStreamReadWriter()
  -	 */
  -    protected ServerStreamReadWriter createServerStreamReadWriter() {
  +    /*
  +     * @see AbstractCompleteSocketStreamServer#createServerStreamReadWriter()
  +     */
  +    protected ServerStreamReadWriter createServerStreamReadWriter()
  +    {
           return new CallbackEnabledSocketCustomStreamReadWriter();
       }
  -
   }
  
  
  
  1.2       +23 -6     jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/callback/socket/PartialCallbackEnabledSocketCustomStreamServer.java
  
  Index: PartialCallbackEnabledSocketCustomStreamServer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/callback/socket/PartialCallbackEnabledSocketCustomStreamServer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PartialCallbackEnabledSocketCustomStreamServer.java	20 Apr 2002 17:39:44 -0000	1.1
  +++ PartialCallbackEnabledSocketCustomStreamServer.java	21 Apr 2002 12:19:33 -0000	1.2
  @@ -14,28 +14,45 @@
   import org.apache.excalibur.altrmi.server.impl.socket.AbstractPartialSocketStreamServer;
   import org.apache.excalibur.altrmi.server.impl.adapters.InvocationHandlerAdapter;
   
  +
   /**
    * Class CallbackEnabledSocketCustomStreamServer
    *
    * @author <a href="mailto:vinayc77@yahoo.com">Vinay Chandran</a>
    * @author Peter Royal
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
  -public class PartialCallbackEnabledSocketCustomStreamServer extends AbstractPartialSocketStreamServer {
  +public class PartialCallbackEnabledSocketCustomStreamServer
  +        extends AbstractPartialSocketStreamServer
  +{
  +
  +    /**
  +     * Constructor PartialCallbackEnabledSocketCustomStreamServer
  +     *
  +     *
  +     */
       public PartialCallbackEnabledSocketCustomStreamServer()
       {
       }
   
  -    public PartialCallbackEnabledSocketCustomStreamServer(InvocationHandlerAdapter inovcationHandlerAdapter)
  +    /**
  +     * Constructor PartialCallbackEnabledSocketCustomStreamServer
  +     *
  +     *
  +     * @param inovcationHandlerAdapter
  +     *
  +     */
  +    public PartialCallbackEnabledSocketCustomStreamServer(
  +            InvocationHandlerAdapter inovcationHandlerAdapter)
       {
           super(inovcationHandlerAdapter);
       }
   
       /*
  -	 * @see AbstractPartialSocketStreamServer#createServerStreamReadWriter()
  -	 */
  -    protected ServerStreamReadWriter createServerStreamReadWriter() {
  +         * @see AbstractPartialSocketStreamServer#createServerStreamReadWriter()
  +         */
  +    protected ServerStreamReadWriter createServerStreamReadWriter()
  +    {
           return new CallbackEnabledSocketCustomStreamReadWriter();
       }
  -
   }
  
  
  

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


Mime
View raw message