|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jms.messagemgr.MessageLeaseHelper
This is a helper class for registering leases for messages with
LeaseManager. The lease is based on the JMSExpiration property of the
message.
When the lease expires, the listener's onLeaseExpired() method is invoked
with a MessageHandle object passed as the argument.
If JMSExpiration is 0, the message never expires.
MessageHandle
,
LeaseManager
,
LeaseEventListenerIfc
Constructor Summary | |
MessageLeaseHelper(java.sql.Connection connection,
DestinationCache listener)
Construct a helper for the specified destination cache. |
|
MessageLeaseHelper(DestinationCache listener)
Construct a helper for the specified destination cache. |
Method Summary | |
void |
addLease(MessageHandle handle)
Add a lease for the handle to notify listener when message expires. |
void |
addLease(MessageImpl message)
Add a lease for message to notify listener when message expires. |
void |
clear()
Clears all leases |
protected void |
init(DestinationCache listener,
java.sql.Connection connection)
This method is used for all common initialization code. |
void |
onLeaseExpired(java.lang.Object handle)
Invoked when a lease has expired. |
void |
removeLease(MessageImpl message)
Remove a lease for a message |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MessageLeaseHelper(DestinationCache listener) throws PersistenceException
listener
- the object to notify when a lease expiresPersistenceException
- if the destination is administered
and the set of non-expired messages cannot be determinedpublic MessageLeaseHelper(java.sql.Connection connection, DestinationCache listener) throws PersistenceException
This method is only called during cache init time and is used to retrieve persistent messages with leases.
connection
- the connection to use to retrieve persistent messages
with leaseslistener
- the object to notify when a lease expiresPersistenceException
- if the destination is administered
and the set of non-expired messages cannot be determinedMethod Detail |
public void addLease(MessageImpl message)
message
- the message to add a lease forpublic void addLease(MessageHandle handle)
handle
- message handle to addpublic void removeLease(MessageImpl message)
message
- the message to remove the lease forpublic void clear()
public void onLeaseExpired(java.lang.Object handle)
onLeaseExpired
in interface LeaseEventListenerIfc
handle
- An instance of MessageHandleprotected void init(DestinationCache listener, java.sql.Connection connection) throws PersistenceException
listener
- the cache listening for expired leases.connection
- the persistent connection to usePersistenceException
- if the destination is administered
and the set of non-expired messages cannot be determined
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |