User: starksm 
  Date: 01/11/20 01:42:51

  Modified:    src/main/org/jboss/ejb/plugins/jaws/bmp Tag: Branch_2_4
                        CustomFindByEntitiesCommand.java
  Log:
  Change to the unified log4j based org.jboss.logging.Logger class.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3.4.1   +42 -33    
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.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- CustomFindByEntitiesCommand.java  2001/05/27 00:49:15     1.3
  +++ CustomFindByEntitiesCommand.java  2001/11/20 09:42:51     1.3.4.1
  @@ -30,10 +30,12 @@
    *
    * @see org.jboss.ejb.plugins.jaws.jdbc.JDBCFindEntitiesCommand
    * @author <a href="mailto:[EMAIL PROTECTED]";>Michel de Groot</a>
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.3.4.1 $
    */
   public class CustomFindByEntitiesCommand implements JPMFindEntitiesCommand
   {
  +   static Logger log = Logger.getLogger(CustomFindByEntitiesCommand.class);
  +   
      // Attributes ----------------------------------------------------
      protected Method finderImplMethod;        // method implementing the finder
      
  @@ -41,53 +43,60 @@
      
      // Constructors --------------------------------------------------
      
  -   /** 
  -    * Constructs a JAWS command which can handle multiple entity finders 
  +   /**
  +    * Constructs a JAWS command which can handle multiple entity finders
       * that are BMP implemented.
       * @param finderMethod the EJB finder method implementation
       */
      public CustomFindByEntitiesCommand(Method finderMethod)
  -      throws IllegalArgumentException
  +   throws IllegalArgumentException
      {
  -             finderImplMethod = finderMethod;
  -             // set name for debugging purposes
  -             name = "Custom finder "+finderMethod.getName();
  -
  -             Logger.debug("Finder:"+name);           
  +      finderImplMethod = finderMethod;
  +      // set name for debugging purposes
  +      name = "Custom finder "+finderMethod.getName();
  +      
  +      log.debug("Finder:"+name);
      }
  -   
  -   // JPMFindEntitiesCommand implementation -------------------------
   
  +   // JPMFindEntitiesCommand implementation -------------------------
  +   
      public FinderResults execute(Method finderMethod,
  -                             Object[] args,
  -                             EntityEnterpriseContext ctx)
  +      Object[] args,
  +      EntityEnterpriseContext ctx)
         throws java.rmi.RemoteException, FinderException
      {
         FinderResults result = null;
  -
  +      
         // invoke implementation method on ejb instance
  -      try {
  -             // if expected return type is Collection, return as is
  -             // 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);
  +      try
  +      {
  +         // if expected return type is Collection, return as is
  +         // 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);
  -             } else {
  -                     Collection coll = new ArrayList(1);
  -                     coll.add(finderImplMethod.invoke(ctx.getInstance(),args));
  +         } else
  +         {
  +            Collection coll = new ArrayList(1);
  +            coll.add(finderImplMethod.invoke(ctx.getInstance(),args));
               result = 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());
  +         }
  +      } 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;
      }
  -  
  +   
   }
  
  
  

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

Reply via email to