Class Context


  • public class Context
    extends java.lang.Object
    Class that holds a context reference and can be passed across the correlator EPL/Java plugin boundary. This class must only be used from an EPL Java Plugin (not from JMon).
    • Constructor Summary

      Constructors 
      Constructor Description
      Context()
      The default constructor.
      Context​(Context other)
      Copy constructor
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()  
      boolean equals​(java.lang.Object other)  
      static Context getCurrent()
      Returns a reference to the context the plugin is currently being called from.
      long getId()
      Equivalent to the EPL method getId on the context type
      java.lang.String getName()
      Returns the name of the context.
      int hashCode()  
      boolean isPublic()
      Returns true if the context is public (receives external / enqueued events)
      java.lang.String toString()
      Returns a string representation of the context instance.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Context

        public Context()
        The default constructor. This constructor will create a "dummy" context, which does not correspond to a real correlator context. It provides the same functionality as uninitialized context variables in MonitorScript. This cannot be used to send events to.
      • Context

        public Context​(Context other)
        Copy constructor
    • Method Detail

      • toString

        public java.lang.String toString()
        Returns a string representation of the context instance. This method produces an identical string to the one produced in MonitorScript. Example output: \"context(2,\"context_name\",false)\". In this example, the first item in the string (2) refers to the correlator context unique identifier. The second item in the string (\"context_name\") is the name of the context. The third item in the string refers to the value of receivesInput boolean flag, indicating whether the context is public or private. This method returns \"context(0,\"\",false)\" for a Context instance created with the default constructor. For more information on the definition of public and private contexts, please see the MonitorScript documentation (Writing MonitorScript Applications | Implementing Parallel Processing | Creating Contexts)
        Overrides:
        toString in class java.lang.Object
      • getName

        public java.lang.String getName()
        Returns the name of the context. For the context that is created with the following MonitorScript code: context c := context(\"test\"); When getName() method is called after this instance is retrieved in JMon, it would return \"test\". This method returns an empty string for a Context instance created with the default constructor. For more information, see the MonitorScript documentation about context datatypes.
      • isPublic

        public boolean isPublic()
        Returns true if the context is public (receives external / enqueued events)
      • getId

        public long getId()
        Equivalent to the EPL method getId on the context type
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Throws:
        java.lang.CloneNotSupportedException
        See Also:
        Object.clone()
      • getCurrent

        public static Context getCurrent()
        Returns a reference to the context the plugin is currently being called from. The reference is safe to hold across invocations.