Package emissary.core
Interface IMobileAgent
-
- All Superinterfaces:
Runnable,Serializable
- All Known Implementing Classes:
HDMobileAgent,MobileAgent
public interface IMobileAgent extends Serializable, Runnable
Interface to the MobileAgent
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description StringagentId()Return the unique agent idvoidarrive(Object payload, IServiceProviderPlace arrivalPlace, int mec, List<DirectoryEntry> iq)Arriving payload assigned to an agent for process at arrivalPlaceDirectoryEntry[]getItineraryQueueItems()Retreive the current list of stored itinerary stepsStringgetLastPlaceProcessed()get the name of the last place processed.intgetMaxItinerarySteps()Get the maximum number of itinerary stepsintgetMaxMoveErrors()Get the number of move errorsintgetMoveErrorCount()Retrieve the current move error countStringgetName()Get the name of the current payloadIBaseDataObjectgetPayload()Get a reference to the payload this agent is responsible forObjectgetPayloadForTransport()Get the payload as an object for serialization during transport.voidgo(Object payload, IServiceProviderPlace sourcePlace)Send an agent on its way with the specified payload The payload is not processed at sourcePlace, source is only used to get directory access to figure out where to go next.voidinterrupt()Interrupte the agent's threadbooleanisInUse()Return true if agent is working on a payloadbooleanisZombie()Determine if this agent is walking un-deadvoidkillAgent()Call this method to permanently stop the running thread when we finish what we are doingvoidkillAgentAsync()Call this method to permanently stop the running thread eventually Returns immediatelydefault intpayloadCount()Returns the current payload count of the agent.voidsetMaxItinerarySteps(int value)Set the maximum number of itinerary steps before this instance will turn the workflow into an ERROR conditionvoidsetMaxMoveErrors(int value)Set the maximum number of move attempts that can error out before this instance will quit trying and set the workflow to be an ERROR condition
-
-
-
Method Detail
-
agentId
String agentId()
Return the unique agent id
-
getPayload
IBaseDataObject getPayload()
Get a reference to the payload this agent is responsible for
-
go
void go(Object payload, IServiceProviderPlace sourcePlace)
Send an agent on its way with the specified payload The payload is not processed at sourcePlace, source is only used to get directory access to figure out where to go next.- Parameters:
payload- the payload IBaseDataObject or list thereofsourcePlace- the place sending the payload the key of this place will be added to the transform history but the payload will not be processed here
-
arrive
void arrive(Object payload, IServiceProviderPlace arrivalPlace, int mec, List<DirectoryEntry> iq) throws Exception
Arriving payload assigned to an agent for process at arrivalPlace- Parameters:
payload- the payload IBaseDataObject or list thereofarrivalPlace- the place to begin processing the payload has already been added to the transform history by the sendermec- the move error count to update the agent's stateiq- the list of DirectoryEntry stored itinerary steps if any- Throws:
Exception
-
getMoveErrorCount
int getMoveErrorCount()
Retrieve the current move error count
-
getItineraryQueueItems
DirectoryEntry[] getItineraryQueueItems()
Retreive the current list of stored itinerary steps- Returns:
- array of DirectoryEntry
-
isInUse
boolean isInUse()
Return true if agent is working on a payload
-
getPayloadForTransport
Object getPayloadForTransport()
Get the payload as an object for serialization during transport.
-
getName
String getName()
Get the name of the current payload
-
getLastPlaceProcessed
String getLastPlaceProcessed()
get the name of the last place processed.
-
killAgent
void killAgent()
Call this method to permanently stop the running thread when we finish what we are doing
-
killAgentAsync
void killAgentAsync()
Call this method to permanently stop the running thread eventually Returns immediately
-
isZombie
boolean isZombie()
Determine if this agent is walking un-dead
-
interrupt
void interrupt()
Interrupte the agent's thread
-
getMaxMoveErrors
int getMaxMoveErrors()
Get the number of move errors
-
setMaxMoveErrors
void setMaxMoveErrors(int value)
Set the maximum number of move attempts that can error out before this instance will quit trying and set the workflow to be an ERROR condition- Parameters:
value- the maximum number of move failures
-
getMaxItinerarySteps
int getMaxItinerarySteps()
Get the maximum number of itinerary steps
-
setMaxItinerarySteps
void setMaxItinerarySteps(int value)
Set the maximum number of itinerary steps before this instance will turn the workflow into an ERROR condition- Parameters:
value- the new maximum number of steps
-
payloadCount
default int payloadCount()
Returns the current payload count of the agent.- Returns:
- default value of 1
-
-