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;
| }
| };
| }
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4265604#4265604
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4265604
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user