Interface AsyncContext


  • @Role
    public interface AsyncContext
    Contextual information related to asynchronous rendering.
    Since:
    10.10RC1
    Version:
    $Id: b2ae33c660bc47213e1520258951e5dc93236864 $
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      boolean isEnabled()  
      void setEnabled​(boolean enabled)  
      void use​(String type, Object value)  
      void useComponent​(Type roleType)
      Indicate that the current execution manipulate components of the passed type and the result will need to be removed from the cache if any is unregistered or a new one registered.
      void useComponent​(Type roleType, String roleHint)
      Indicate that the current execution manipulate component with the passed type and hint and the result will need to be removed from the cache if it's registered or unregistered.
      void useEntity​(EntityReference reference)
      Indicate that the current execution manipulate the passed entity and the result will need to be removed from the cache if it's modified in any way.
      default void useRight​(Right right, DocumentReference userReference, EntityReference entityReference, boolean allowed)  
    • Method Detail

      • isEnabled

        boolean isEnabled()
        Returns:
        true if it's allowed to render content asynchronously
      • setEnabled

        void setEnabled​(boolean enabled)
        Parameters:
        enabled - true if it's allowed to render content asynchronously
      • useEntity

        void useEntity​(EntityReference reference)
        Indicate that the current execution manipulate the passed entity and the result will need to be removed from the cache if it's modified in any way.

        • If the reference is a document, any modification made to that document (including object and attachments) will be affected.
        • If the reference is a document containing a class any modification of an object of that class will be affected.
        Parameters:
        reference - the reference of the entity
      • useComponent

        void useComponent​(Type roleType)
        Indicate that the current execution manipulate components of the passed type and the result will need to be removed from the cache if any is unregistered or a new one registered.
        Parameters:
        roleType - the type of the component role
      • useComponent

        void useComponent​(Type roleType,
                          String roleHint)
        Indicate that the current execution manipulate component with the passed type and hint and the result will need to be removed from the cache if it's registered or unregistered.
        Parameters:
        roleType - the type of the component role
        roleHint - the hint of the component
      • use

        void use​(String type,
                 Object value)
        Parameters:
        type - the type of data to associated with the cached result
        value - the value to associated with the cached result
      • useRight

        default void useRight​(Right right,
                              DocumentReference userReference,
                              EntityReference entityReference,
                              boolean allowed)
        Parameters:
        right - the right needed for execution of the action
        userReference - the user to check the right for
        entityReference - the entity on which to check the right
        allowed - the result of the evaluation
        Since:
        11.8RC1