1 Reply Latest reply on Apr 28, 2006 2:29 PM by Alexander Hartner

    Casting/narrowing local/remote interfaces of same bean insta

    Henry Jones Newbie

      Hi,

      does anybody know, how I can get both the local and the remote interface
      for one single SFSB instance? The SFSB of which I am talking is created by another SLSB. This SLSB initializes the SFSB via the local interface. Thereafter I would like to return the remote interface of the SFSB to the remote client.

      I am using EJB3 and create the bean via

      IXyzBeanLocal localRef = (IXyzBeanLocal)ctx.lookup(LOCAL_JNDI_NAME);
      

      (ctx is the InitialContext) How can I get the remote interface of the instance referenced by localRef?
      If I use
      IXyzBeanRemote remoteRef = (IXyzBeanRemote)ctx.lookup(REMOTE_JNDI_NAME);
      

      a second instance is created, which is not what I intend.

      Does anybody know how to cast or narrow?

      Regards,
      Matthias