Top Description Fields Constructors Methods
org.apache.naming.factory

public Class BeanFactory

extends Object
implements ObjectFactory
Class Inheritance
All Implemented Interfaces
javax.naming.spi.ObjectFactory
Imports
java.beans.BeanInfo, .Introspector, .PropertyDescriptor, java.lang.reflect.Method, java.util.Enumeration, .Hashtable, javax.naming.Context, .Name, .NamingException, .RefAddr, .Reference, javax.naming.spi.ObjectFactory, org.apache.juli.logging.Log, .LogFactory, org.apache.naming.ResourceRef, .StringManager

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]

Field Summary

Modifier and TypeField and Description
private final Log
private static final StringManager

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
getObjectInstance(Object
The reference object describing the Bean
obj
,
Name
The name of this object relative to nameCtx, or null if no name is specified.
name
,
Context
The context relative to which the name parameter is specified, or null if name is relative to the default initial context.
nameCtx
,
Hashtable<?, ?>
The possibly null environment that is used in creating the object.
environment
)

Implements javax.naming.spi.ObjectFactory.getObjectInstance.

Create a new Bean instance.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

logback to summary
private final Log log
smback to summary
private static final StringManager sm

Constructor Detail

BeanFactoryback to summary
public BeanFactory()

Method Detail

getObjectInstanceback to summary
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws NamingException

Implements javax.naming.spi.ObjectFactory.getObjectInstance.

Create a new Bean instance.

Parameters
obj:Object

The reference object describing the Bean

name:Name

Doc from javax.naming.spi.ObjectFactory.getObjectInstance.

The name of this object relative to nameCtx, or null if no name is specified.

nameCtx:Context

Doc from javax.naming.spi.ObjectFactory.getObjectInstance.

The context relative to which the name parameter is specified, or null if name is relative to the default initial context.

environment:Hashtable<?, ?>

Doc from javax.naming.spi.ObjectFactory.getObjectInstance.

The possibly null environment that is used in creating the object.

Returns:Object

Doc from javax.naming.spi.ObjectFactory.getObjectInstance.

The object created; null if an object cannot be created.

Annotations
@Override