This content has been marked as final.
Show 2 replies
-
1. Re: How to initiate a specific instance?
kabirkhan Aug 12, 2005 11:10 AM (in response to khalidhajsaleh)For cases like this use the @LocalBinding or @RemoteBinding annotation, it allows you to override the default jndi name
http://docs.jboss.org/ejb3/app-server/tutorial/jndibinding/jndi.html -
2. Re: How to initiate a specific instance?
khalidhajsaleh Aug 12, 2005 12:38 PM (in response to khalidhajsaleh)thanks, that works now!
The subclasses:@Stateless @LocalBinding(jndiBinding="custom/1/IDao") public class HsqlDAO implements IDao {} =========== @Stateless @LocalBinding(jndiBinding="custom/2/IDao") public class MysqlDAO implements IDao {}
the parent class:@Local public interface IDao{}
the client:IDao bean, bean2; String enc = "custom/2/IDao"; String enc2="custom/1/IDao"; bean = (IDao)ctx.lookup(enc); bean2 = (IDao)ctx.lookup(enc2);