Developing Apama Applications > Developing Apama Applications in EPL > Implementing Parallel Processing > Creating contexts
Creating contexts
In EPL, you refer to a context by means of an object of type context. The context type is a reference type. Context objects are lightweight and creating one only creates a stub object and allocates an ID. In other words, when you create a context, you are actually creating a context reference.
Use one of the following constructors to create a context:
context(string name)
context(string name, boolean receivesInput)
The optional receivesInput Boolean flag controls whether the context is public or private:
*A public context can receive external, enqueued, and routed events.
*A private context cannot receive events from external components sent to the correlator. A private context can receive enqueued events from other contexts, and enqueued events and routed events from monitor instances in that context. The default is that a context is private.
The following example creates a reference, c, to a private context whose name is test:
context c:=context("test");
The following topics provide additional information:
*Calling context methods
*How many contexts can you create?
Copyright © 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.