This content has been marked as final.
Show 3 replies
-
1. Re: Seam Component used as "standard EJB"
serkan.s.eskici.online.nl Jul 16, 2010 3:41 PM (in response to salvino)You can try out something like this:
Scope(STATELESS) @Name("remoteEJBClient" public class YourEJBRemoteClient { //@Out(scope=STATELESS) or try to outject in some scope and use it as a component private EJBRemote remoteEJB; @Create public void init() { this.remoteEJB = //do a JNDI lookup; } @Unwrap public EJBRemote getRemoteEJB() { return this.remoteEJB; } }
Thus use either @Unwrap or @Factory in combination with @Out putting the component in some scope.
-
2. Re: Seam Component used as "standard EJB"
salvino Jul 19, 2010 11:16 AM (in response to salvino)I see your point, but it's not what I was looking for (maybe I didn't have been clear enough)
What I'm trying to do is the opposite (but it should work nearly the same)
I already have some seam components and I wanted to reach them form another web app as if they were standard EJB3..
I made something like this :
My Seam component that I want to reach from the outside :
@Stateless @Name("myBeanHome") @JndiName("MyApp/MyBean/remote") public class MyBeanHome implements MyBeanRemote { @Remove public void destroy(){} ....
The Remote Interface it should implement :
@Remote public interface UserManager { ... public void destroy(); }
I also added a
ejb-ref
in the web.xml file...The other web app should obtain the
MyBeanHome
EJB by context lookup ...Thx for your help !
-
3. Re: Seam Component used as "standard EJB"
salvino Jul 19, 2010 11:31 AM (in response to salvino)Oups.. bad copy/paste...
The interface is :
@Remote public interface MyBeanRemote { ... public void destroy(); }