Class ResourceLinkFactory
java.lang.Object
org.apache.naming.factory.ResourceLinkFactory
- All Implemented Interfaces:
ObjectFactory
- Direct Known Subclasses:
DataSourceLinkFactory
Object factory for resource links.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringManagerThe string manager for this package. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidderegisterGlobalResourceAccess(Context globalContext) Deregister all global resource access for the current web application.static voidderegisterGlobalResourceAccess(Context globalContext, String localName) Deregister access to a specific global resource for the current web application.getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) Create a new resource instance.static voidregisterGlobalResourceAccess(Context globalContext, String localName, String globalName) Register access to a global resource for the current web application.static voidsetGlobalContext(Context newGlobalContext) Set the global context (note: can only be used once).
-
Field Details
-
sm
The string manager for this package.
-
-
Constructor Details
-
ResourceLinkFactory
public ResourceLinkFactory()Default constructor.
-
-
Method Details
-
setGlobalContext
Set the global context (note: can only be used once).- Parameters:
newGlobalContext- new global context value
-
registerGlobalResourceAccess
public static void registerGlobalResourceAccess(Context globalContext, String localName, String globalName) Register access to a global resource for the current web application.- Parameters:
globalContext- The global naming contextlocalName- The local name of the resourceglobalName- The global name of the resource
-
deregisterGlobalResourceAccess
-
deregisterGlobalResourceAccess
Deregister all global resource access for the current web application.- Parameters:
globalContext- The global naming context
-
getObjectInstance
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws NamingExceptionCreate a new resource instance.- Specified by:
getObjectInstancein interfaceObjectFactory- Parameters:
name- the bound namenameCtx- unusedenvironment- unused- Returns:
- the object instance
- Throws:
NamingException- if an error occur creating the instance
-