java.lang.Object
com.sun.faces.application.annotation.JndiHandler
An abstract RuntimeAnnotationHandler that is capable of dealing with JNDI.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(FacesContext ctx, Object... params) Apply theAnnotation
(s).protected void
invokeMethod
(FacesContext facesContext, Method method, Object instance, Object value) Invoke the method.lookup
(FacesContext facesContext, String name) Look up the given object using its JNDI name.void
setField
(FacesContext facesContext, Field field, Object instance, Object value) Set the field.
-
Field Details
-
JAVA_COMP_ENV
-
-
Constructor Details
-
JndiHandler
public JndiHandler()
-
-
Method Details
-
lookup
Look up the given object using its JNDI name.- Parameters:
facesContext
- the Faces context.name
- the JNDI name.- Returns:
- the object, or null if an error occurs.
-
setField
Set the field.- Parameters:
facesContext
- the Faces context.field
- the field.instance
- the instance.value
- the value.
-
invokeMethod
protected void invokeMethod(FacesContext facesContext, Method method, Object instance, Object value) Invoke the method.- Parameters:
facesContext
- the Faces context.method
- the method.instance
- the instance.value
- the value.
-
apply
Apply the
Annotation
(s). The act of doing so should affect the Faces runtime in some fashion (see the spec for the specific annotation types).NOTE: when adding new types of components that can be annotated, the fact that we expose varargs here should be hidden. Type-safe methods should be added to
AnnotationManager
to clarify the contract.- Parameters:
ctx
- theFacesContext
for the current requestparams
- one or more arguments to the handler instance. The type and number may vary.
-