Package org.objectweb.joram.mom.util
Interface MessageTable
-
- All Known Implementing Classes:
InMemoryMessageTable
public interface MessageTable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcheckConsumedMemory()Checks whether the consumed memory is allowed and performs the appropriate actions.intclean(long currentTime, DMQManager dmqManager)Cleans the table from invalid messages.Messageget(String msgId)Returns the specified message.intgetConsumedMemory()Returns the amount of memory in bytes consumed by this message table.Map<String,Message>getMap()Returns a map of messages from this table indexed by their message identifiers.voidput(Message msg)Adds a message in this table.voidremove(String msgId)Removes the specified message.intsize()Returns the exact number of all the messages that are contained by this table.
-
-
-
Method Detail
-
getConsumedMemory
int getConsumedMemory()
Returns the amount of memory in bytes consumed by this message table.- Returns:
- amount of memory in bytes
-
put
void put(Message msg)
Adds a message in this table.- Parameters:
msg- the message to be added
-
checkConsumedMemory
void checkConsumedMemory()
Checks whether the consumed memory is allowed and performs the appropriate actions.
-
get
Message get(String msgId)
Returns the specified message.- Parameters:
msgId- the identifier of the message to return- Returns:
- the specified message
-
clean
int clean(long currentTime, DMQManager dmqManager)Cleans the table from invalid messages. The detected invalid messages should be removed from the table, deleted if necessary (if persistent), and added to the dead message queue manager. The number of messages to be checked depends on the implementation, i.e. all the messages from the table do not have to be checked.- Parameters:
currentTime- the time from which messages are considered invaliddmqManager- the dead message queue manager- Returns:
- the number of invalid messages
-
remove
void remove(String msgId)
Removes the specified message.- Parameters:
msgId- the identifier of the message to remove
-
size
int size()
Returns the exact number of all the messages that are contained by this table.- Returns:
- the number of messages in this table
-
-