Top Description Fields Constructors Methods
com.sun.faces.application.annotation

public abstract Class JndiHandler

extends Object
implements RuntimeAnnotationHandler
Class Inheritance
All Implemented Interfaces
com.sun.faces.application.annotation.RuntimeAnnotationHandler
Known Direct Subclasses
com.sun.faces.application.annotation.PersistenceContextHandler, com.sun.faces.application.annotation.PersistenceUnitHandler, com.sun.faces.application.annotation.ResourceHandler, com.sun.faces.application.annotation.EJBHandler
Imports
java.lang.reflect.Field, .InvocationTargetException, .Method, java.util.logging.Level, .Logger, javax.naming.InitialContext, .NamingException, jakarta.faces.application.FacesMessage, .ProjectStage, jakarta.faces.context.FacesContext

An abstract RuntimeAnnotationHandler that is capable of dealing with JNDI.

Field Summary

Modifier and TypeField and Description
protected static final String
JAVA_COMP_ENV

Stores the java:comp/env/ prefix

private static final Logger
LOGGER

Stores the logger.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
invokeMethod(FacesContext
the Faces context.
facesContext
,
Method
the method.
method
,
Object
the instance.
instance
,
Object
the value.
value
)

Invoke the method.

public Object

Returns:

the object, or null if an error occurs.
lookup
(FacesContext
the Faces context.
facesContext
,
String
the JNDI name.
name
)

Look up the given object using its JNDI name.

public void
setField(FacesContext
the Faces context.
facesContext
,
Field
the field.
field
,
Object
the instance.
instance
,
Object
the value.
value
)

Set the field.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

JAVA_COMP_ENVback to summary
protected static final String JAVA_COMP_ENV

Stores the java:comp/env/ prefix

LOGGERback to summary
private static final Logger LOGGER

Stores the logger.

Constructor Detail

JndiHandlerback to summary
public JndiHandler()

Method Detail

invokeMethodback to summary
protected void invokeMethod(FacesContext facesContext, Method method, Object instance, Object value)

Invoke the method.

Parameters
facesContext:FacesContext

the Faces context.

method:Method

the method.

instance:Object

the instance.

value:Object

the value.

lookupback to summary
public Object lookup(FacesContext facesContext, String name)

Look up the given object using its JNDI name.

Parameters
facesContext:FacesContext

the Faces context.

name:String

the JNDI name.

Returns:Object

the object, or null if an error occurs.

setFieldback to summary
public void setField(FacesContext facesContext, Field field, Object instance, Object value)

Set the field.

Parameters
facesContext:FacesContext

the Faces context.

field:Field

the field.

instance:Object

the instance.

value:Object

the value.