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

  Modified:    src/main/org/jboss/ejb/plugins/jaws/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.5       +11 -11    
jboss/src/main/org/jboss/ejb/plugins/jaws/bmp/CustomFindByEntitiesCommand.java
  
  Index: CustomFindByEntitiesCommand.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/jaws/bmp/CustomFindByEntitiesCommand.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CustomFindByEntitiesCommand.java  2001/07/23 04:23:02     1.4
  +++ CustomFindByEntitiesCommand.java  2001/07/26 21:54:14     1.5
  @@ -30,7 +30,7 @@
    *
    * @see org.jboss.ejb.plugins.jaws.jdbc.JDBCFindEntitiesCommand
    * @author <a href="mailto:[EMAIL PROTECTED]";>Michel de Groot</a>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public class CustomFindByEntitiesCommand
      implements JPMFindEntitiesCommand
  @@ -66,9 +66,8 @@
      public FinderResults execute(Method finderMethod,
                                   Object[] args,
                                   EntityEnterpriseContext ctx)
  -      throws java.rmi.RemoteException, FinderException
  +      throws Exception
      {
  -      FinderResults result = null;
   
         // invoke implementation method on ejb instance
         try {
  @@ -76,23 +75,24 @@
            // if expected return type is not Collection, wrap result in Collection
            if (finderMethod.getReturnType().equals(Collection.class))  {
               Collection coll = 
(Collection)finderImplMethod.invoke(ctx.getInstance(),args);
  -            result = new FinderResults(coll, null, null, null);
  +            return new FinderResults(coll, null, null, null);
            } else {
               Collection coll = new ArrayList(1);
               coll.add(finderImplMethod.invoke(ctx.getInstance(),args));
  -            result = new FinderResults(coll, null, null, null);
  +            return new FinderResults(coll, null, null, null);
            }
         } catch (IllegalAccessException e1) {
            throw new FinderException("Unable to access finder 
implementation:"+finderImplMethod.getName());
         } catch (IllegalArgumentException e2) {
            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) {
            throw new FinderException("Unable to initialize finder 
implementation:"+finderImplMethod.getName());
  -      }
  -
  -      return result;
  +             } 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