Class PreparedEventExpressionTemplate

  • All Implemented Interfaces:
    java.io.Serializable

    public class PreparedEventExpressionTemplate
    extends java.lang.Object
    implements java.io.Serializable

    Instances of this class are declared to represent templates for "Prepared Event Expressions". These are similar in concept to SQL prepared statements, in that they allow a monitor to declare a parameterised event expression that can then be "instantiated" as many times as necessary with different parameter values. The advantage of this approach over standard event expressions is that the expression is only parsed once, when the template is created. Instantiating the template with some set of parameters is then a relatively cheap operation. Standard event expressions will be parsed every time a listener is attached to them, which can be inefficient in monitors that create large numbers of listeners.

    See the documentation for PreparedEventExpression for examples of how this class is used.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      PreparedEventExpressionTemplate​(java.lang.String templateString)
      Constructor to create a new instance with the given immutable expression template string.
    • Constructor Detail

      • PreparedEventExpressionTemplate

        public PreparedEventExpressionTemplate​(java.lang.String templateString)
        Constructor to create a new instance with the given immutable expression template string.
        Parameters:
        templateString - The event expression template to be used.
    • Method Detail

      • getTemplateString

        public java.lang.String getTemplateString()
        Get the String value of the PreparedEventExpressionTemplate.
        Returns:
        value of the PreparedEventExpressionTemplate.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        getTemplateString()
      • getInstance

        public PreparedEventExpression getInstance()
        Create a new instance of the event expression template.
        Returns:
        A new event expression created from the template, ready to have its parameter values filled in.