User: olegnitz
Date: 01/09/01 15:03:14
Modified: src/main/org/jboss/ejb/plugins/cmp/bmp
CustomFindByEntitiesCommand.java
Log:
converted tabs to spaces
Revision Changes Path
1.5 +49 -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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- CustomFindByEntitiesCommand.java 2001/09/01 19:50:30 1.4
+++ CustomFindByEntitiesCommand.java 2001/09/01 22:03:14 1.5
@@ -34,57 +34,57 @@
*
* @see org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand
* @author <a href="mailto:[EMAIL PROTECTED]">Michel de Groot</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
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