User: kimptoc 
  Date: 01/09/01 12:50:31

  Modified:    src/main/org/jboss/ejb/plugins/cmp/bmp
                        CustomFindByEntitiesCommand.java
  Log:
  remove deprecated logging import, where possible, otherwise comment as needing 
replacement with log4j.... must find out how it is use.... would be good if the 
deprecation message pointed to an example to use...
  
  Revision  Changes    Path
  1.4       +52 -49    
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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CustomFindByEntitiesCommand.java  2001/08/03 17:15:45     1.3
  +++ CustomFindByEntitiesCommand.java  2001/09/01 19:50:30     1.4
  @@ -17,7 +17,10 @@
   
   import org.jboss.ejb.EntityEnterpriseContext;
   import org.jboss.ejb.plugins.cmp.FindEntitiesCommand;
  +
  +// TODO this needs to be replaced with the log4j logging
   import org.jboss.logging.Logger;
  +
   import org.jboss.metadata.BeanMetaData;
   
   import org.jboss.util.FinderResults;
  @@ -31,57 +34,57 @@
    *
    * @see org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand
    * @author <a href="mailto:[EMAIL PROTECTED]";>Michel de Groot</a>
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    */
   public class CustomFindByEntitiesCommand implements FindEntitiesCommand {
  -     // Attributes ----------------------------------------------------
  +    // Attributes ----------------------------------------------------
   
  -     /**
  -      *  method that implements the finder
  -      */
  -     protected Method finderImplMethod;
  -     
  -     // Constructors --------------------------------------------------
  -     
  -     /** 
  -      * Constructs a command which can handle multiple entity finders 
  -      * that are BMP implemented.
  -      * @param finderMethod the EJB finder method implementation
  -      */
  -     public CustomFindByEntitiesCommand(Method finderMethod) {
  -             finderImplMethod = finderMethod;
  -
  -             Logger.debug("Finder: Custom finder " + finderMethod.getName());       
         
  -     }
  -     
  -     // FindEntitiesCommand implementation -------------------------
  -
  -     public FinderResults execute(Method finderMethod,
  -                     Object[] args,
  -                     EntityEnterpriseContext ctx)
  -             throws Exception
  -     {
  -             try {
  -                     // invoke implementation method on ejb instance
  -                     Object result = finderImplMethod.invoke(ctx.getInstance(), 
args);
  -
  -                     // if expected return type is Collection, return as is
  -                     // if expected return type is not Collection, wrap result in 
Collection
  -                     if(!(result instanceof Collection)) {
  -                             result = Collections.singleton(result);
  -                     }
  -                     return new FinderResults((Collection)result, null, null, null);
  -             } catch (IllegalAccessException e) {
  -                     throw new FinderException("Unable to access finder 
implementation: " + finderImplMethod.getName());
  -             } catch (IllegalArgumentException e) {
  -                     throw new FinderException("Illegal arguments for finder 
implementation: " + finderImplMethod.getName());
  -             } catch (InvocationTargetException e) {
  -                     Throwable target  = e.getTargetException();
  -                     if(target instanceof Exception) {
  -                             throw (Exception)target;
  -                     }
  -                     throw new FinderException("Unable to initialize finder 
implementation: " + finderImplMethod.getName());
  -             }
  -     }
  +    /**
  +     *  method that implements the finder
  +     */
  +    protected Method finderImplMethod;
  +    
  +    // Constructors --------------------------------------------------
  +    
  +    /**
  +     * Constructs a command which can handle multiple entity finders
  +     * that are BMP implemented.
  +     * @param finderMethod the EJB finder method implementation
  +     */
  +    public CustomFindByEntitiesCommand(Method finderMethod) {
  +        finderImplMethod = finderMethod;
  +
  +        Logger.debug("Finder: Custom finder " + finderMethod.getName());            
  +    }
  +    
  +    // FindEntitiesCommand implementation -------------------------
  +
  +    public FinderResults execute(Method finderMethod,
  +            Object[] args,
  +            EntityEnterpriseContext ctx)
  +        throws Exception
  +    {
  +        try {
  +            // invoke implementation method on ejb instance
  +            Object result = finderImplMethod.invoke(ctx.getInstance(), args);
  +
  +            // if expected return type is Collection, return as is
  +            // if expected return type is not Collection, wrap result in Collection
  +            if(!(result instanceof Collection)) {
  +                result = Collections.singleton(result);
  +            }
  +            return new FinderResults((Collection)result, null, null, null);
  +        } catch (IllegalAccessException e) {
  +            throw new FinderException("Unable to access finder implementation: " + 
finderImplMethod.getName());
  +        } catch (IllegalArgumentException e) {
  +            throw new FinderException("Illegal arguments for finder implementation: 
" + finderImplMethod.getName());
  +        } 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]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to