Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.objectweb.joram.mom.dest.DestinationImpl
org.objectweb.joram.mom.dest.QueueImpl
public class QueueImpl
extends DestinationImpl
QueueImpl
class implements the MOM queue behaviour,
basically storing messages and delivering them upon clients requests.
Field Summary | |
protected long |
|
protected Hashtable |
|
protected Hashtable |
|
protected Hashtable |
|
protected Vector |
|
protected MessagePersistenceModule |
|
protected boolean |
|
protected Vector |
|
Fields inherited from class org.objectweb.joram.mom.dest.DestinationImpl | |
READ , READWRITE , WRITE , adminId , clients , destId , dmqId , freeReading , freeWriting |
Method Summary | |
protected void |
|
protected void | |
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected boolean |
|
protected void |
|
protected void |
|
void |
|
protected void |
|
protected void |
|
String |
|
Methods inherited from class org.objectweb.joram.mom.dest.DestinationImpl | |
canBeDeleted , doReact , doReact , doReact , doReact , doReact , doReact , doReact , doReact , doReact , doReact , isAdministrator , isReader , isWriter , processSetRight , react , sendToDMQ , specialAdminProcess , specialProcess |
protected long arrivalsCounter
Counter of messages arrivals.
protected Hashtable consumers
Table keeping the messages' consumers identifiers.
protected Hashtable contexts
Table keeping the messages' consumers contexts.
protected Hashtable deliveredMsgs
Table holding the delivered messages before acknowledgement.
protected Vector messages
Vector holding the messages before delivery.
protected MessagePersistenceModule persistenceModule
The persistence module used for managing the messages' persistence.
protected boolean receiving
true
if the queue is currently receiving messages.
protected Vector requests
Vector holding the requests before reply or expiry.
protected void deliverMessages(int index)
Actually tries to answer the pending "receive" requests. The method may sendQueueMsgReply
replies to clients.
- Parameters:
index
- Index where starting to "browse" the requests.
protected void doProcess(DeleteNot not)
Method specifically processing afr.dyade.aaa.agent.DeleteNot
instance.ExceptionReply
replies are sent to the pending receivers, and the remaining messages are sent to the DMQ and deleted.
protected void doProcess(UnknownAgent uA)
Method specifically processing anUnknownAgent
instance. The specific processing is done when aQueueMsgReply
was sent to a requester which does not exist anymore. In that case, the messages sent to this requester and not yet acknowledged are marked as "denied" for delivery to an other requester, and a new delivery sequence is launched. Messages considered as undeliverable are removed and sent to the DMQ.
protected void doProcess(ClientMessages not)
Method specifically processing aClientMessages
instance. This method stores the messages and launches a delivery sequence.
protected void doProcess(SetRightRequest not)
Method specifically processing aSetRightRequest
instance. When a reader is removed, and receive requests of this reader are still on the queue, they are replied to by anExceptionReply
.
protected void doReact(AgentId from, AcknowledgeRequest not)
Method implementing the reaction to anAcknowledgeRequest
instance, requesting messages to be acknowledged.
protected void doReact(AgentId from, BrowseRequest not) throws AccessException
Method implementing the queue reaction to aBrowseRequest
instance, requesting an enumeration of the messages on the queue. The method sends aBrowseReply
back to the client. Expired messages are sent to the DMQ.
- Throws:
AccessException
- If the requester is not a reader.
protected void doReact(AgentId from, DenyRequest not)
Method implementing the reaction to aDenyRequest
instance, requesting messages to be denied. This method denies the messages and launches a delivery sequence. Messages considered as undeliverable are sent to the DMQ.
protected void doReact(AgentId from, Monit_GetDMQSettings not) throws AccessException
Overrides thisDestinationImpl
method for sending back the threshold along with the DMQ id.
- Overrides:
- doReact in interface DestinationImpl
- Throws:
AccessException
- If the requester is not the administrator.
protected void doReact(AgentId from, Monit_GetPendingMessages not) throws AccessException
Method implementing the reaction to aMonit_GetPendingMessages
notification requesting the number of pending messages.
- Throws:
AccessException
- If the requester is not the administrator.
protected void doReact(AgentId from, Monit_GetPendingRequests not) throws AccessException
Method implementing the reaction to aMonit_GetPendingRequests
notification requesting the number of pending requests.
- Throws:
AccessException
- If the requester is not the administrator.
protected void doReact(AgentId from, ReceiveRequest not) throws AccessException
Method implementing the reaction to aReceiveRequest
instance, requesting a message. This method stores the request and launches a delivery sequence.
- Throws:
AccessException
- If the sender is not a reader.
protected void doReact(AgentId from, SetThreshRequest req) throws AccessException
Method implementing the reaction to aSetThreshRequest
instance setting the threshold value for this queue.
- Throws:
AccessException
- If the requester is not the administrator.
protected boolean isUndeliverable(Message message)
Returnstrue
if a given message is considered as undeliverable, because its delivery count matches the queue's threshold, if any, or the server's default threshold value (if any).
protected void messageDelivered(String msgId)
call in deliverMessages just after channel.sendTo(msg), overload this methode to process a specific treatment.
protected void messageRemoved(String msgId)
call in deliverMessages just after a remove message (invalid), overload this methode to process a specific treatment.
public void react(AgentId from, Notification not) throws UnknownNotificationException
Distributes the received notifications to the appropriate reactions.
- Overrides:
- react in interface DestinationImpl
- Throws:
UnknownNotificationException
- When receiving an unexpected notification.
protected void specialProcess(Notification not)
TheDestinationImpl
class calls this method for passing notifications which have been partly processed, so that they are specifically processed by theQueueImpl
class.
- Overrides:
- specialProcess in interface DestinationImpl
protected void storeMessage(Message message)
Actually stores a message in the deliverables vector.
- Parameters:
message
- The message to store.
public String toString()