Interface IMonitorContext

    • Method Detail

      • getMonitoringValuesProviders

        java.util.List<IMonitorValuesProvider> getMonitoringValuesProviders()
        Returns a view of aggregation values stored in this monitor context.

        There is no guarantee whether the returned list will or will not reflect further changes made in this monitor context.

        Returns:
        an immutable list with the providers currently set in this monitor context.
        Since:
        9.0.0
      • addValues

        default IMonitorValuesProvider addValues​(java.lang.String fieldId,
                                                 java.io.Serializable... values)
        Stores a monitoring value in this monitor context. removeValues(IMonitorValuesProvider) should be called (use a try/finally block to ensure that) to remove the aggregation value set when it should no longer be applied.

        Typical use for setting an aggregation value follows below:

         final String monitoringFieldId = ...;
         final Serializable value = ...;
         IMonitorValuesProvider provider = monitorContext.addValues(monitoringFieldId, value);
         try
         {
           // execution block that will have the set aggregation value as default
         }
         finally
         {
           monitorContext.removeValues(provider);
         }
         
        Parameters:
        fieldId - the field identifier.
        values - the values to set for the field.
        Returns:
        the created IMonitorValuesProvider to provide the given values.
        Since:
        9.0.0
      • addValues

        default IMonitorValuesProvider addValues​(java.lang.String fieldId,
                                                 java.util.List<? extends java.io.Serializable> values)
        Stores a monitoring value in this monitor context. removeValues(IMonitorValuesProvider) should be called (use a try/finally block to ensure that) to remove the aggregation value set when it should no longer be applied.

        Typical use for setting an aggregation value follows below:

         final String monitoringFieldId = ...;
         final Serializable value = ...;
         IMonitorValuesProvider provider = monitorContext.addValues(monitoringFieldId, value);
         try
         {
           // execution block that will have the set aggregation value as default
         }
         finally
         {
           monitorContext.removeValues(provider);
         }
         
        Parameters:
        fieldId - the field identifier.
        values - the values to set for the field.
        Returns:
        the created IMonitorValuesProvider to provide the given values.
        Since:
        9.0.0
      • addValues

        default IMonitorValuesProvider addValues​(java.util.Map<java.lang.String,​java.util.List<? extends java.io.Serializable>> fieldValues)
        Stores a monitoring value in this monitor context. removeValues(IMonitorValuesProvider) should be called (use a try/finally block to ensure that) to remove the aggregation value set when it should no longer be applied.

        Typical use for setting an aggregation value follows below:

         final String monitoringFieldId = ...;
         final Serializable value = ...;
         IMonitorValuesProvider provider = monitorContext.addValues(monitoringFieldId, value);
         try
         {
           // execution block that will have the set aggregation value as default
         }
         finally
         {
           monitorContext.removeValues(provider);
         }
         
        Parameters:
        fieldValues - the field values to set for the field.
        Returns:
        the created IMonitorValuesProvider to provide the given values.
        Since:
        9.0.0
      • addValues

        void addValues​(IMonitorValuesProvider... fieldValues)
        Stores a monitoring value in this monitor context. removeValues(IMonitorValuesProvider) should be called (use a try/finally block to ensure that) to remove the aggregation value set when it should no longer be applied.

        Typical use for setting an aggregation value follows below:

         IMonitorValuesProvider provider = new MyValueProvider();
         monitorContext.addValues(provider);
         try
         {
           // execution block that will have the set aggregation value as default
         }
         finally
         {
           monitorContext.removeValues(provider);
         }
         
        Parameters:
        fieldValues - the field values providers to set for the field.
        Since:
        9.0.0
      • clear

        void clear()
        Clears all data stored in the current monitor context.
        Since:
        9.0.0
      • isEnabled

        boolean isEnabled()
        Returns whether the current monitor context is enabled.
        Returns:
        whether the current monitor context is enabled.
        Since:
        11.0.0
      • isEmpty

        boolean isEmpty()
        Indicates whether this monitor context is empty.
        Returns:
        true if this monitor context is empty, false otherwise.
        Since:
        11.0.0