|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jms.persistence.Messages
This class manages the persistence of message objects.
Constructor Summary | |
protected |
Messages()
Default constructor does nothing at the moment. |
Method Summary | |
void |
add(java.sql.Connection connection,
MessageImpl message)
Add a message to the database, in the context of the specified transaction and connection. |
void |
close()
Reset the instance. |
MessageImpl |
deserialize(byte[] blob)
Set the message from a serialized blob |
MessageImpl |
get(java.sql.Connection connection,
java.lang.String messageId)
Return the message identified by the message Id |
java.util.HashMap |
getMessageIds(java.sql.Connection connection,
long time,
int hint)
Retrieve the specified number of message ids from the database with a time greater than that specified. |
java.util.Vector |
getMessages(java.sql.Connection connection,
java.lang.String destination,
int priority,
long time)
Retrieve the next set of messages for the specified destination with an acceptance time greater or equal to that specified. |
java.util.Vector |
getNonExpiredMessages(java.sql.Connection connection,
JmsDestination destination)
Retrieve the message handle for all unexpired messages |
java.util.Vector |
getUnprocessedMessages(java.sql.Connection connection)
Retrieve a list of unprocessed messages and return them to the client. |
static Messages |
initialise()
Create an initialise the singleton istance of this class. |
static Messages |
instance()
Returns a reference to the singleton instance. |
void |
remove(java.sql.Connection connection,
java.lang.String messageId)
Remove a message with the specified identity from the database |
void |
removeExpiredMessages(java.sql.Connection connection)
Delete all expired messages and associated message handles. |
int |
removeMessages(java.sql.Connection connection,
java.lang.String destination)
Delete all messages for the given destination |
byte[] |
serialize(MessageImpl message)
Get the message as a serialized blob |
void |
update(java.sql.Connection connection,
MessageImpl message)
Update the message state in the database. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected Messages()
Method Detail |
public static Messages instance()
Note that initialise() must have been invoked first for this to return a valid instance.
public static Messages initialise()
public void add(java.sql.Connection connection, MessageImpl message) throws PersistenceException
connection
- - execute on this connectionmessage
- - the message to addPersistenceException
- - an sql related errorpublic void update(java.sql.Connection connection, MessageImpl message) throws PersistenceException
connection
- - execute on this connectionmessage
- - the message to updatePersistenceException
- - an sql related errorpublic void remove(java.sql.Connection connection, java.lang.String messageId) throws PersistenceException
connection
- - execute on this connectionmessageId
- - the message id of the message to removePersistenceException
- - an sql related errorpublic MessageImpl get(java.sql.Connection connection, java.lang.String messageId) throws PersistenceException
connection
- - execute on this connectionmessageId
- - id of message to retrievePersistenceException
- - an sql related errorpublic int removeMessages(java.sql.Connection connection, java.lang.String destination) throws PersistenceException
connection
- - execute on this connectiondestination
- the destination to remove messages forPersistenceException
- - an sql related errorpublic java.util.Vector getMessages(java.sql.Connection connection, java.lang.String destination, int priority, long time) throws PersistenceException
connection
- - execute on this connectiondestination
- - the destinationpriority
- - the priority of the messagestime
- - with timestamp greater or equal to thisPersistenceException
- - if an SQL error occurspublic java.util.HashMap getMessageIds(java.sql.Connection connection, long time, int hint) throws PersistenceException
connection
- - execute on this connectiontime
- - with timestamp greater thanhint
- - an indication of the number of messages to return.PersistenceException
- - if an SQL error occurspublic java.util.Vector getUnprocessedMessages(java.sql.Connection connection) throws PersistenceException
connection
- - execute on this connectionPersistenceException
- - if an SQL error occurspublic java.util.Vector getNonExpiredMessages(java.sql.Connection connection, JmsDestination destination) throws PersistenceException
connection
- - execute on this connectiondestination
- - the destination in questionPersistenceException
- - sql releated exceptionpublic void removeExpiredMessages(java.sql.Connection connection) throws PersistenceException
connection
- - execute on this connectionPersistenceException
- - if an SQL error occurspublic void close()
public byte[] serialize(MessageImpl message) throws PersistenceException
message
- the message to serializepublic MessageImpl deserialize(byte[] blob) throws PersistenceException
blob
- the serialized message
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |