Fortunately, the session facades are all created such that they share most of the same methods and I've created some generic interfaces for them to extend so that the Struts actions can invoke those methods at runtime without having to know at compile time which specific type of session EJB they currently are referencing.
I've run into a bit of a problem, though, and I was hoping that someone might have done something similar.
I want to create session EJBs at runtime without knowing what type of session EJB they are at design/compile time. Basically, the JSPs hand a key in with a form that the action forwards to a factory class, which in turn creates the specific type of session EJB and hands it back to the action as some generic interface that all of the session EJBs implement.
At first, I did this by directly instantiating the EJB with <EJB class>.getClass().newInstance() but noticed that all I was doing was bypassing the Home interface (and the container creation of the EJB) because setSessionContext and ejbCreate were not being called. I was also most likely bypassing the container pooling mechanisms and who knows what else...
So I figured that I could change the creation mechanism to invoke the getHome() methods on the utilobject class that XDoclet is generating. The utilobject classes, though, don't extend a common interface -- otherwise, I'd create a factory to generate those and invoke the getHome and then use the Home interfaces to create the EJBs.
Is there a way to tell XDoclet that my generated Util objects should implement a custom interface -- since the utilobjects do all contain the same methods?
Is there a better way to do what I'm trying to? I'd like to use the autogenerated Xdoclet classes/interfaces rather then reinvent the wheel by creating my oen even more generic utilobject if that's possible.
Thanks, Erik
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user