public interface ActiveContext extends Identifiable, AutoCloseable, ContextBase, TaskSubmittable, ContextSubmittable
A context consists of two configurations:
Contexts have identifiers. A context is instantiated on a single Evaluator. Contexts are either created on an AllocatedEvaluator (for what is called the "root Context") or by forming sub-Contexts.
Contexts form a stack. Only the topmost context is active. Child Contexts or Tasks can be submitted to the active Context. Contexts can be closed, in which case their parent becomes active. In the case of the root context, closing is equivalent to releasing the Evaluator. A child context "sees" all Configuration in its parent Contexts.
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
sendMessage(byte[] message)
Send the active context the message, which will be delivered to all registered
ContextMessageHandler , for this context. |
void |
submitContext(Configuration contextConfiguration)
Submit a Context.
|
void |
submitContextAndService(Configuration contextConfiguration,
Configuration serviceConfiguration)
Submit a Context and a Service Configuration.
|
void |
submitTask(Configuration taskConf)
Submits a Task (encoded in the Configuration) for execution.
|
getEvaluatorDescriptor, getEvaluatorId, getId, getParentId
void close()
close
in interface AutoCloseable
void submitTask(Configuration taskConf)
TaskSubmittable
submitTask
in interface TaskSubmittable
taskConf
- the Configuration. See TaskConfiguration for detailsvoid submitContext(Configuration contextConfiguration)
ContextSubmittable
submitContext
in interface ContextSubmittable
contextConfiguration
- the Configuration of the EvaluatorContext. See ContextConfiguration for details.void submitContextAndService(Configuration contextConfiguration, Configuration serviceConfiguration)
ContextSubmittable
submitContextAndService
in interface ContextSubmittable
contextConfiguration
- the Configuration of the EvaluatorContext. See ContextConfiguration for details.serviceConfiguration
- the Configuration for the Services. See ServiceConfiguration for details.void sendMessage(byte[] message)
ContextMessageHandler
, for this context.message
- The message to be sent.Copyright © 2016 The Apache Software Foundation. All rights reserved.