ServiceLocator and environment references. 2003-11-14 - By Sean Brydon
Back Hi, You could take a look at a service locator example at J2EE BluePrints at http://java.sun.com/blueprints/code/jps131/src/com/sun/j2ee/blueprints /servicelocator/web/ServiceLocator.java.html in which we use the caching mechanism for resources like EJB Homes etc but dont cache the env entries. hope that helps, Sean James Telfer wrote:
>Hello all, > >I am quite new to J2EE and have been using the ServiceLocator pattern based >on the example code provided in the 2nd Edition. While I am aware that >example code is just that, I would like to know if my problem is a bug in >the example or a gap in my understanding. > >My question is whether JNDI references in the "java:comp/env" context should >be cached. > >As I understand it the env context is specific to each bean, allowing >implementors to introduce a layer of abstraction between their hard-coded >JNDI references and the deployment environment. If this is the case, my >implementation should exclude local environment references. > >This would not be an issue if the Singleton pattern was not used, of course, >but neither would the caching be as effective. That said, if extensive use >of the *-ref deployment descriptor elements is made, caching would be of >very little value. > >Thanks for your help, >James Telfer > >==================================================================== >Companion Site: http://www.corej2eepatterns.com >J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns >List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html >Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected) > >
==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
|
|