This content has been marked as final.
Show 5 replies
-
1. Re: Lookup for a session bean if only the interface is given
jaikiran Nov 13, 2009 9:39 AM (in response to juergen.zimmermann)What exactly are you trying to do? Maybe there's a better way to do that.
-
2. Re: Lookup for a session bean if only the interface is given
juergen.zimmermann Nov 13, 2009 12:48 PM (in response to juergen.zimmermann)I'm trying to integrate Jersey with JBossAS. Jersey is an implementation of JAX-RS, and we want to compare RESTEasy and Jersey.
However, Jersey resolves @EJB only for Glassfish. Therefore, I have to implement a class as follows:import java.lang.reflect.Type; ... @Provider public class EJBProvider implements InjectableProvider<EJB, Type> { ... public Injectable<Object> getInjectable(ComponentContext componentCtx, EJB ejb, Type type) { if (!(type instanceof Class<?>)) return null; Class<?> clazz = (Class<?>) type; String interfaceName = clazz.getSimpleName(); ... Object obj = ...; // the session bean being referenced: How to get it? return new Injectable<Object>() { public Object getValue() { return obj; } }; }
-
3. Re: Lookup for a session bean if only the interface is given
jaikiran Nov 16, 2009 8:30 AM (in response to juergen.zimmermann)"Juergen.Zimmermann" wrote:
I'm trying to integrate Jersey with JBossAS. Jersey is an implementation of JAX-RS, and we want to compare RESTEasy and Jersey.
However, Jersey resolves @EJB only for Glassfish. Therefore, I have to implement a class
You have to do similar to what the JBossWS deployer does. See this http://www.jboss.org/index.html?module=bb&op=viewtopic&t=154621 -
4. Re: Lookup for a session bean if only the interface is given
juergen.zimmermann Nov 17, 2009 7:38 AM (in response to juergen.zimmermann)Thank you very much! That's what I was looking for.
Just one question: when doing this in the way described above, how do I get the DeploymentUnit object? Can you give me another hint please? -
5. Re: Lookup for a session bean if only the interface is given
jaikiran Nov 17, 2009 9:10 AM (in response to juergen.zimmermann)"Juergen.Zimmermann" wrote:
Just one question: when doing this in the way described above, how do I get the DeploymentUnit object? Can you give me another hint please?
It's actually the responsibility of the JBoss Microcontainer Virtual Deployment Framework (which is used in the JBoss AS-5), to pass the deployment unit to your deployer. It's easy, but you will need some introduction to the JBoss Microcontainer and the deployment framework.
Here's the MC docs http://www.jboss.org/file-access/default/members/jbossmc/freezone/docs/2.0.x/userGuide/index.html
and the deployment framework chapter http://www.jboss.org/file-access/default/members/jbossmc/freezone/docs/2.0.x/userGuide/pt04.html