1 Reply Latest reply on Sep 14, 2004 3:46 PM by darranl

    is there a way to find out if a bean local or remote based o

    scothall

      Is there anyway to determine if an EJB is local or remote based on its name?

      or a better question...

      If I have a local and remote interface for an EJB, which interface will be used when I invoke it?

      Thanks for the help!

        • 1. Re: is there a way to find out if a bean local or remote bas
          darranl

          The interface that is used will depend on the home interface that is looked up.

          If the home interface that you lookup is the remote home interface you will use the remote interface to the bean.

          If the home interface that you lookup is the local interface you will use the local interface of the bean.

          You can test the interfaces to see if the are EJBHome / EJBLocalHome instances or EJBOBject or EJBLocalObject but the client should know which one it is using as for remote interfaces it will need to use PortableRemoteObject.narrow on the looked up interface (Although not required for JBoss PortableRemoteObject.narrow is required for J2EE apps if they are to be portable)