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.
|
String |
roleName()
Get the name of this agent's role.
|
default void onStart()
This method will be called by the agent thread once on start.
int doWork()
throws 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.
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.
String roleName()
Copyright © 2014-2021 Real Logic Limited. All Rights Reserved.