Interface GenericExecutionContext

    • Method Detail

      • request

        GenericRequest request()
        Get the current request stuck to this execution context.
        Returns:
        the request attached to this execution context.
      • response

        GenericResponse response()
        Get the current response stuck to this execution context.
        Returns:
        the response attached to this execution context.
      • getComponent

        <T> T getComponent​(Class<T> componentClass)
      • setAttribute

        void setAttribute​(String name,
                          Object value)
        Parameters:
        name - a String specifying the name of the attribute.
        value - the Object to be stored.
      • putAttribute

        void putAttribute​(String name,
                          Object value)
        Stores an attribute in this request. Attributes are reset between requests. Note: prefer use of putInternalAttribute(String, Object) in case the attribute is not set by the user itself.
        Parameters:
        name - a String specifying the name of the attribute.
        value - the Object to be stored.
      • removeAttribute

        void removeAttribute​(String name)
        Removes an attribute from this request. This method is not generally needed as attributes only persist as long as the request is being handled.
        Parameters:
        name - the name of the attribute to remove.
      • getAttribute

        <T> T getAttribute​(String name)
        Returns the value of the attribute cast in the expected type T, or null if no attribute for the given name exists.
        Type Parameters:
        T - the expected type of the attribute value. Specify Object if you expect value of any type.
        Parameters:
        name - the name of the attribute.
        Returns:
        an Object containing the value of the attribute, or null if the attribute does not exist.
      • getAttributeNames

        Set<String> getAttributeNames()
        Returns an Enumeration containing the names of the attributes available to this request. This method returns an empty Enumeration if the request has no attributes available to it.
        Returns:
        a set of strings containing the names of the request's attributes.
      • getAttributes

        <T> Map<String,​T> getAttributes()
        Get all attributes available.
        Type Parameters:
        T - the expected type of the attribute values. Specify Object if you expect values of any types.
        Returns:
        the list of all the attributes.
      • putInternalAttribute

        void putInternalAttribute​(String name,
                                  Object value)
        Stores an internal attribute in this request. Attributes are reset between requests. Internal attributes can be used to avoid mixin with attributes set by the user during the request processing.
        Parameters:
        name - the name of the attribute.
        value - the Object to be stored.
      • removeInternalAttribute

        void removeInternalAttribute​(String name)
        Removes an internal attribute from this request.
        Parameters:
        name - the name of the internal attribute to remove.
      • getInternalAttribute

        <T> T getInternalAttribute​(String name)
        Returns the value of the internal attribute cast in the expected type T, or null if no attribute for the given name exists.
        Type Parameters:
        T - the expected type of the attribute value. Specify Object if you expect value of any type.
        Parameters:
        name - a String specifying the name of the attribute.
        Returns:
        an Object containing the value of the attribute, or null if the attribute does not exist
      • getInternalAttributes

        <T> Map<String,​T> getInternalAttributes()
        Get all internal attributes available. Internal attributes are not intended to be manipulated by end-users. You can safely use internal attribute to temporary store useful objects required during different phases of the execution.
        Type Parameters:
        T - the expected type of the values. Specify Object if you expect values of any types.
        Returns:
        the list of all the internal attributes.
      • getTemplateEngine

        io.gravitee.el.TemplateEngine getTemplateEngine()
        Get the TemplateEngine that can be used to evaluate EL expressions.
        Returns:
        the El TemplateEngine.