public class MicroAgentInterpreter
extends jadex.kernelbase.AbstractInterpreter
Modifier and Type | Class and Description |
---|---|
static class |
MicroAgentInterpreter.HandleMessageStep
Step to handle a message.
|
static class |
MicroAgentInterpreter.StepInfo
Info struct for steps.
|
Modifier and Type | Field and Description |
---|---|
static String |
TYPE_STEP
Constant for step event.
|
Constructor and Description |
---|
MicroAgentInterpreter(IComponentDescription desc,
IComponentAdapterFactory factory,
MicroModel model,
Class<?> microclass,
Map<String,Object> args,
String config,
IExternalAccess parent,
RequiredServiceBinding[] bindings,
boolean copy,
boolean realtime,
IIntermediateResultListener<Tuple2<String,Object>> resultlistener,
Future<Void> inited)
Create a new agent.
|
Modifier and Type | Method and Description |
---|---|
void |
addMessageHandler(IMessageHandler handler)
Add a message handler.
|
void |
afterBlock()
Called after unblocking the component thread.
|
void |
beforeBlock()
Called before blocking the component thread.
|
IExternalAccess |
createExternalAccess()
Can be called concurrently (also during executeAction()).
|
IServiceContainer |
createMyServiceContainer(Map args)
Create the service container.
|
IServiceContainer |
createServiceContainer()
Create the service container.
|
boolean |
executeStep()
Can be called on the agent thread only.
|
MicroAgent |
getAgent()
Get the agent.
|
IComponentAdapter |
getAgentAdapter()
Get the agent adapter.
|
ClassLoader |
getClassLoader()
Get the class loader of the component.
|
IValueFetcher |
getFetcher()
Get the value fetcher.
|
IInternalAccess |
getInternalAccess()
Get the internal access.
|
MicroModel |
getMicroModel()
Get the micro model.
|
Object |
getPojoAgent()
Get the pojo agent (or null if it has none).
|
Object |
getStepDetails(IComponentStep step)
Get the details of a step.
|
IFuture<Void> |
initComponents(IModelInfo model,
String config)
Add extra init code after components.
|
IFuture<Void> |
initProvidedServices(IModelInfo model,
String config)
Add extra init code before provided services.
|
boolean |
isAtBreakpoint(String[] breakpoints)
Test if the component's execution is currently at one of the
given breakpoints.
|
void |
messageArrived(IMessageAdapter message)
Can be called concurrently (also during executeAction()).
|
void |
removeMessageHandler(IMessageHandler handler)
Remove a message handler.
|
<T> IFuture<T> |
scheduleStep(IComponentStep<T> step)
Schedule a step of the agent.
|
<T> IFuture<T> |
scheduleStep(IComponentStep<T> step,
long delay)
Schedule a step of the component.
|
void |
startBehavior()
Start the component behavior.
|
IFuture<Void> |
startEndSteps()
Start the end steps of the component.
|
void |
streamArrived(IConnection con)
Can be called concurrently (also during executeAction()).
|
IFuture<Void> |
terminateServiceContainer()
Called from cleanupComponent.
|
addArgument, addDefaultResult, addExtension, addProperty, checkAllowedThread, getArguments, getBindings, getComponentAdapter, getConfiguration, getExtension, getExtensions, getExternalAccess, getModel, getMonitoringServiceGetter, getParentAccess, getProperties, getPublishEmitLevelMonitoring, getPublishEmitLevelSubscriptions, getResults, getServiceContainer, hasEventTargets, isCopy, isRealtime, publishLocalEvent, setResultValue, subscribeToEvents
addService, cleanupComponent, componentCreated, componentDestroyed, createChild, createComponent, createInternalService, createResultListener, createResultListener, getArguments, getChildren, getComponentDescription, getComponentFilename, getComponentIdentifier, getCurrentStateEvents, getLocalType, getLogger, getName, getName, getNumber, getParent, getProperty, getRawService, getRawService, getRawServices, getServicePrefix, getServiceProvider, init, initArguments, initExtension, initExtensions, initFutureProperties, initRequiredServices, isComponentThread, isExternalThread, killComponent, publishEvent, publishEvent, startInitialSteps, startServiceContainer, terminateExtensions, toString, waitForDelay, waitForDelay, waitForDelay, waitForDelay
addNFProperty, getNFAllPropertyNames, getNFPropertyMetaInfo, getNFPropertyMetaInfos, getNFPropertyNames, getNFPropertyValue, getNFPropertyValue, removeNFProperty, setParent, shutdownNFPropertyProvider
public static final String TYPE_STEP
public MicroAgentInterpreter(IComponentDescription desc, IComponentAdapterFactory factory, MicroModel model, Class<?> microclass, Map<String,Object> args, String config, IExternalAccess parent, RequiredServiceBinding[] bindings, boolean copy, boolean realtime, IIntermediateResultListener<Tuple2<String,Object>> resultlistener, Future<Void> inited)
adapter
- The adapter.microagent
- The microagent.public IFuture<Void> initProvidedServices(IModelInfo model, String config)
initProvidedServices
in class jadex.kernelbase.StatelessAbstractInterpreter
public IFuture<Void> initComponents(IModelInfo model, String config)
initComponents
in class jadex.kernelbase.StatelessAbstractInterpreter
public void startBehavior()
startBehavior
in interface IComponentInstance
startBehavior
in class jadex.kernelbase.StatelessAbstractInterpreter
public void beforeBlock()
public void afterBlock()
public IValueFetcher getFetcher()
getFetcher
in class jadex.kernelbase.AbstractInterpreter
public boolean executeStep()
executeStep
in interface IComponentInstance
executeStep
in class jadex.kernelbase.StatelessAbstractInterpreter
public void messageArrived(IMessageAdapter message)
messageArrived
in interface IComponentInstance
messageArrived
in class jadex.kernelbase.StatelessAbstractInterpreter
message
- The message that arrived.public void streamArrived(IConnection con)
streamArrived
in interface IComponentInstance
streamArrived
in class jadex.kernelbase.StatelessAbstractInterpreter
con
- The stream that arrived.public IFuture<Void> startEndSteps()
startEndSteps
in class jadex.kernelbase.StatelessAbstractInterpreter
public IFuture<Void> terminateServiceContainer()
terminateServiceContainer
in class jadex.kernelbase.StatelessAbstractInterpreter
public boolean isAtBreakpoint(String[] breakpoints)
isAtBreakpoint
in interface IComponentInstance
isAtBreakpoint
in class jadex.kernelbase.StatelessAbstractInterpreter
breakpoints
- An array of breakpoints.public <T> IFuture<T> scheduleStep(IComponentStep<T> step)
scheduleStep
in class jadex.kernelbase.StatelessAbstractInterpreter
step
- Code to be executed as a step of the agent.public <T> IFuture<T> scheduleStep(IComponentStep<T> step, long delay)
step
- Code to be executed as a step of the component.delay
- The delay to wait before step should be done.public IComponentAdapter getAgentAdapter()
public Object getPojoAgent()
public void addMessageHandler(IMessageHandler handler)
The
- handler.public void removeMessageHandler(IMessageHandler handler)
handler
- The handler.public IInternalAccess getInternalAccess()
getInternalAccess
in class jadex.kernelbase.StatelessAbstractInterpreter
public IExternalAccess createExternalAccess()
createExternalAccess
in class jadex.kernelbase.AbstractInterpreter
listener
- External access is delivered via result listener.public IServiceContainer createServiceContainer()
createServiceContainer
in class jadex.kernelbase.AbstractInterpreter
public IServiceContainer createMyServiceContainer(Map args)
public Object getStepDetails(IComponentStep step)
public ClassLoader getClassLoader()
getClassLoader
in interface IComponentInstance
getClassLoader
in class jadex.kernelbase.StatelessAbstractInterpreter
public MicroModel getMicroModel()
public MicroAgent getAgent()
Copyright © 2013. All Rights Reserved.