geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject cvs commit: incubator-geronimo/modules/core/src/java/org/apache/geronimo/remoting/transport FragmentBasedInterceptorRouter.java NullTransportInterceptor.java RemoteTransportInterceptor.java
Date Tue, 26 Aug 2003 22:11:24 GMT
jboynes     2003/08/26 15:11:24

  Modified:    modules/core/src/java/org/apache/geronimo/client
                        MainInvokerInterceptor.java
               modules/core/src/java/org/apache/geronimo/common
                        AbstractInterceptor.java AbstractRPCContainer.java
                        Interceptor.java InvocationResult.java
                        RPCContainer.java SimpleInvocationResult.java
               modules/core/src/java/org/apache/geronimo/ejb
                        CallbackInterceptor.java
                        StatelessLifeCycleInterceptor.java
               modules/core/src/java/org/apache/geronimo/ejb/cache
                        EntityCreationInterceptor.java
                        EntitySynchronizationInterceptor.java
                        StatefulInstanceInterceptor.java
                        StatefulSessionSynchronizationInterceptor.java
                        StatelessInstanceInterceptor.java
               modules/core/src/java/org/apache/geronimo/ejb/context
                        CMTInterceptor.java
                        ExecutionContextInterceptor.java
                        StatefulBMTInterceptor.java
                        StatelessBMTInterceptor.java
                        TransactionInterceptor.java
               modules/core/src/java/org/apache/geronimo/lock
                        LockInterceptor.java
               modules/core/src/java/org/apache/geronimo/naming/java
                        ComponentContextInterceptor.java
               modules/core/src/java/org/apache/geronimo/proxy
                        ReflexiveInterceptor.java SimpleRPCContainer.java
               modules/core/src/java/org/apache/geronimo/remoting
                        DeMarshalingInterceptor.java
                        InterVMRoutingInterceptor.java
                        IntraVMRoutingInterceptor.java
                        MarshalingInterceptor.java
               modules/core/src/java/org/apache/geronimo/remoting/transport
                        FragmentBasedInterceptorRouter.java
                        NullTransportInterceptor.java
                        RemoteTransportInterceptor.java
  Log:
  Change InvocationResult to that it contains application exceptions (as discussed on list)
  Now, both normal return and normal application exceptions flow up the main interceptor chain
  Only system exceptions (RuntimeEx, Error or container thrown exceptions) are thown up the
