Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-278

Execution context property declarations and property metadata attributes

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.2
    • Fix Version/s: 4.3-milestone-2
    • Component/s: Context
    • Labels:
      None
    • Tests:
      Unit, Integration
    • Similar issues:

      Description

      Make it possible to associate metatada with each property in the execution context.

      Add two methods to ExecutionContext:

      /**
       * Declare a property in the execution context.
       *
       * @param property The property to declare.
       */
      public void declareProperty(ExecutionContextProperty property)
      
      /**
       * @param key the key under which is stored the property to retrieve
       * @return {@code true} if there is a property declared for the given key.
       */
      public boolean hasProperty(String key)
      

      An execution context property contains the following metadata, that controls how the property value should be treated when managing execution contexts:

      • Read-only - The value may not be updated within the the execution context.
      • Inherited - The property will be inherited from the current context when replacing the execution context within the scope of a request.
      • Clone - Also clone the value when the execution context is cloned.
      • Type - The class of the value, for typechecking when replacing the value.
      • Non-null - The value may not be null

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              aj Andreas Jonsson
              Reporter:
              aj Andreas Jonsson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response: