Package com.ibm.wsspi.resource
Interface ResourceFactory
public interface ResourceFactory
Factory for resources accessible to applications. Implementations should
be registered in the OSGi service registry with the
JNDI_NAME
and CREATES_OBJECT_CLASS
properties.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncreateResource
(ResourceInfo info) Creates a resource handle of the specified type that respects the specified resource information.
-
Field Details
-
JNDI_NAME
The service registry property that specifies the JNDI lookup name of the factory.- See Also:
-
CREATES_OBJECT_CLASS
The service registry property that specifies the String class (or String[] classes) that the factory supports creating.- See Also:
-
-
Method Details
-
createResource
Creates a resource handle of the specified type that respects the specified resource information. TheResourceInfo.getType()
must match theCREATES_OBJECT_CLASS
property. If the caller does not provide resource information, the implementation can useResourceConfigFactory.createResourceConfig(java.lang.String)
to create a default.- Parameters:
info
- the resource information, or null if unavailable- Returns:
- the resource handle
- Throws:
Exception
- a resource-specific exception- See Also:
-