Hi Fiorenzo!

Absolutely! This is a great idea :)

To answer your question about the JavaParser, yes, you can add superclasses using one of the following methods:

    javaSource.setSuperType(Class<?> clazz);
    javaSource.setSuperType(String clazz);

https://github.com/forge/core/blob/master/parser-java-api/src/main/java/org/jboss/forge/parser/java/Extendable.java

I hope this helps!

~Lincoln

On Tue, Aug 7, 2012 at 7:12 PM, JFlower <fiorenzino@gmail.com> wrote:
Hi,

i would contribute to jboss-forge, starting from:
https://issues.jboss.org/browse/FORGE-610

I wrote some initial code to model my idea:
https://github.com/fiorenzino/core/blob/FORGE-610/javaee-impl/src/main/java/org/jboss/forge/spec/javaee/ejb/EJBPlugin.java

On default, with new-ejb command you can create an ejb en defining little information (name, package, type):
for me the default ejb created is stateless-localbean.

And after you could add to ejb created some properties:
new-local-interface [@Local()], new-remote-interface [@Remote()}, new interface [ implements.. ], new superclass [ extends...], transaction attribute, inject some class...

[i tried inspiration and i copied some code from jpa plugin]

What do you think about my idea for ejb plugin?

And some question in general:
1) is it possibile to add some superclass using org.jboss.forge.parser.java.JavaClass? how i can do this?
2) how can i add some complex annotation to mdb like:
@MessageDriven(name = "AddressFileParserMDB", activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = AppConstants.ADDRESS_FILE_RESOLVER_Q),
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "1"),
@ActivationConfigProperty(propertyName = "transactionTimeout", propertyValue = "10800"),
@ActivationConfigProperty(propertyName = "dLQMaxResent", propertyValue = "0") 
})

Best Regards,

Fiorenzo


PS: in this period i'm on vacation and i use the computer when my partner gets distracted ..
 

_______________________________________________
forge-dev mailing list
forge-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev




--
Lincoln Baxter, III
http://ocpsoft.org
"Simpler is better."