Package org.apache.naming.factory
Class ResourceLinkFactory
- java.lang.Object
-
- org.apache.naming.factory.ResourceLinkFactory
-
- All Implemented Interfaces:
javax.naming.spi.ObjectFactory
- Direct Known Subclasses:
DataSourceLinkFactory
public class ResourceLinkFactory extends java.lang.Object implements javax.naming.spi.ObjectFactoryObject factory for resource links.
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringManagersmThe string manager for this package.
-
Constructor Summary
Constructors Constructor Description ResourceLinkFactory()Default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidderegisterGlobalResourceAccess(javax.naming.Context globalContext)Deregister all global resource access for the current web application.static voidderegisterGlobalResourceAccess(javax.naming.Context globalContext, java.lang.String localName)Deregister access to a specific global resource for the current web application.java.lang.ObjectgetObjectInstance(java.lang.Object obj, javax.naming.Name name, javax.naming.Context nameCtx, java.util.Hashtable<?,?> environment)Create a new resource instance.static voidregisterGlobalResourceAccess(javax.naming.Context globalContext, java.lang.String localName, java.lang.String globalName)Register access to a global resource for the current web application.static voidsetGlobalContext(javax.naming.Context newGlobalContext)Set the global context (note: can only be used once).
-
-
-
Field Detail
-
sm
protected static final StringManager sm
The string manager for this package.
-
-
Method Detail
-
setGlobalContext
public static void setGlobalContext(javax.naming.Context newGlobalContext)
Set the global context (note: can only be used once).- Parameters:
newGlobalContext- new global context value
-
registerGlobalResourceAccess
public static void registerGlobalResourceAccess(javax.naming.Context globalContext, java.lang.String localName, java.lang.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
public static void deregisterGlobalResourceAccess(javax.naming.Context globalContext, java.lang.String localName)Deregister access to a specific global resource for the current web application.- Parameters:
globalContext- The global naming contextlocalName- The local name of the resource
-
deregisterGlobalResourceAccess
public static void deregisterGlobalResourceAccess(javax.naming.Context globalContext)
Deregister all global resource access for the current web application.- Parameters:
globalContext- The global naming context
-
getObjectInstance
public java.lang.Object getObjectInstance(java.lang.Object obj, javax.naming.Name name, javax.naming.Context nameCtx, java.util.Hashtable<?,?> environment) throws javax.naming.NamingExceptionCreate a new resource instance.- Specified by:
getObjectInstancein interfacejavax.naming.spi.ObjectFactory- Parameters:
name- the bound namenameCtx- unusedenvironment- unused- Returns:
- the object instance
- Throws:
javax.naming.NamingException- if an error occur creating the instance
-
-