Package fr.dyade.aaa.agent
Interface MessageConsumer
-
- All Superinterfaces:
MessageComparator
- All Known Subinterfaces:
AgentEngine
- All Known Implementing Classes:
Engine,HttpNetwork,HttpsNetwork,Network,NGNetwork,PoolNetwork,SimpleNetwork,SSLNetwork,StreamNetwork,UDPNetwork
public interface MessageConsumer extends MessageComparator
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddelete()Deletes the component, removes all persistent data.floatgetAverageLoad1()Returns the load averages for the last minute.floatgetAverageLoad15()Returns the load averages for the past 15 minutes.floatgetAverageLoad5()Returns the load averages for the past 5 minutes.StringgetDomainName()Returns the corresponding domain's name.StringgetName()Returns thisMessageConsumer's name.MessageQueuegetQueue()Get this consumer'sMessageQueue.voidinsert(Message msg)Insert a message in theMessageQueue.booleanisRunning()Tests if the component is alive.voidpost(Message msg)Adds a message in "ready to deliver" list.voidpostAndValidate(Message msg)Posts a message and validates it at the same time.voidrestore()Restores logical clock information from persistent storage.voidsave()Saves logical clock information to persistent storage.voidstart()Causes this component to begin execution.voidstop()Forces the component to stop executing.voidvalidate()Validates all messages pushed in queue during transaction session.-
Methods inherited from interface fr.dyade.aaa.agent.MessageComparator
isPrior
-
-
-
-
Method Detail
-
getName
String getName()
Returns thisMessageConsumer's name.- Returns:
- this
MessageConsumer's name.
-
getDomainName
String getDomainName()
Returns the corresponding domain's name.- Returns:
- this domain's name.
-
insert
void insert(Message msg)
Insert a message in theMessageQueue. This method is used during initialization to restore the component state from persistent storage.- Parameters:
msg- the message
-
save
void save() throws IOException
Saves logical clock information to persistent storage.- Throws:
IOException- an error occurs.
-
restore
void restore() throws ExceptionRestores logical clock information from persistent storage.- Throws:
Exception- an error occurs.
-
post
void post(Message msg) throws Exception
Adds a message in "ready to deliver" list. This method allocates a new time stamp to the message ; be Careful, changing the stamp imply the filename change too.- Parameters:
msg- the message to deliver.- Throws:
Exception- an error occurs.
-
postAndValidate
void postAndValidate(Message msg) throws Exception
Posts a message and validates it at the same time.- Parameters:
msg- the message to deliver.- Throws:
Exception- an error occurs.
-
validate
void validate()
Validates all messages pushed in queue during transaction session.
-
start
void start() throws ExceptionCauses this component to begin execution.
-
stop
void stop()
Forces the component to stop executing.- See Also:
start()
-
delete
void delete() throws IllegalStateExceptionDeletes the component, removes all persistent data. The component may have been previously stopped, and removed from MessageConsumer list. This operation use Transaction calls, you may use commit to validate it.- Throws:
IllegalStateException- an error occurs.- See Also:
Transaction
-
getQueue
MessageQueue getQueue()
Get this consumer'sMessageQueue. Use in administration and debug tasks, should be replaced by a common attribute.- Returns:
- this
MessageConsumer's queue.
-
isRunning
boolean isRunning()
Tests if the component is alive. AMessageConsumeris alive if it has been started and has not yet stopped.- Returns:
- true if this
MessageConsumeris alive; false otherwise.
-
getAverageLoad1
float getAverageLoad1()
Returns the load averages for the last minute.- Returns:
- the load averages for the last minute.
-
getAverageLoad5
float getAverageLoad5()
Returns the load averages for the past 5 minutes.- Returns:
- the load averages for the past 5 minutes.
-
getAverageLoad15
float getAverageLoad15()
Returns the load averages for the past 15 minutes.- Returns:
- the load averages for the past 15 minutes.
-
-