I went through the link https://docs.jboss.org/author/display/AS71/JNDI+Reference
When we do Traditional JNDI lookup we first get a stub object of the remote interface and then make another network call to make the actual EJB call. This has been listed as 2 network calls.
I am trying to figure out is there something by which we can keep a singleton store of the stub object fetched only once and then just use it to make subsequent calls? I am not an expert in details of the RMI but as long as the stub is available we should be able to use it..isnt it?
Basically looking for any Spring option where on startup the Spring bit makes the JNDI EJB lookup and stores that in a singleton object which will be avaialble over the context for future use as long as the application is running?
You can lookup the bean using the following and use it for subsequent calls:
<jee:local-slsb id="myComponent" jndi-name="ejb/myBean"
business-interface="com.mycom.MyComponent"/>
or in case of remote EJB:
<jee:remote-slsb id="myComponent" jndi-name="ejb/myBean"
business-interface="com.mycom.MyComponent"/>