You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Vincenzo D'Aniello <ic...@gmail.com> on 2017/04/14 10:32:41 UTC
Refer to the local interface from a remote interface proxy
Hi all, a question I hope not stupid!
If I have a remote reference to a stateful bean, as I can refer to the same
instance, but to the local ??
To better speak, a stateful bean is declared as:
@Stateful
@LocalBean
Bean class implements BeanRemote {...}
@Remote
inteface BeanRemote{...}
Now, for example, in a class of the same application also it resides where
the local interface, I call the remote interface with a 'lookup'
BeanRemote remoteBean = new InitialContex (prop) .lookup
(BeanRemote.class.getSimpleName ());
as I do now to refer to the same instance of the bean but local ??
Bean localBean = ??????
Or, starting from the local interface, how can I refer to the remote
instance of the same ??
Bean remoteBean = new InitialContex (prop) .lookup
(Bean.class.getSimpleName ());
BeanRemote remoteBean = ??
Tank!
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Refer-to-the-local-interface-from-a-remote-interface-proxy-tp4681552.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Refer to the local interface from a remote interface proxy
Posted by Vincenzo D'Aniello <ic...@gmail.com>.
Hi, i've resolved, with this:
in a EJB...
@Resource private SessionContext sesscont;
...
void meth(){
RemoteIf remIf = sesscont.getBusinessObject(RemoteIf.class);
}
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Refer-to-the-local-interface-from-a-remote-interface-proxy-tp4681552p4681571.html
Sent from the TomEE Users mailing list archive at Nabble.com.