Class ObjectFactoryBuilder

java.lang.Object
org.jboss.as.naming.context.ObjectFactoryBuilder
All Implemented Interfaces:
DirObjectFactory, ObjectFactory, ObjectFactoryBuilder

public class ObjectFactoryBuilder extends Object implements ObjectFactoryBuilder, DirObjectFactory
ObjectFactoryBuilder implementation used to support custom object factories being loaded from modules. This class also provides the default object factory implementation.
Author:
John Bailey
  • Field Details

  • Method Details

    • createObjectFactory

      public ObjectFactory createObjectFactory(Object obj, Hashtable<?,?> environment) throws NamingException
      Create an object factory. If the object parameter is a reference it will attempt to create an ObjectFactory from the reference. If the parameter is not a reference, or the reference does not create an ObjectFactory it will return this as the ObjectFactory to use.
      Specified by:
      createObjectFactory in interface ObjectFactoryBuilder
      Parameters:
      obj - The object bound in the naming context
      environment - The environment information
      Returns:
      The object factory the object resolves to
      Throws:
      NamingException - If any problems occur
    • getObjectInstance

      public Object getObjectInstance(Object ref, Name name, Context nameCtx, Hashtable<?,?> environment) throws Exception
      Create an object instance.
      Specified by:
      getObjectInstance in interface ObjectFactory
      Parameters:
      ref - Object containing reference information
      name - The name relative to nameCtx
      nameCtx - The naming context
      environment - The environment information
      Returns:
      The object
      Throws:
      Exception - If any error occur
    • getObjectInstance

      public Object getObjectInstance(Object ref, Name name, Context nameCtx, Hashtable<?,?> environment, Attributes attributes) throws Exception
      Create an object instance.
      Specified by:
      getObjectInstance in interface DirObjectFactory
      Parameters:
      ref - Object containing reference information
      name - The name relative to nameCtx
      nameCtx - The naming context
      environment - The environment information
      attributes - The directory attributes
      Returns:
      The object
      Throws:
      Exception - If any error occur