chain
  As a result, Interceptor.invoke now explicitly throws Throwable not Exception
  
  Revision  Changes    Path
  1.2       +6 -3      incubator-geronimo/modules/core/src/java/org/apache/geronimo/client/MainInvokerInterceptor.java
  
  Index: MainInvokerInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/client/MainInvokerInterceptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MainInvokerInterceptor.java	23 Aug 2003 22:14:20 -0000	1.1
  +++ MainInvokerInterceptor.java	26 Aug 2003 22:11:23 -0000	1.2
  @@ -76,14 +76,17 @@
           this.mainMethod = mainMethod;
       }
   
  -    public InvocationResult invoke(Invocation invocation) throws Exception {
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
           assert (mainMethod.equals(ProxyInvocation.getMethod(invocation)));
           Object[] args = ProxyInvocation.getArguments(invocation);
           try {
               mainMethod.invoke(null, args);
           } catch (InvocationTargetException e) {
               Throwable cause = e.getCause();
  -            return new SimpleInvocationResult(cause);
  +            if (cause instanceof Exception && cause instanceof RuntimeException
== false) {
  +                return new SimpleInvocationResult((Exception)cause);
  +            }
  +            throw cause;
           }
           return new SimpleInvocationResult(null);
       }
  
  
  
  1.8       +2 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/common/AbstractInterceptor.java
  
  Index: AbstractInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/common/AbstractInterceptor.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AbstractInterceptor.java	23 Aug 2003 22:09:39 -0000	1.7
  +++ AbstractInterceptor.java	26 Aug 2003 22:11:23 -0000	1.8
  @@ -85,5 +85,5 @@
           next = nextInterceptor;
       }
   
  -    public abstract InvocationResult invoke(Invocation invocation) throws Exception;
  +    public abstract InvocationResult invoke(Invocation invocation) throws Throwable;
   }
  
  
  
  1.8       +2 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/common/AbstractRPCContainer.java
  
  Index: AbstractRPCContainer.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/common/AbstractRPCContainer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AbstractRPCContainer.java	23 Aug 2003 22:09:39 -0000	1.7
  +++ AbstractRPCContainer.java	26 Aug 2003 22:11:23 -0000	1.8
  @@ -82,7 +82,7 @@
           super.postDeregister();
       }
   
  -    public final InvocationResult invoke(Invocation invocation) throws Exception {
  +    public final InvocationResult invoke(Invocation invocation) throws Throwable {
           if (getStateInstance() != State.RUNNING) {
               throw new IllegalStateException("invoke can only be called after the Container
has started");
           }
  
  
  
  1.4       +4 -4      incubator-geronimo/modules/core/src/java/org/apache/geronimo/common/Interceptor.java
  
  Index: Interceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/common/Interceptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Interceptor.java	22 Aug 2003 02:08:41 -0000	1.3
  +++ Interceptor.java	26 Aug 2003 22:11:23 -0000	1.4
  @@ -84,8 +84,8 @@
        * in the chain.
        *
        * @param invocation the invocation for which work will be done
  -     * @return the result of the invocation
  -     * @throws Exception if an exception occures while doing the work
  +     * @return the result of the invocation (includes return or application Exception)
  +     * @throws Throwable if a system exception occures while doing the work
        */
  -    InvocationResult invoke(Invocation invocation) throws Exception;
  +    InvocationResult invoke(Invocation invocation) throws Throwable;
   }
  
  
  
  1.3       +39 -4     incubator-geronimo/modules/core/src/java/org/apache/geronimo/common/InvocationResult.java
  
  Index: InvocationResult.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/common/InvocationResult.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- InvocationResult.java	11 Aug 2003 17:59:10 -0000	1.2
  +++ InvocationResult.java	26 Aug 2003 22:11:23 -0000	1.3
  @@ -56,13 +56,48 @@
   package org.apache.geronimo.common;
   
   /**
  - *
  - *
  + * The result of an Invocation.
  + * There are two types of result:
  + * <ul>
  + * <li>normal - indicating the operation completed normally (e.g. the method returned)</li>
  + * <li>exception - indicating the operation completed abnormally (e.g. the method
threw a checked exception)</li>
  + * </ul>
  + * <p>Note that these should both be considered a normal completion of the operation
by the container. Abnormal
  + * completions, such as a RuntimeException or Error from the invocation, or any problem
in the interceptor
  + * chain itself, should result in a Throwable being thrown up the chain rather than being
contained in this
  + * result.</p>
  + * <p>This distinction mirrors the semantics for EJB invocations, where a business
method is considered to have
  + * completed successfuly even if it throws declared Exception - the Exception there is
indicating a business level
  + * issue and not a system problem.</p>
    *
    * @version $Revision$ $Date$
    */
   public interface InvocationResult {
  +    /**
  +     * Was this a normal completion (return)?
  +     * @return true if the invocation returned; false if a declared exception was thrown
  +     */
  +    boolean isNormal();
  +
  +    /**
  +     * Get the return value from the invocation.
  +     * It is an error to call this method if the invocation is not complete normally.
  +     * @return the return value from the invocation; null if the operation was void
  +     */
       Object getResult();
   
  -    void setResult(Object result);
  +    /**
  +     * Was an application exception raised by the invocation?
  +     * Note, this indicates a checked application exception was thrown; this will never
contain
  +     * a system exception
  +     * @return true if a declared exception was thrown; false if the invocation returned
  +     */
  +    boolean isException();
  +
  +    /**
  +     * Get the application exception raised by the invocation.
  +     * It is an error to call this method if the invocation did not raise an exception
  +     * @return the checked Exception raised by the application
  +     */
  +    Exception getException();
   }
  
  
  
  1.2       +3 -3      incubator-geronimo/modules/core/src/java/org/apache/geronimo/common/RPCContainer.java
  
  Index: RPCContainer.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/common/RPCContainer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RPCContainer.java	15 Aug 2003 14:11:26 -0000	1.1
  +++ RPCContainer.java	26 Aug 2003 22:11:23 -0000	1.2
  @@ -71,12 +71,12 @@
       //
       //  Main entry point
       //
  -    InvocationResult invoke(Invocation invocation) throws Exception;
  +    InvocationResult invoke(Invocation invocation) throws Throwable;
   
   
       /**
        * Add an interceptor to the interceptor stack
  -     * @param Interceptor
  +     * @param interceptor
        */
       void addInterceptor (Interceptor interceptor);
   
  
  
  
  1.4       +21 -7     incubator-geronimo/modules/core/src/java/org/apache/geronimo/common/SimpleInvocationResult.java
  
  Index: SimpleInvocationResult.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/common/SimpleInvocationResult.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SimpleInvocationResult.java	22 Aug 2003 02:08:41 -0000	1.3
  +++ SimpleInvocationResult.java	26 Aug 2003 22:11:23 -0000	1.4
  @@ -64,20 +64,34 @@
    * @version $Revision$ $Date$
    */
   public class SimpleInvocationResult implements InvocationResult, Serializable {
  -    private Object result;
  -
  -    public SimpleInvocationResult() {
  -    }
  +    private final Object result;
  +    private final boolean normal;
   
       public SimpleInvocationResult(Object result) {
           this.result = result;
  +        normal = true;
  +    }
  +
  +    public SimpleInvocationResult(Exception appException) {
  +        this.result = appException;
  +        this.normal = false;
  +    }
  +
  +    public boolean isNormal() {
  +        return normal;
  +    }
  +
  +    public boolean isException() {
  +        return !normal;
       }
   
       public Object getResult() {
  +        assert (normal == true);
           return result;
       }
   
  -    public void setResult(Object result) {
  -        this.result = result;
  +    public Exception getException() {
  +        assert (normal == false);
  +        return (Exception) result;
       }
   }
  
  
  
  1.6       +2 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/CallbackInterceptor.java
  
  Index: CallbackInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/CallbackInterceptor.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CallbackInterceptor.java	23 Aug 2003 22:09:39 -0000	1.5
  +++ CallbackInterceptor.java	26 Aug 2003 22:11:23 -0000	1.6
  @@ -77,7 +77,7 @@
    * @version $Revision$ $Date$
    */
   public final class CallbackInterceptor extends AbstractInterceptor {
  -    public InvocationResult invoke(Invocation invocation) throws Exception {
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
           // Instance
           EnterpriseContext ctx = EJBInvocationUtil.getEnterpriseContext(invocation);
           if (ctx == null) {
  
  
  
  1.7       +3 -3      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/StatelessLifeCycleInterceptor.java
  
  Index: StatelessLifeCycleInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/StatelessLifeCycleInterceptor.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- StatelessLifeCycleInterceptor.java	23 Aug 2003 22:09:39 -0000	1.6
  +++ StatelessLifeCycleInterceptor.java	26 Aug 2003 22:11:23 -0000	1.7
  @@ -107,7 +107,7 @@
           createLocal = null;
       }
   
  -    public InvocationResult invoke(Invocation invocation) throws Exception {
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
           Method method = EJBInvocationUtil.getMethod(invocation);
           if (method == null) {
               return getNext().invoke(invocation);
  @@ -115,7 +115,7 @@
   
           if (method.equals(removeRemote) || method.equals(removeLocal)) {
               // remove for a stateless bean does nothing
  -            return new SimpleInvocationResult();
  +            return new SimpleInvocationResult(null);
           } else if (method.equals(createRemote)) {
               EJBProxyFactoryManager ejbProxyFactoryManager = EJBPlugins.getEJBProxyFactoryManager(getContainer());
               EJBProxyFactory ejbProxyFactory = ejbProxyFactoryManager.getThreadEJBProxyFactory();
  
  
  
  1.4       +2 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/EntityCreationInterceptor.java
  
  Index: EntityCreationInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/EntityCreationInterceptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EntityCreationInterceptor.java	11 Aug 2003 17:59:11 -0000	1.3
  +++ EntityCreationInterceptor.java	26 Aug 2003 22:11:23 -0000	1.4
  @@ -72,7 +72,7 @@
    * @version $Revision$ $Date$
    */
   public final class EntityCreationInterceptor extends AbstractInterceptor {
  -    public InvocationResult invoke(Invocation invocation) throws Exception {
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
           InvocationResult result = getNext().invoke(invocation);
   
           InvocationType type = InvocationType.getType(invocation);
  
  
  
  1.4       +2 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/EntitySynchronizationInterceptor.java
  
  Index: EntitySynchronizationInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/EntitySynchronizationInterceptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EntitySynchronizationInterceptor.java	11 Aug 2003 17:59:11 -0000	1.3
  +++ EntitySynchronizationInterceptor.java	26 Aug 2003 22:11:23 -0000	1.4
  @@ -72,7 +72,7 @@
       // todo find a home for me... should be a JMX object
       private static final SynchronizationRegistry synchronizationRegistry = new SynchronizationRegistry();
   
  -    public InvocationResult invoke(Invocation invocation) throws Exception {
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
           // register the context for synchronization
           EnterpriseContext ctx = EJBInvocationUtil.getEnterpriseContext(invocation);
           Object id = EJBInvocationUtil.getId(invocation);
  
  
  
  1.8       +2 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/StatefulInstanceInterceptor.java
  
  Index: StatefulInstanceInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/StatefulInstanceInterceptor.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- StatefulInstanceInterceptor.java	23 Aug 2003 22:09:39 -0000	1.7
  +++ StatefulInstanceInterceptor.java	26 Aug 2003 22:11:23 -0000	1.8
  @@ -96,7 +96,7 @@
           pool = null;
       }
   
  -    public InvocationResult invoke(Invocation invocation) throws Exception {
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
           EnterpriseContext ctx;
           Object id = null;
   
  
  
  
  1.7       +2 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/StatefulSessionSynchronizationInterceptor.java
  
  Index: StatefulSessionSynchronizationInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/StatefulSessionSynchronizationInterceptor.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- StatefulSessionSynchronizationInterceptor.java	23 Aug 2003 22:09:39 -0000	1.6
  +++ StatefulSessionSynchronizationInterceptor.java	26 Aug 2003 22:11:23 -0000	1.7
  @@ -102,7 +102,7 @@
           tm = null;
       }
   
  -    public InvocationResult invoke(Invocation invocation) throws Exception {
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
           if (InvocationType.getType(invocation).isHomeInvocation()) {
               // Home invocation's don't have state so they don't need to be synchronized
               return getNext().invoke(invocation);
  
  
  
  1.7       +2 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/StatelessInstanceInterceptor.java
  
  Index: StatelessInstanceInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/StatelessInstanceInterceptor.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- StatelessInstanceInterceptor.java	23 Aug 2003 22:09:39 -0000	1.6
  +++ StatelessInstanceInterceptor.java	26 Aug 2003 22:11:23 -0000	1.7
  @@ -86,7 +86,7 @@
           pool = null;
       }
   
  -    public InvocationResult invoke(final Invocation invocation) throws Exception {
  +    public InvocationResult invoke(final Invocation invocation) throws Throwable {
           if (InvocationType.getType(invocation).isHomeInvocation()) {
               // Stateless home invocations don't call on an instance
               return getNext().invoke(invocation);
  
  
  
  1.7       +23 -53    incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/context/CMTInterceptor.java
  
  Index: CMTInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/context/CMTInterceptor.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- CMTInterceptor.java	23 Aug 2003 09:07:11 -0000	1.6
  +++ CMTInterceptor.java	26 Aug 2003 22:11:23 -0000	1.7
  @@ -68,7 +68,6 @@
   import org.apache.geronimo.common.Invocation;
   import org.apache.geronimo.common.InvocationResult;
   import org.apache.geronimo.common.InvocationType;
  -import org.apache.geronimo.common.RPCContainer;
   import org.apache.geronimo.ejb.EJBInvocationUtil;
   import org.apache.geronimo.ejb.container.EJBPlugins;
   import org.apache.geronimo.ejb.metadata.EJBMetadata;
  @@ -87,7 +86,7 @@
   
       protected void doStart() throws Exception {
           super.doStart();
  -        ejbMetadata = EJBPlugins.getEJBMetadata((RPCContainer)getContainer());
  +        ejbMetadata = EJBPlugins.getEJBMetadata(getContainer());
       }
   
       protected void doStop() throws Exception {
  @@ -95,7 +94,7 @@
           super.doStop();
       }
   
  -    public InvocationResult invoke(Invocation invocation) throws Exception {
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
           Method m = EJBInvocationUtil.getMethod(invocation);
           if (m == null) {
               // we are not invoking a method (e.g. its a CMR message) so pass straight through
  @@ -174,7 +173,7 @@
        * @throws Exception from the next interceptor
        * @throws EJBTransactionException if there was a problem interacting with the TransactionManager
        */
  -    private InvocationResult newTxContext(Invocation invocation, Transaction oldTransaction)
throws EJBTransactionException, Exception {
  +    private InvocationResult newTxContext(Invocation invocation, Transaction oldTransaction)
throws EJBTransactionException, Throwable {
           if (oldTransaction == null) {
               // we have no transaction, start the new one
               return invokeWithNewTx(invocation);
  @@ -194,10 +193,10 @@
        * There must not be a Transaction currently associated with the Thread
        * @param invocation the invocation to pass down
        * @return the result from the interceptor
  -     * @throws Exception from the next interceptor
  +     * @throws Throwable from the next interceptor
        * @throws EJBTransactionException if there was a problem interacting with the TransactionManager
        */
  -    private InvocationResult invokeWithNewTx(Invocation invocation) throws Exception {
  +    private InvocationResult invokeWithNewTx(Invocation invocation) throws Throwable {
           TxExecutionContext newContext = new TxExecutionContext(tm);
           InvocationResult result;
           try {
  @@ -209,37 +208,17 @@
   
           try {
               result = invokeNext(newContext, invocation);
  -        } catch (Error e) {
  -            systemException(newContext, e);
  -            throw e;
  -        } catch (RuntimeException e) {
  -            systemException(newContext, e);
  -            throw e;
  -        } catch (RemoteException e) {
  -            systemException(newContext, e);
  -            throw e;
  -        } catch (Exception e) {
  -            // application exception
               endTransaction(invocation, newContext);
  -            throw e;
  -        }
  -        endTransaction(invocation, newContext);
  -        return result;
  -    }
  -
  -    /**
  -     * Handle a system exception returned by the interceptor chain
  -     * @param newContext the current execution context
  -     * @param t the system exception
  -     */
  -    private void systemException(TxExecutionContext newContext, Throwable t) {
  -        try {
  -            tm.setRollbackOnly();
  -            tm.rollback();
  -        } catch (SystemException e) {
  -            log.error("Unable to roll back after system exception, continuing", e);
  -        } finally {
  +            return result;
  +        } catch (Throwable t) {
  +            try {
  +                tm.setRollbackOnly();
  +                tm.rollback();
  +            } catch (SystemException e) {
  +                log.error("Unable to roll back after system exception, continuing", e);
  +            }
               newContext.abnormalTermination(t);
  +            throw t;
           }
       }
   
  @@ -276,7 +255,7 @@
        * @throws Exception from the next interceptor
        * @throws EJBTransactionException if there was a problem interacting with the TransactionManager
        */
  -    private InvocationResult noTxContext(Invocation invocation, Transaction oldTransaction)
throws EJBTransactionException, Exception {
  +    private InvocationResult noTxContext(Invocation invocation, Transaction oldTransaction)
throws EJBTransactionException, Throwable {
           if (oldTransaction == null) {
               // we have no transaction, so just invoke
               return invokeWithNoTx(invocation);
  @@ -297,24 +276,15 @@
        * @return the result from the interceptor
        * @throws Exception from the next interceptor
        */
  -    private InvocationResult invokeWithNoTx(Invocation invocation) throws Exception {
  +    private InvocationResult invokeWithNoTx(Invocation invocation) throws Throwable {
           NoTxExecutionContext newContext = new NoTxExecutionContext();
           try {
  -            return invokeNext(newContext, invocation);
  -        } catch (Error e) {
  -            newContext.abnormalTermination(e);
  -            throw e;
  -        } catch (RuntimeException e) {
  -            newContext.abnormalTermination(e);
  -            throw e;
  -        } catch (RemoteException e) {
  -            newContext.abnormalTermination(e);
  -            throw e;
  -        } catch (Exception e) {
  -            newContext.normalTermination();
  -            throw e;
  -        } finally {
  +            InvocationResult result = invokeNext(newContext, invocation);
               newContext.normalTermination();
  +            return result;
  +        } catch (Throwable t) {
  +            newContext.abnormalTermination(t);
  +            throw t;
           }
       }
   
  @@ -327,7 +297,7 @@
        * @throws Exception from the next interceptor
        * @throws EJBTransactionException if we could not register a new TxExecutionContext
with the TransactionManager
        */
  -    private InvocationResult sameTxContext(Invocation invocation, Transaction oldTransaction)
throws EJBTransactionException, Exception {
  +    private InvocationResult sameTxContext(Invocation invocation, Transaction oldTransaction)
throws EJBTransactionException, Throwable {
           TxExecutionContext context = TxExecutionContext.getContext(oldTransaction);
           if (context == null) {
               assert oldTransaction != null;
  
  
  
  1.6       +2 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/context/ExecutionContextInterceptor.java
  
  Index: ExecutionContextInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/context/ExecutionContextInterceptor.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ExecutionContextInterceptor.java	23 Aug 2003 22:09:39 -0000	1.5
  +++ ExecutionContextInterceptor.java	26 Aug 2003 22:11:23 -0000	1.6
  @@ -88,7 +88,7 @@
        * @return the result of the invocation
        * @throws java.lang.Exception any Exception from the next interceptor
        */
  -    protected InvocationResult invokeNext(ExecutionContext context, Invocation invocation)
throws Exception {
  +    protected InvocationResult invokeNext(ExecutionContext context, Invocation invocation)
throws Throwable {
           ExecutionContext.push(context);
           try {
               return getNext().invoke(invocation);
  
  
  
  1.5       +7 -23     incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/context/StatefulBMTInterceptor.java
  
  Index: StatefulBMTInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/context/StatefulBMTInterceptor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StatefulBMTInterceptor.java	23 Aug 2003 09:07:11 -0000	1.4
  +++ StatefulBMTInterceptor.java	26 Aug 2003 22:11:23 -0000	1.5
  @@ -55,7 +55,6 @@
    */
   package org.apache.geronimo.ejb.context;
   
  -import java.rmi.RemoteException;
   import java.util.HashMap;
   import java.util.Map;
   import javax.ejb.EJBException;
  @@ -76,7 +75,7 @@
   public final class StatefulBMTInterceptor extends ExecutionContextInterceptor {
       private final static Map savedTransactions = new HashMap();
   
  -    public InvocationResult invoke(Invocation invocation) throws Exception {
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
           InvocationResult result;
           Object id = EJBInvocationUtil.getId(invocation);
           // suspend any transaction supplied by the client
  @@ -93,30 +92,15 @@
                       suspendInstanceTx(id);
                       assert getTransaction() == null;
                   }
  -            } catch (Error e) {
  -                // system exception
  -                ExecutionContext.pop(noTxContext);
  -                noTxContext.abnormalTermination(e);
  -                throw e;
  -            } catch (RuntimeException e) {
  -                // system exception
                   ExecutionContext.pop(noTxContext);
  -                noTxContext.abnormalTermination(e);
  -                throw e;
  -            } catch (RemoteException e) {
  +                noTxContext.normalTermination();
  +                return result;
  +            } catch (Throwable t) {
                   // system exception
                   ExecutionContext.pop(noTxContext);
  -                noTxContext.abnormalTermination(e);
  -                throw e;
  -            } catch (Exception e) {
  -                // application exception
  -                ExecutionContext.pop(noTxContext);
  -                noTxContext.normalTermination();
  -                throw e;
  +                noTxContext.abnormalTermination(t);
  +                throw t;
               }
  -            ExecutionContext.pop(noTxContext);
  -            noTxContext.normalTermination();
  -            return result;
           } finally {
               if (oldTransaction != null) {
                   // resume original transaction from client
  
  
  
  1.8       +8 -20     incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/context/StatelessBMTInterceptor.java
  
  Index: StatelessBMTInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/context/StatelessBMTInterceptor.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- StatelessBMTInterceptor.java	23 Aug 2003 22:09:39 -0000	1.7
  +++ StatelessBMTInterceptor.java	26 Aug 2003 22:11:23 -0000	1.8
  @@ -64,7 +64,6 @@
   import org.apache.geronimo.common.Invocation;
   import org.apache.geronimo.common.InvocationResult;
   import org.apache.geronimo.common.InvocationType;
  -import org.apache.geronimo.common.RPCContainer;
   import org.apache.geronimo.ejb.container.EJBPlugins;
   
   /**
  @@ -81,7 +80,7 @@
           ejbName = EJBPlugins.getEJBMetadata(getContainer()).getName();
       }
   
  -    public InvocationResult invoke(Invocation invocation) throws Exception {
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
           // suspend any transaction supplied by the client
           Transaction oldTransaction = suspend();
           InvocationResult result;
  @@ -94,26 +93,15 @@
                   } finally {
                       checkStatelessCompletion(noTxContext, invocation);
                   }
  -            } catch (Error e) {
  -                ExecutionContext.pop(noTxContext);
  -                noTxContext.abnormalTermination(e);
  -                throw e;
  -            } catch (RuntimeException e) {
  -                ExecutionContext.pop(noTxContext);
  -                noTxContext.abnormalTermination(e);
  -                throw e;
  -            } catch (RemoteException e) {
  -                ExecutionContext.pop(noTxContext);
  -                noTxContext.abnormalTermination(e);
  -                throw e;
  -            } catch (Exception e) {
                   ExecutionContext.pop(noTxContext);
                   noTxContext.normalTermination();
  -                throw e;
  +                return result;
  +            } catch (Throwable t) {
  +                // system exception
  +                ExecutionContext.pop(noTxContext);
  +                noTxContext.abnormalTermination(t);
  +                throw t;
               }
  -            ExecutionContext.pop(noTxContext);
  -            noTxContext.normalTermination();
  -            return result;
           } finally {
               if (oldTransaction != null) {
                   // resume original transaction from client
  
  
  
  1.12      +2 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/context/TransactionInterceptor.java
  
  Index: TransactionInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/context/TransactionInterceptor.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- TransactionInterceptor.java	23 Aug 2003 22:09:39 -0000	1.11
  +++ TransactionInterceptor.java	26 Aug 2003 22:11:23 -0000	1.12
  @@ -88,7 +88,7 @@
           transactionInterceptor = null;
       }
   
  -    public InvocationResult invoke(Invocation invocation) throws Exception {
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
           return transactionInterceptor.invoke(invocation);
       }
   }
  
  
  
  1.8       +2 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/lock/LockInterceptor.java
  
  Index: LockInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/lock/LockInterceptor.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- LockInterceptor.java	23 Aug 2003 22:09:39 -0000	1.7
  +++ LockInterceptor.java	26 Aug 2003 22:11:24 -0000	1.8
  @@ -84,7 +84,7 @@
           lockDomain = null;
       }
   
  -    public InvocationResult invoke(Invocation invocation) throws Exception {
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
           InvocationType type = InvocationType.getType(invocation);
           if (org.apache.geronimo.ejb.Entrancy.isNonEntrant(invocation)) {
               return getNext().invoke(invocation);
  
  
  
  1.2       +2 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/naming/java/ComponentContextInterceptor.java
  
  Index: ComponentContextInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/naming/java/ComponentContextInterceptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ComponentContextInterceptor.java	23 Aug 2003 22:13:15 -0000	1.1
  +++ ComponentContextInterceptor.java	26 Aug 2003 22:11:24 -0000	1.2
  @@ -78,7 +78,7 @@
           this.compContext = compContext;
       }
   
  -    public InvocationResult invoke(Invocation invocation) throws Exception {
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
           Context oldContext = RootContext.getComponentContext();
           try {
               RootContext.setComponentContext(compContext);
  
  
  
  1.2       +6 -8      incubator-geronimo/modules/core/src/java/org/apache/geronimo/proxy/ReflexiveInterceptor.java
  
  Index: ReflexiveInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/proxy/ReflexiveInterceptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ReflexiveInterceptor.java	22 Aug 2003 02:23:25 -0000	1.1
  +++ ReflexiveInterceptor.java	26 Aug 2003 22:11:24 -0000	1.2
  @@ -77,7 +77,7 @@
       /* (non-Javadoc)
        * @see org.apache.geronimo.common.AbstractInterceptor#invoke(org.apache.geronimo.common.Invocation)
        */
  -    public InvocationResult invoke(Invocation invocation) throws Exception {
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
           try {
   
               Method m = ProxyInvocation.getMethod(invocation);
  @@ -86,13 +86,11 @@
               return new SimpleInvocationResult(rc);
   
           } catch (InvocationTargetException e) {
  -            Throwable t = e.getTargetException();
  -            if (t instanceof Exception) {
  -                throw (Exception) t;
  -            } else if (t instanceof Error) {
  -                throw (Error) t;
  +            Throwable t = e.getCause();
  +            if (t instanceof Exception && t instanceof RuntimeException == false)
{
  +                return new SimpleInvocationResult((Exception)t);
               } else {
  -                throw new Error("Unexpected Throwable", t);
  +                throw t;
               }
           }
       }
  
  
  
  1.2       +2 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/proxy/SimpleRPCContainer.java
  
  Index: SimpleRPCContainer.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/proxy/SimpleRPCContainer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SimpleRPCContainer.java	22 Aug 2003 02:23:25 -0000	1.1
  +++ SimpleRPCContainer.java	26 Aug 2003 22:11:24 -0000	1.2
  @@ -80,7 +80,7 @@
       /**
       * @see org.apache.geronimo.common.RPCContainer#invoke(org.apache.geronimo.common.Invocation)
       */
  -    public final InvocationResult invoke(Invocation invocation) throws Exception {
  +    public final InvocationResult invoke(Invocation invocation) throws Throwable {
           return firstInterceptor.invoke(invocation);
       }
   
  
  
  
  1.2       +2 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/remoting/DeMarshalingInterceptor.java
  
  Index: DeMarshalingInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/remoting/DeMarshalingInterceptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DeMarshalingInterceptor.java	22 Aug 2003 02:23:26 -0000	1.1
  +++ DeMarshalingInterceptor.java	26 Aug 2003 22:11:24 -0000	1.2
  @@ -94,7 +94,7 @@
       /**
        * @see org.apache.geronimo.common.AbstractInterceptor#invoke(org.apache.geronimo.common.Invocation)
        */
  -    public InvocationResult invoke(Invocation invocation) throws Exception {
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
           Thread currentThread = Thread.currentThread();
           ClassLoader orig = currentThread.getContextClassLoader();
           try {
  
  
  
  1.2       +2 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/remoting/InterVMRoutingInterceptor.java
  
  Index: InterVMRoutingInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/remoting/InterVMRoutingInterceptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InterVMRoutingInterceptor.java	22 Aug 2003 02:23:26 -0000	1.1
  +++ InterVMRoutingInterceptor.java	26 Aug 2003 22:11:24 -0000	1.2
  @@ -77,7 +77,7 @@
       /**
        * @see org.apache.geronimo.common.AbstractInterceptor#invoke(org.apache.geronimo.common.Invocation)
        */
  -    public InvocationResult invoke(Invocation invocation) throws Exception {
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
           return next.invoke(invocation);
       }
   
  
  
  
  1.2       +2 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/remoting/IntraVMRoutingInterceptor.java
  
  Index: IntraVMRoutingInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/remoting/IntraVMRoutingInterceptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- IntraVMRoutingInterceptor.java	22 Aug 2003 02:23:26 -0000	1.1
  +++ IntraVMRoutingInterceptor.java	26 Aug 2003 22:11:24 -0000	1.2
  @@ -76,7 +76,7 @@
       /**
        * @see org.apache.geronimo.common.AbstractInterceptor#invoke(org.apache.geronimo.common.Invocation)
        */
  -    public InvocationResult invoke(Invocation invocation) throws Exception {
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
           if (next == null)
               resolveNext();
           return next.invoke(invocation);
  
  
  
  1.2       +2 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/remoting/MarshalingInterceptor.java
  
  Index: MarshalingInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/remoting/MarshalingInterceptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MarshalingInterceptor.java	22 Aug 2003 02:23:26 -0000	1.1
  +++ MarshalingInterceptor.java	26 Aug 2003 22:11:24 -0000	1.2
  @@ -71,7 +71,7 @@
       /**
        * @see org.apache.geronimo.common.AbstractInterceptor#invoke(org.apache.geronimo.common.Invocation)
        */
  -    public InvocationResult invoke(Invocation invocation) throws Exception {
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
   
           // Marshall the invocation and store it.
           MarshalledObject mo = next.createMarshalledObject();
  
  
  
  1.2       +4 -4      incubator-geronimo/modules/core/src/java/org/apache/geronimo/remoting/transport/FragmentBasedInterceptorRouter.java
  
  Index: FragmentBasedInterceptorRouter.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/remoting/transport/FragmentBasedInterceptorRouter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FragmentBasedInterceptorRouter.java	22 Aug 2003 02:23:26 -0000	1.1
  +++ FragmentBasedInterceptorRouter.java	26 Aug 2003 22:11:24 -0000	1.2
  @@ -88,7 +88,7 @@
               msg.pushMarshaledObject((MarshalledObject) result.getResult());
               return msg;
   
  -        } catch (Exception e) {
  +        } catch (Throwable e) {
               e.printStackTrace();
               throw new TransportException(e.getMessage());
           }
  @@ -107,13 +107,13 @@
   
               InvocationResult result = interceptor.invoke(invocation);
   
  -        } catch (Exception e) {
  +        } catch (Throwable e) {
               throw new TransportException(e.getMessage());
           }
       }
   
       /**
  -     * @param string
  +     * @param to
        * @return
        */
       private Interceptor lookupInterceptorFrom(URI to) {
  
  
  
  1.2       +2 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/remoting/transport/NullTransportInterceptor.java
  
  Index: NullTransportInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/remoting/transport/NullTransportInterceptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NullTransportInterceptor.java	22 Aug 2003 02:23:26 -0000	1.1
  +++ NullTransportInterceptor.java	26 Aug 2003 22:11:24 -0000	1.2
  @@ -71,7 +71,7 @@
       /**
        * @see org.apache.geronimo.common.AbstractInterceptor#invoke(org.apache.geronimo.common.Invocation)
        */
  -    public InvocationResult invoke(Invocation invocation) throws Exception {
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
           return getNext().invoke(invocation);
       }
   
  
  
  
  1.2       +2 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/remoting/transport/RemoteTransportInterceptor.java
  
  Index: RemoteTransportInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/remoting/transport/RemoteTransportInterceptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RemoteTransportInterceptor.java	22 Aug 2003 02:23:26 -0000	1.1
  +++ RemoteTransportInterceptor.java	26 Aug 2003 22:11:24 -0000	1.2
  @@ -83,7 +83,7 @@
       /**
        * @see org.apache.geronimo.common.AbstractInterceptor#invoke(org.apache.geronimo.common.Invocation)
        */
  -    public InvocationResult invoke(Invocation invocation) throws Exception {
  +    public InvocationResult invoke(Invocation invocation) throws Throwable {
   
           MarshalledObject mo = InvocationSupport.getMarshaledValue(invocation);
           // URI remoteURI = InvocationSupport.getRemoteURI(invocation);
  
  
  

Mime
View raw message