users@glassfish.java.net

Re: when and why to create a custom JNDI resource ?

From: <glassfish_at_javadesktop.org>
Date: Thu, 15 Nov 2007 19:15:23 PST

Custom resources, once created in the server, are available to all hosted apps via injection or lookup. The same logic implemented as, say, session beans, are only for the current app. So the scope is different.

The focus of a custom resource is some type of service provided by appserver. Individula app can then rely on this service to perform its own business logic.

Since custom resources live in the server jndi, they can be centrally administered by a server administrator. For example, the behavior of a custom resource can be customized with a list of properties.

A typical usage of custom resource is to emulate <env-entry> for more complex data types, since <env-entry> currently only supports certain primitive wrappers, String, etc, not even including java.util.Date. With custom resource, you can achieve the env-entry capability for any data type in a portable manner.

-cheng
[Message sent by forum member 'cf126330' (cf126330)]

http://forums.java.net/jive/thread.jspa?messageID=245751