Class MetadataCountInterceptor

  • All Implemented Interfaces:
    AdaptrisComponent, ComponentLifecycle, ComponentLifecycleExtension, StateManagedComponent, WorkflowInterceptor

    @ComponentProfile(summary="Interceptor that increments a counter based on some metadata value",
                      tag="interceptor")
    public class MetadataCountInterceptor
    extends MetadataMetricsInterceptorImpl
    WorkflowInterceptor implementation that exposes metrics about metadata values via JMX.

    Each message that passes through the interceptor will be queried in turn for the configured key (getMetadataKey()). The string value associated with that key will be added to the existing total for that value within the given time period. Effectively this interceptor counts the number of times a given metadata value is processed by the workflow within a given time period.

    In the adapter configuration file this class is aliased as metadata-count-interceptor which is the preferred alternative to the fully qualified classname when building your configuration.

    • Constructor Detail

      • MetadataCountInterceptor

        public MetadataCountInterceptor()
      • MetadataCountInterceptor

        public MetadataCountInterceptor​(java.lang.String key)
    • Method Detail

      • workflowStart

        public void workflowStart​(AdaptrisMessage inputMsg)
        Description copied from interface: WorkflowInterceptor
        Mark the start of a workflow. This doesn't mean the message has started processing but only that the message will - at some point - be processed by the workflow.
        Parameters:
        inputMsg - the message that will be processed by this workflow.
      • workflowEnd

        public void workflowEnd​(AdaptrisMessage inputMsg,
                                AdaptrisMessage outputMsg)
        Description copied from interface: WorkflowInterceptor
        Mark the end of a workflow.
        Parameters:
        inputMsg - the original message that was originally submitted to the workflow; in the event of an exception during processing, the exception will be stored in object metadata in the inputMsg
        outputMsg - the message contaning any changes that may have been applied by the services within the workflow.
        See Also:
        CoreConstants.OBJ_METADATA_EXCEPTION
      • getMetadataKey

        public java.lang.String getMetadataKey()
      • setMetadataKey

        public void setMetadataKey​(java.lang.String key)
        Set the metadata key whose values you wish to track.
        Parameters:
        key - the metadata key.