What you mean by 'ServiceLocator' class, this is a Pattern that a EJB2.1 stateless session should have a locator to cache the home and the business interface to avoid unnecessary JNDI lookups.
With EJB3 you are able to lookup all SLSB's and store the result in your application (you are free to encapsulate this).
It this what you mean? Than you will not find the 'ServiceLocator'
Ok, I misunderstood it. Actually I want some class on the client that looks up the jndi objects, stores them in cache, and checks the freshness of the objects. Because the remote objects have timecout property after which these invalid and need to be looked up again. If I am wrong then kindly, guide me in this context.
What EJB version do you use?
I am using EJB3 (or EJB3.x).
For this I wrote a class ....API contain all SLSB proxies, the constructor will have JNDI properties (with host/port, SSL, JAAS ...).
You might initialisize all together during initialisation or lazy and encapsulate the references of the proxy.
Each proxy is provided by a get<MyStatelessSessionBean>() here you might implement you timeout.
A nice one a generic method which use the class name to create the JNDI name ;-)
Ok, I got it with your help. Thank you.