Hi Robert,

First of all, thank you very much for your interest for JOnAS
and for your contribution.

I take the 'spirit' of your contribution and do the fix in the current
version of JOnAS to allow overrides at ANY level.

This fix will be available in the next version of JOnAS (>2.1.2)

Kind regards.
Hélène.

Robert Hubbard wrote:
> 
> GenIC currently outputs duplicate business method calls when overriding
> methods in a bean via inheritance.  I have modified
> org.objectweb.jonas.tools.GenICRemote to at least allow the bean class to
> override any other methods.  A more robust solution would allow overrides at
> any level, but this was enough to get my classes working.  Here are my
> changes to GenICRemote.generate() based on GenICRemote.java version 1.13:
> 
>     /**
>      * Generate the source of the class which implements the Remote
> interface
>      * @param withError the source file is generated with a syntax error
>      *                  (internal use only for test)
>      * @exception GenICException in error case
>      */
>     void generate(boolean withError) throws GenICException {
> 
>         // Declared methods in the Enterprise bean's remote interface;
>         Method methods[];
> 
>         // Comments
>         src.println("//");
>         src.println("// "+wrpRemoteBaseName+".java");
>         src.println("// DO NOT EDIT THIS FILE");
>         src.println("// It is automatically generated via the GenIC tool of
> JOnAS");
>         src.println("//");
>         src.println();
> 
>         // Package clause
>         String s = BeanNaming.getPackageName(ejbRemoteName);
>         if (s.length() != 0) {
>             src.println("package "+s+";");
>         }
>         src.println();
> 
>         // Wrong import clause generation for test only !!!!!
>         if (withError) {
>             src.println("import java.toto.Titi;");
>             src.println();
>         }
> 
>         // Import clauses
>         genImport();
>         src.println();
> 
>         // Class declaration
>         src.println("public class "+wrpRemoteBaseName+
>                     " extends "+getSuperClass()+
>                     " implements "+ejbRemoteName+" {");
>         src.println();
>         src.indentPlus();
> 
>         // Constructor()
>         genConstructor();
>         src.println();
> 
>         // getHandle() Method
>         genGetHandle();
>         src.println();
> 
>         // Business Methods defined in the remote interface
>         methods = ejbRemoteClass.getMethods();
> 
>         // First do functions within this class
>         java.util.Vector vectDoneMethods = new java.util.Vector();
>         for (int m=0; m < methods.length; m++) {
>             Method method = methods[m];
> 
>             if (!method.getDeclaringClass().getName().equals(ejbRemoteName))
>                 continue;
> 
>             // pure business methods
>             if
> (!method.getDeclaringClass().equals(javax.ejb.EJBObject.class)) {
>                 genBussinessMethod(method);
>                 src.println();
>             }
> 
>             // Add to list of processed
>             Class[] params = method.getParameterTypes();
>             String sProcessed = method.getName() + "_" + params.length;
>             for (int nParam=0; nParam<params.length; nParam++)
>             {
>                 sProcessed += "_" + params[nParam].getName();
>             }
>             vectDoneMethods.addElement(sProcessed);
>         }
> 
>         // Now do functions in inherited classes, skipping any that have
> been overridden
>         for (int m=0; m < methods.length; m++) {
>             Method method = methods[m];
> 
>             if (method.getDeclaringClass().getName().equals(ejbRemoteName))
>                 continue;
> 
>             // Skip overridden methods
>             Class[] params = method.getParameterTypes();
>             String sProcessed = method.getName() + "_" + params.length;
>             for (int nParam=0; nParam<params.length; nParam++)
>             {
>                 sProcessed += "_" + params[nParam].getName();
>             }
>             if (vectDoneMethods.contains(sProcessed))
>             {
>                 continue;
>             }
> 
>             if
> (!method.getDeclaringClass().equals(javax.ejb.EJBObject.class)) {
>                 genBussinessMethod(method);
>                 src.println();
>             }
> 
>             // remove (the only EJBObject method to consider)
>             if (method.getName().equals("remove")
>                 &&
> method.getDeclaringClass().equals(javax.ejb.EJBObject.class)) {
>                 genRemove(method);
>                 src.println();
>             }
>         }
> 
>         // End of the Class
>         src.indentMinus();
>         src.println("}");
>         src.println();
> 
>         //
>         src.close();
>     }
> 
> ----
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body of the message "unsubscribe jonas-users".
> For general help, send email to [EMAIL PROTECTED] and
> include in the body of the message "help".

-- 
-=- Hélène JOANIN -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  mailto:[EMAIL PROTECTED]   http://www.evidian.com
  Phone: 33.4.76.29.73.53            Fax: 33.4.76.29.76.00
  Download our EJB Server JOnAS at http://www.objectweb.org
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".

Reply via email to