Class RequestContext

    • Method Detail

      • C

        public static <T> T C​(Class<T> c)
                       throws ClassNotInContextException
        For convenience, equivalent to RequestContext.getCurrent().get(c) This method assumes that the requested class is required and will throw an exception if it is not found
        Type Parameters:
        T - - the type expected to be returned
        Parameters:
        c - - the class to
        Returns:
        - an object of the given type
        Throws:
        ClassNotInContextException
      • C

        public static <T> T C​(Class<T> c,
                              boolean required)
                       throws ClassNotInContextException
        For convenience, equivalent to RequestContext.getCurrent().get(c) Returns the object in context of the given type or null if not found and required is false.
        Type Parameters:
        T -
        Parameters:
        c -
        required - - if true will throw an exception if the requested class is not found. Otherwise will return null.
        Returns:
        - an object of the given type
        Throws:
        ClassNotInContextException
      • onRemove

        public void onRemove​(Object item)
        Called when this request context goes out of context. Should shutdown all of its contents
        Specified by:
        onRemove in interface RemovalCallback