Ben Litchfield wrote:
I know, not a usual thing to do. In my case AntEJB and BearEJB both have exactly the same interface (Animal). And all they do is delegate their methods onto a business bean which implements Animal too. They locate the object to delegate to from a bean factory under the key stored in their environment entry. Thus they have exactly the same functionality and seems wrong to duplicate classes... (especially as I will have around 6 or so types in my particular app).Ah, I thought you meant separate applications. For the same application, I don't think it is directly possible deploy the same bean twice using xdoclet, but I could be wrong.
I am a little unclear as to why you would want to do this in the same application, I have a feeling you are trying to solve a different problem by having two beans deployed, but that is the wrong solution.
Regardless, I would approach this with inheritance, so have an AnimalBeanThe problem with that is that xdoclet only looks for @ejb tags on the class itself and not superclasses. Hence I would have to write each method in AntEJB and BearEJB, each to call their super method and with the @ejb tags. (Well that is how it used to be, but I guess Xdoclet may now support inheritance - anyone know?)
with the methods and then an AntBean/BearBean which extends AnimalBean.
AntBean/BearBean would define the jndi name and whatever customized
properties you want. AntBean/BearBean would probably not have any
methods, but it will accomplish what you want.
Ben Litchfield wrote:
In your EJB declare your jndi like this
@ejb.bean type="Stateless" jndi-name="${jndi-prefix}/UserController"
Then in your build.xml have a property like
<property name="jndi-prefix" value="myfirstApp" />
xdoclet will do a replacement on that value. You would need to set the jndi-prefix value depending on what you wanted the jndi name to be.
Ben
But if I need my Animal EJB to be deploy at:
com/acme/zoo/AntEJB with an environment entry of java:/com/env/who = i-am-an-ant
and also at:
com/acme/zoo/BearEJB with an environment entry of java:/com/env/ = i-am-a-bear
within the same application?
On Thu, 26 Aug 2004, Sean Radford wrote:
Hi,
How can I (of just can I) tell xdoclet that I want one of my ejb's is to be deployed to 2 (or more) different JNDI locations (each with their own environment entries)?
Or do I have to resort to merge-files, and if so can I tell xdoclet to create my ejb's classes but not worry about its deployment descriptor (and leave that just to the merge file)?
Thanks in advance,
Sean
-- Dr. Sean Radford, MBBS, MSc [EMAIL PROTECTED] http://bladesys.demon.co.uk/
------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
-- Dr. Sean Radford, MBBS, MSc [EMAIL PROTECTED] http://bladesys.demon.co.uk/
------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
--
Dr. Sean Radford, MBBS, MSc
[EMAIL PROTECTED]
http://bladesys.demon.co.uk/
------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user