com.apama.epl.plugin
Class Context

java.lang.Object
  extended by com.apama.epl.plugin.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
Context()
          The default constructor.
Context(Context other)
          Copy constructor
 
Method Summary
 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.
 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)


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
Overrides:
clone in class java.lang.Object
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.



Submit a bug or feature
Copyright (c) 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG