Besides the standard resource types, GlassFish also supports two additional types of resources—custom and external. In this section, we examine their applicability, and discuss how to configure them.
A custom resource is typically a Java object that is read-only, and shared by many components in the application server runtime environment. A custom instance is always created by a factory object that implement the javax.naming.spi.ObjectFactory
interface. When a custom resource is requested by an application component, the factory object will return the resource object.
Note
Because a custom resource is typically shared among all the application components, and it is typically read-only, its capability is rather limited. Therefore, it is mostly used to provide some additional configuration data for an environment, and it is not very suitable for hosting complicated application logic.
Custom resources are configured in the local...