User: dsundstrom
  Date: 01/07/26 14:54:13

  Modified:    src/main/org/jboss/ejb/plugins/cmp/bmp
                        CustomFindByEntitiesCommand.java
  Log:
  Changed finders to allow application exceptions to be passed back to clients
  instead of being wrapped in a FinderException.  This is required by the spec.
  
  The changes is based on patch #437132.
  
  Revision  Changes    Path
  1.2       +9 -7      
jboss/src/main/org/jboss/ejb/plugins/cmp/bmp/CustomFindByEntitiesCommand.java
  
  Index: CustomFindByEntitiesCommand.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/bmp/CustomFindByEntitiesCommand.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CustomFindByEntitiesCommand.java  2001/06/24 03:23:14     1.1
  +++ CustomFindByEntitiesCommand.java  2001/07/26 21:54:13     1.2
  @@ -31,7 +31,7 @@
    *
    * @see org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand
    * @author <a href="mailto:[EMAIL PROTECTED]";>Michel de Groot</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class CustomFindByEntitiesCommand implements FindEntitiesCommand {
        // Attributes ----------------------------------------------------
  @@ -59,7 +59,7 @@
        public FinderResults execute(Method finderMethod,
                        Object[] args,
                        EntityEnterpriseContext ctx)
  -             throws java.rmi.RemoteException, FinderException
  +             throws Exception
        {
                try {
                        // invoke implementation method on ejb instance
  @@ -71,13 +71,15 @@
                                result = Collections.singleton(result);
                        }
                        return new FinderResults((Collection)result, null, null, null);
  -             } catch (IllegalAccessException e1) {
  +             } catch (IllegalAccessException e) {
                        throw new FinderException("Unable to access finder 
implementation: " + finderImplMethod.getName());
  -             } catch (IllegalArgumentException e2) {
  +             } catch (IllegalArgumentException e) {
                        throw new FinderException("Illegal arguments for finder 
implementation: " + finderImplMethod.getName());
  -             } catch (InvocationTargetException e3) {
  -                     throw new FinderException("Exception in finder implementation: 
" + finderImplMethod.getName());
  -             } catch (ExceptionInInitializerError e5) {
  +             } catch (InvocationTargetException e) {
  +                     Throwable target  = e.getTargetException();
  +                     if(target instanceof Exception) {
  +                             throw (Exception)target;
  +                     }
                        throw new FinderException("Unable to initialize finder 
implementation: " + finderImplMethod.getName());
                }
        }
  
  
  

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

Reply via email to