Class BeanFactory

  • All Implemented Interfaces:
    javax.naming.spi.ObjectFactory

    public class BeanFactory
    extends java.lang.Object
    implements javax.naming.spi.ObjectFactory
    Object factory for any Resource conforming to the JavaBean spec.

    This factory can be configured in a <Context> element in your conf/server.xml configuration file. An example of factory configuration is:

     <Resource name="jdbc/myDataSource"
               auth="SERVLET"
               type="oracle.jdbc.pool.OracleConnectionCacheImpl"
               factory="org.apache.naming.factory.BeanFactory"
               driverType="thin"
               serverName="hue"
               networkProtocol="tcp"
               databaseName="XXXX"
               portNumber="NNNN"
               user="XXXX"
               password="XXXX"
               maxLimit="5"
               />
     
    Author:
    Aner Perez [aner at ncstech.com]
    • Constructor Summary

      Constructors 
      Constructor Description
      BeanFactory()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getObjectInstance​(java.lang.Object obj, javax.naming.Name name, javax.naming.Context nameCtx, java.util.Hashtable<?,​?> environment)
      Create a new Bean instance.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BeanFactory

        public BeanFactory()
    • Method Detail

      • 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.NamingException
        Create a new Bean instance.
        Specified by:
        getObjectInstance in interface javax.naming.spi.ObjectFactory
        Parameters:
        obj - The reference object describing the Bean
        name - the bound name
        nameCtx - unused
        environment - unused
        Returns:
        the object instance
        Throws:
        javax.naming.NamingException - if an error occur creating the instance