Caching Resources

I've been reading through the various different J2EE patterns and I haven't been able to find a generic pattern for storage of application resrouces.

The EJB Environment has a lot of these already handled via JNDI, however on the servlet/client end of things, there isn't anything.

The closest thing I can find is using the Front Controller Pattern and having this store all the common resources into using setAttribute mothods, or using parameters on the servlet.

I'm thinking possibly another way of doing it would be a Singleton Pattern and a ServletConfigurator. The ServletConfigurator will have all the parameters and other resrouces it requires defined in the web.xml.

On startup it creates an instance of the Singleton and caches all the inforamtion that the application requires, such as JNDI lookups, DataSources, Global Objects, etc. It could be used for, on demand caching as well, for instance and EJB Session Object that is rarely used, could only have it's context cached when the client requires this resource.

Do people have any ideas or and other resources where I can look at for other information.

[1174 byte] By [tremier] at [2007-9-26 18:56:31]
# 1
Sounds like you're perhaps thinking along the lines of a ServiceLocator. See the J2EE pattern on this one.
davewiltz at 2007-7-3 3:54:29 > top of Java-index,Other Topics,Patterns & OO Design...