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 Details

    • sm

      protected static final StringManager sm
      The string manager for this package.
  • Constructor Details

    • ResourceLinkFactory

      public ResourceLinkFactory()
      Default constructor.
  • 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)
      Register access to a global resource for the current web application.
      Parameters:
      globalContext - The global naming context
      localName - The local name of the resource
      globalName - The global name of the resource
    • deregisterGlobalResourceAccess

      public static void deregisterGlobalResourceAccess(Context globalContext, String localName)
      Deregister access to a specific global resource for the current web application.
      Parameters:
      globalContext - The global naming context
      localName - The local name of the resource
    • deregisterGlobalResourceAccess

      public static void deregisterGlobalResourceAccess(Context globalContext)
      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 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