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

public abstract Class FactoryBase

extends Object
implements ObjectFactory
Class Inheritance
All Implemented Interfaces
javax.naming.spi.ObjectFactory
Known Direct Subclasses
org.apache.naming.factory.ResourceEnvFactory, org.apache.naming.factory.ResourceFactory, org.apache.naming.factory.TransactionFactory, org.apache.naming.factory.EjbFactory
Imports
java.util.Hashtable, javax.naming.Context, .Name, .NamingException, .RefAddr, .Reference, javax.naming.spi.ObjectFactory, org.apache.naming.StringManager

Abstract base class that provides common functionality required by sub-classes. This class exists primarily to reduce code duplication.

Field Summary

Modifier and TypeField and Description
private static final StringManager

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected abstract ObjectFactory

Returns:

The default factory for the given reference object or null if no default factory exists.
getDefaultFactory
(Reference
The reference object to be processed
ref
)

If a default factory is available for the given reference type, create the default factory.

protected abstract Object

Returns:

The linked object or null if linked objects are not supported by or not configured for this reference object
getLinked
(Reference
The reference object to be processed
ref
)

If this reference is a link to another JNDI object, obtain that object.

public final Object
getObjectInstance(Object
The reference object describing the object to create
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.

Creates a new object instance.

protected abstract boolean

Returns:

true if this factory can process the object, otherwise false
isReferenceTypeSupported
(Object
The object to be processed
obj
)

Determines if this factory supports processing the provided reference object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

smback to summary
private static final StringManager sm

Constructor Detail

FactoryBaseback to summary
public FactoryBase()

Method Detail

getDefaultFactoryback to summary
protected abstract ObjectFactory getDefaultFactory(Reference ref) throws NamingException

If a default factory is available for the given reference type, create the default factory.

Parameters
ref:Reference

The reference object to be processed

Returns:ObjectFactory

The default factory for the given reference object or null if no default factory exists.

Exceptions
NamingException:
If the default factory cannot be created
getLinkedback to summary
protected abstract Object getLinked(Reference ref) throws NamingException

If this reference is a link to another JNDI object, obtain that object.

Parameters
ref:Reference

The reference object to be processed

Returns:Object

The linked object or null if linked objects are not supported by or not configured for this reference object

Exceptions
NamingException:
Error accessing linked object
getObjectInstanceback to summary
public final Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception

Implements javax.naming.spi.ObjectFactory.getObjectInstance.

Creates a new object instance.

Parameters
obj:Object

The reference object describing the object to create

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
Exceptions
Exception:

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

if this object factory encountered an exception while attempting to create an object, and no other object factories are to be tried.

isReferenceTypeSupportedback to summary
protected abstract boolean isReferenceTypeSupported(Object obj)

Determines if this factory supports processing the provided reference object.

Parameters
obj:Object

The object to be processed

Returns:boolean

true if this factory can process the object, otherwise false