Class JndiHandler


  • public abstract class JndiHandler
    extends Object
    An abstract RuntimeAnnotationHandler that is capable of dealing with JNDI.
    • Constructor Detail

      • JndiHandler

        public JndiHandler()
    • Method Detail

      • lookup

        public Object lookup​(FacesContext facesContext,
                             String name)
        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

        public void setField​(FacesContext facesContext,
                             Field field,
                             Object instance,
                             Object value)
        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

        public abstract void apply​(FacesContext ctx,
                                   Object... params)

        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 - the FacesContext for the current request
        params - one or more arguments to the handler instance. The type and number may vary.