ResourceLinkFactory (Apache Tomcat 10.1.48 API Documentation)
Description: declaration: package: org.apache.naming.factory, class: ResourceLinkFactory

# Class ResourceLinkFactory

java.lang.Object
org.apache.naming.factory.ResourceLinkFactory

All Implemented Interfaces:
  `ObjectFactory`

Direct Known Subclasses:
  `DataSourceLinkFactory`

public class ResourceLinkFactory extends Object implements ObjectFactory

Object factory for resource links.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected static final StringManager`
  `sm`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ResourceLinkFactory()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `deregisterGlobalResourceAccess(Context globalContext)`
  `static void`
  `deregisterGlobalResourceAccess(Context globalContext, String localName)`
  `Object`
  `getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment)`
  Create a new resource instance.
  `static void`
  `registerGlobalResourceAccess(Context globalContext, String localName, String globalName)`
  `static void`
  `setGlobalContext(Context newGlobalContext)`
  Set the global context (note: can only be used once).

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### sm

    protected static final StringManager sm

- ## Constructor Details

  - ### ResourceLinkFactory

    public ResourceLinkFactory()

- ## Method Details

  - ### setGlobalContext

    public static void setGlobalContext(Context newGlobalContext)
    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)

  - ### deregisterGlobalResourceAccess

    public static void deregisterGlobalResourceAccess(Context globalContext, String localName)

  - ### deregisterGlobalResourceAccess

    public static void deregisterGlobalResourceAccess(Context globalContext)

  - ### getObjectInstance

    public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws NamingException
    Create a new resource instance.
    Specified by:
      `getObjectInstance` in interface `ObjectFactory`
    Parameters:
      `name` - the bound name
      `nameCtx` - unused
      `environment` - unused
    Returns:
      the object instance
    Throws:
      `NamingException` - if an error occur creating the instance