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/adapters InvocationHandlerAdapter.java
Date Mon, 27 Jan 2003 21:55:50 GMT
hammant     2003/01/27 13:55:50

  Modified:    altrmi/src/java/org/apache/excalibur/altrmi/server/impl/adapters
                        InvocationHandlerAdapter.java
  Log:
  Better debugging for failing complex method invocations.
  
  Revision  Changes    Path
  1.19      +72 -61    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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- InvocationHandlerAdapter.java	9 Jan 2003 22:55:11 -0000	1.18
  +++ InvocationHandlerAdapter.java	27 Jan 2003 21:55:50 -0000	1.19
  @@ -110,67 +110,78 @@
       public Reply handleInvocation( Request request )
       {
   
  -        if( m_suspend == true )
  +        try
           {
  -            return new SuspendedReply();
  -        }
  -
  -        // Method request is positioned first as
  -        // it is the one we want to be most speedy.
  -        if( request.getRequestCode() == RequestConstants.METHODREQUEST )
  -        {
  -
  -            return doMethodRequest( request );
  -
  -        }
  -        else if( request.getRequestCode() == RequestConstants.METHODFACADEREQUEST )
  -        {
  -            return doMethodFacadeRequest( request );
  -
  -        }
  -        else if( request.getRequestCode() == RequestConstants.METHODASYNCREQUEST )
  -        {
  -            return doMethodAsyncRequest( (MethodAsyncRequest) request );
  -
  -        }
  -        else if( request.getRequestCode() == RequestConstants.GCREQUEST )
  -        {
  -            return doGarbageCollectionRequest( request );
  -
  -        }
  -        else if( request.getRequestCode() == RequestConstants.LOOKUPREQUEST )
  -        {
  -            return doLookupRequest( request );
  -
  -        }
  -        else if( request.getRequestCode() == RequestConstants.CLASSREQUEST )
  -        {
  -            return doClassRequest( request );
  -
  -        }
  -        else if( request.getRequestCode() == RequestConstants.OPENCONNECTIONREQUEST )
  -        {
  -            OpenConnectionRequest openConnectionRequest = (OpenConnectionRequest) request;
  -            return doOpenConnectionRequest(openConnectionRequest.getMachineID());
  -
  -        }
  -        else if( request.getRequestCode() == RequestConstants.PINGREQUEST )
  -        {
  -
  -            // we could communicate back useful state info in this transaction.
  -            return new PingReply();
  -        }
  -        else if( request.getRequestCode() == RequestConstants.LISTREQUEST )
  -        {
  -            return doListRequest();
  -        }
  -        else if(request.getRequestCode()== RequestConstants.LISTMETHODSREQUEST)
  -        {
  -            return doListMethodsRequest(request);
  -        }
  -        else
  -        {
  -            return new RequestFailedReply( "Unknown request :" + request.getClass().getName()
);
  +            if( m_suspend == true )
  +            {
  +                return new SuspendedReply();
  +            }
  +
  +            // Method request is positioned first as
  +            // it is the one we want to be most speedy.
  +            if( request.getRequestCode() == RequestConstants.METHODREQUEST )
  +            {
  +
  +                return doMethodRequest( request );
  +
  +            }
  +            else if( request.getRequestCode() == RequestConstants.METHODFACADEREQUEST )
  +            {
  +                return doMethodFacadeRequest( request );
  +
  +            }
  +            else if( request.getRequestCode() == RequestConstants.METHODASYNCREQUEST )
  +            {
  +                return doMethodAsyncRequest( (MethodAsyncRequest) request );
  +
  +            }
  +            else if( request.getRequestCode() == RequestConstants.GCREQUEST )
  +            {
  +                return doGarbageCollectionRequest( request );
  +
  +            }
  +            else if( request.getRequestCode() == RequestConstants.LOOKUPREQUEST )
  +            {
  +                return doLookupRequest( request );
  +
  +            }
  +            else if( request.getRequestCode() == RequestConstants.CLASSREQUEST )
  +            {
  +                return doClassRequest( request );
  +
  +            }
  +            else if( request.getRequestCode() == RequestConstants.OPENCONNECTIONREQUEST
)
  +            {
  +                OpenConnectionRequest openConnectionRequest = (OpenConnectionRequest) request;
  +                return doOpenConnectionRequest(openConnectionRequest.getMachineID());
  +
  +            }
  +            else if( request.getRequestCode() == RequestConstants.PINGREQUEST )
  +            {
  +
  +                // we could communicate back useful state info in this transaction.
  +                return new PingReply();
  +            }
  +            else if( request.getRequestCode() == RequestConstants.LISTREQUEST )
  +            {
  +                return doListRequest();
  +            }
  +            else if(request.getRequestCode()== RequestConstants.LISTMETHODSREQUEST)
  +            {
  +                return doListMethodsRequest(request);
  +            }
  +            else
  +            {
  +                return new RequestFailedReply( "Unknown request :" + request.getClass().getName()
);
  +            }
  +        }
  +        catch (NullPointerException npe)
  +        {
  +            if (request instanceof MethodRequest)
  +            {
  +                throw new NullPointerException("Null pointer exception, processing method"
+ ((MethodRequest) request).getMethodSignature());
  +            }
  +            throw npe;
           }
       }
   
  
  
  

--
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