org.apache.naming.factory

## Class BeanFactory

- java.lang.Object
- - org.apache.naming.factory.BeanFactory

- All Implemented Interfaces:
    ObjectFactory

      public class BeanFactory
      extends Object
      implements 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"/>
       <ResourceParams name="jdbc/myDataSource">
         <parameter>
           <name>factory</name>
           <value>org.apache.naming.factory.BeanFactory</value>
         </parameter>
         <parameter>
           <name>driverType</name>
           <value>thin</value>
         </parameter>
         <parameter>
           <name>serverName</name>
           <value>hue</value>
         </parameter>
         <parameter>
           <name>networkProtocol</name>
           <value>tcp</value>
         </parameter>
         <parameter>
           <name>databaseName</name>
           <value>XXXX</value>
         </parameter>
         <parameter>
           <name>portNumber</name>
           <value>NNNN</value>
         </parameter>
         <parameter>
           <name>user</name>
           <value>XXXX</value>
         </parameter>
         <parameter>
           <name>password</name>
           <value>XXXX</value>
         </parameter>
         <parameter>
           <name>maxLimit</name>
           <value>5</value>
         </parameter>
       </ResourceParams>

  Author:
    Aner Perez [aner at ncstech.com]

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BeanFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `getObjectInstance(Object obj, Name name, Context nameCtx, 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 Object getObjectInstance(Object obj,
                                 Name name,
                                 Context nameCtx,
                                 Hashtable<?,?> environment)
                                   throws NamingException

      Create a new Bean instance.
      Specified by:
        `getObjectInstance` in interface `ObjectFactory`
      Parameters:
        `obj` - The reference object describing the Bean
      Throws:
        `NamingException`

Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.