User: docodan 
  Date: 01/06/04 14:25:41

  Modified:    src/main/org/jboss/ejb/plugins/local
                        BaseLocalContainerInvoker.java
  Log:
  Exception handling added to conform to spec. (Local exceptions in four cases derived 
from EJBException instead of RemoteException.)
  
  Revision  Changes    Path
  1.5       +45 -3     
jboss/src/main/org/jboss/ejb/plugins/local/BaseLocalContainerInvoker.java
  
  Index: BaseLocalContainerInvoker.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/local/BaseLocalContainerInvoker.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BaseLocalContainerInvoker.java    2001/06/03 19:29:05     1.4
  +++ BaseLocalContainerInvoker.java    2001/06/04 21:25:41     1.5
  @@ -25,6 +25,14 @@
   import javax.ejb.EJBMetaData;
   import javax.ejb.EJBLocalHome;
   import javax.ejb.EJBLocalObject;
  +import javax.ejb.AccessLocalException;
  +import java.rmi.AccessException;
  +import javax.ejb.NoSuchObjectLocalException;
  +import java.rmi.NoSuchObjectException;
  +import javax.ejb.TransactionRequiredLocalException;
  +import javax.transaction.TransactionRequiredException;
  +import javax.ejb.TransactionRolledbackLocalException;
  +import javax.transaction.TransactionRolledbackException;
   import javax.naming.Name;
   import javax.naming.InitialContext;
   import javax.naming.Context;
  @@ -194,7 +202,24 @@
         {
            return container.invokeHome(new MethodInvocation(null, m, args, 
               getTransaction(), getPrincipal(), getCredential()));
  -      } finally
  +      }
  +      catch (AccessException ae)
  +      {
  +         throw new AccessLocalException( ae.getMessage(), ae );
  +      }
  +      catch (NoSuchObjectException nsoe)
  +      {
  +         throw new NoSuchObjectLocalException( nsoe.getMessage(), nsoe );
  +      }
  +      catch (TransactionRequiredException tre)
  +      {
  +         throw new TransactionRequiredLocalException( tre.getMessage() );
  +      }
  +      catch (TransactionRolledbackException trbe)
  +      {
  +         throw new TransactionRolledbackLocalException( trbe.getMessage(), trbe );
  +      }
  +      finally
         {
            Thread.currentThread().setContextClassLoader(oldCl);
         }
  @@ -229,7 +254,7 @@
   
      
      /**
  -    *  Invoke a Remote interface method.
  +    *  Invoke a local interface method.
       */
      public Object invoke(Object id, Method m, Object[] args )
      throws Exception
  @@ -242,7 +267,24 @@
         {
            return container.invoke(new MethodInvocation(id, m, args, 
getTransaction(), 
               getPrincipal(), getCredential()));
  -      } finally
  +      }
  +      catch (AccessException ae)
  +      {
  +         throw new AccessLocalException( ae.getMessage(), ae );
  +      }
  +      catch (NoSuchObjectException nsoe)
  +      {
  +         throw new NoSuchObjectLocalException( nsoe.getMessage(), nsoe );
  +      }
  +      catch (TransactionRequiredException tre)
  +      {
  +         throw new TransactionRequiredLocalException( tre.getMessage() );
  +      }
  +      catch (TransactionRolledbackException trbe)
  +      {
  +         throw new TransactionRolledbackLocalException( trbe.getMessage(), trbe );
  +      }
  +      finally
         {
            Thread.currentThread().setContextClassLoader(oldCl);
         }
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to