|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jrun.jms.core.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.
org.exolab.jms.messagemgr.MessageHandle,
org.exolab.jms.messagemgr.MessagePriorityCache,
org.exolab.jms.messagemgr.PersistentPriorityCache,
org.exolab.jms.lease.LeaseManager,
org.exolab.jms.lease.LeaseEventListenerIfc| Constructor Summary | |
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 Logger |
getLogger()
Return a reference to the logger |
void |
onSchedulableEvent(java.lang.Object handle,
int type)
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 MessageLeaseHelperException
MessageLeaseException if it fails to construct an instance.listener - the object to notify when a lease
expiresMessageLeaseHelperException - | Method 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 onSchedulableEvent(java.lang.Object handle,
int type)
onSchedulableEvent in interface SchedulableEventListenerhandle - An instance of MessageHandleprotected Logger getLogger()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||