public interface Agent
Modifier and Type | Method and Description |
---|---|
int |
doWork()
An agent should implement this method to do its work.
|
default void |
onClose()
To be overridden by Agents that need to do resource cleanup on close.
|
default void |
onStart()
To be overridden by Agents that need to do resource init on start.
|
java.lang.String |
roleName()
Get the name of this agent's role.
|
default void onStart()
This method will be called by the agent thread thread once on start..
int doWork() throws java.lang.Exception
The return value is used for implementing a backoff strategy that can be employed when no work is currently available for the agent to process.
If the Agent wished to terminate and close then a AgentTerminationException
can be thrown.
java.lang.Exception
- if an error has occurreddefault void onClose()
This method will be called after the agent thread has terminated or if the agent is closed before it runs.
java.lang.String roleName()
Copyright © 2014-2018 Real Logic Ltd. All Rights Reserved.