|
Joram ${version} | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.joram.mom.dest.DestinationImpl
org.objectweb.joram.mom.dest.QueueImpl
The QueueImpl
class implements the MOM queue behaviour,
basically storing messages and delivering them upon clients requests.
Field Summary | |
protected long |
arrivalsCounter
Counter of messages arrivals. |
protected java.util.Hashtable |
consumers
Table keeping the messages' consumers identifiers. |
protected java.util.Hashtable |
contexts
Table keeping the messages' consumers contexts. |
protected java.util.Hashtable |
deliveredMsgs
Table holding the delivered messages before acknowledgement. |
protected java.util.Vector |
messages
Vector holding the messages before delivery. |
protected int |
nbMaxMsg
nb Max of Message store in queue (-1 no limit). |
protected boolean |
receiving
true if the queue is currently receiving messages. |
protected java.util.Vector |
requests
Vector holding the requests before reply or expiry. |
Fields inherited from class org.objectweb.joram.mom.dest.DestinationImpl |
_rights, clients, creationDate, destId, dmqId, freeReading, freeWriting, nbMsgsDeliverSinceCreation, nbMsgsReceiveSinceCreation, nbMsgsSendToDMQSinceCreation, READ, READWRITE, WRITE |
Constructor Summary | |
QueueImpl(fr.dyade.aaa.agent.AgentId destId,
fr.dyade.aaa.agent.AgentId adminId)
Constructs a QueueImpl instance. |
Method Summary | |
protected void |
deliverMessages(int index)
|
protected void |
doProcess(ClientMessages not)
Method specifically processing a ClientMessages instance. |
protected void |
doProcess(fr.dyade.aaa.agent.DeleteNot not)
Method specifically processing a fr.dyade.aaa.agent.DeleteNot instance. |
protected void |
doProcess(SetRightRequest not)
Method specifically processing a SetRightRequest instance. |
protected void |
doProcess(fr.dyade.aaa.agent.UnknownAgent uA)
Method specifically processing an UnknownAgent instance. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
AbortReceiveRequest not)
|
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
AcknowledgeRequest not)
Method implementing the reaction to an AcknowledgeRequest
instance, requesting messages to be acknowledged. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
BrowseRequest not)
Method implementing the queue reaction to a BrowseRequest
instance, requesting an enumeration of the messages on the queue. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
DenyRequest not)
Method implementing the reaction to a DenyRequest
instance, requesting messages to be denied. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
Monit_GetDMQSettings not)
Overrides this DestinationImpl method for sending back
the threshold along with the DMQ id. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
Monit_GetNbMaxMsg not)
Method implementing the reaction to a Monit_GetNbMaxMsg notification requesting the
number max of messages in this queue. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
Monit_GetPendingMessages not)
Method implementing the reaction to a Monit_GetPendingMessages notification requesting the
number of pending messages. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
Monit_GetPendingRequests not)
Method implementing the reaction to a Monit_GetPendingRequests notification requesting the
number of pending requests. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
ReceiveRequest not)
Method implementing the reaction to a ReceiveRequest
instance, requesting a message. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
SetNbMaxMsgRequest req)
Method implementing the reaction to a SetNbMaxMsgRequest
instance setting the NbMaxMsg value for this queue. |
protected void |
doReact(fr.dyade.aaa.agent.AgentId from,
SetThreshRequest req)
Method implementing the reaction to a SetThreshRequest
instance setting the threshold value for this queue. |
int |
getDeliveredMessageCount()
Returns the number of messages delivered and waiting for acknowledge. |
int |
getMessageCounter()
Returns the number of messages received since creation time. |
int |
getNbMaxMsg()
Returns the maximum number of message for the destination. |
int |
getPendingMessageCount()
Returns the number of pending messages in the queue. |
int |
getThreshold()
Returns the threshold value of this queue, -1 if not set. |
int |
getWaitingRequestCount()
Returns the number of waiting requests in the queue. |
protected boolean |
isUndeliverable(Message message)
Returns true 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(java.lang.String msgId)
call in deliverMessages just after channel.sendTo(msg), overload this methode to process a specific treatment. |
protected void |
messageRemoved(java.lang.String msgId)
call in deliverMessages just after a remove message (invalid), overload this methode to process a specific treatment. |
void |
react(fr.dyade.aaa.agent.AgentId from,
fr.dyade.aaa.agent.Notification not)
Distributes the received notifications to the appropriate reactions. |
void |
readBag(java.io.ObjectInputStream in)
|
void |
setNbMaxMsg(int nbMaxMsg)
Sets the maximum number of message for the destination. |
void |
setThreshold(int threshold)
Sets or unsets the threshold for this queue. |
protected void |
specialProcess(fr.dyade.aaa.agent.Notification not)
The DestinationImpl class calls this method for passing
notifications which have been partly processed, so that they are
specifically processed by the QueueImpl class. |
protected void |
storeMessage(Message message)
Actually stores a message in the deliverables vector. |
java.lang.String |
toString()
Returns a string representation of this destination. |
void |
writeBag(java.io.ObjectOutputStream out)
|
Methods inherited from class org.objectweb.joram.mom.dest.DestinationImpl |
canBeDeleted, doReact, doReact, doReact, doReact, doReact, doReact, doReact, doReact, doReact, doReact, getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQId, getNbMsgsDeliverSinceCreation, getNbMsgsReceiveSinceCreation, getNbMsgsSendToDMQSinceCreation, getRight, getRights, isAdministrator, isFreeReading, isFreeWriting, isReader, isWriter, processSetRight, sendToDMQ, setFreeReading, setFreeWriting, specialAdminProcess |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.objectweb.joram.mom.dest.DestinationImplMBean |
getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQId, getNbMsgsDeliverSinceCreation, getNbMsgsReceiveSinceCreation, getNbMsgsSendToDMQSinceCreation, getRight, getRights, isFreeReading, isFreeWriting, setFreeReading, setFreeWriting |
Field Detail |
protected java.util.Hashtable consumers
protected java.util.Hashtable contexts
protected long arrivalsCounter
protected java.util.Vector requests
protected transient boolean receiving
true
if the queue is currently receiving messages.
protected transient java.util.Vector messages
protected transient java.util.Hashtable deliveredMsgs
protected int nbMaxMsg
Constructor Detail |
public QueueImpl(fr.dyade.aaa.agent.AgentId destId, fr.dyade.aaa.agent.AgentId adminId)
QueueImpl
instance.
destId
- Identifier of the agent hosting the queue.adminId
- Identifier of the administrator of the queue.Method Detail |
public int getThreshold()
getThreshold
in interface QueueImplMBean
public void setThreshold(int threshold)
setThreshold
in interface QueueImplMBean
public int getMessageCounter()
getMessageCounter
in interface QueueImplMBean
public int getWaitingRequestCount()
getWaitingRequestCount
in interface QueueImplMBean
public int getPendingMessageCount()
getPendingMessageCount
in interface QueueImplMBean
public int getDeliveredMessageCount()
getDeliveredMessageCount
in interface QueueImplMBean
public int getNbMaxMsg()
getNbMaxMsg
in interface QueueImplMBean
public void setNbMaxMsg(int nbMaxMsg)
setNbMaxMsg
in interface QueueImplMBean
nbMaxMsg
- the maximum number of message (-1 set no limit).public java.lang.String toString()
toString
in interface DestinationImplMBean
public void react(fr.dyade.aaa.agent.AgentId from, fr.dyade.aaa.agent.Notification not) throws fr.dyade.aaa.agent.UnknownNotificationException
react
in class DestinationImpl
fr.dyade.aaa.agent.UnknownNotificationException
- When receiving an unexpected
notification.protected void doReact(fr.dyade.aaa.agent.AgentId from, SetThreshRequest req) throws AccessException
SetThreshRequest
instance setting the threshold value for this queue.
AccessException
- If the requester is not the administrator.protected void doReact(fr.dyade.aaa.agent.AgentId from, SetNbMaxMsgRequest req) throws AccessException
SetNbMaxMsgRequest
instance setting the NbMaxMsg value for this queue.
AccessException
- If the requester is not the administrator.protected void doReact(fr.dyade.aaa.agent.AgentId from, Monit_GetDMQSettings not) throws AccessException
DestinationImpl
method for sending back
the threshold along with the DMQ id.
doReact
in class DestinationImpl
AccessException
- If the requester is not the administrator.protected void doReact(fr.dyade.aaa.agent.AgentId from, Monit_GetPendingMessages not) throws AccessException
Monit_GetPendingMessages
notification requesting the
number of pending messages.
AccessException
- If the requester is not the administrator.protected void doReact(fr.dyade.aaa.agent.AgentId from, Monit_GetPendingRequests not) throws AccessException
Monit_GetPendingRequests
notification requesting the
number of pending requests.
AccessException
- If the requester is not the administrator.protected void doReact(fr.dyade.aaa.agent.AgentId from, Monit_GetNbMaxMsg not) throws AccessException
Monit_GetNbMaxMsg
notification requesting the
number max of messages in this queue.
AccessException
- If the requester is not the administrator.protected void doReact(fr.dyade.aaa.agent.AgentId from, ReceiveRequest not) throws AccessException
ReceiveRequest
instance, requesting a message.
This method stores the request and launches a delivery sequence.
AccessException
- If the sender is not a reader.protected void doReact(fr.dyade.aaa.agent.AgentId from, BrowseRequest not) throws AccessException
BrowseRequest
instance, requesting an enumeration of the messages on the queue.
The method sends a BrowseReply
back to the client. Expired
messages are sent to the DMQ.
AccessException
- If the requester is not a reader.protected void doReact(fr.dyade.aaa.agent.AgentId from, AcknowledgeRequest not)
AcknowledgeRequest
instance, requesting messages to be acknowledged.
protected void doReact(fr.dyade.aaa.agent.AgentId from, DenyRequest not)
DenyRequest
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(fr.dyade.aaa.agent.AgentId from, AbortReceiveRequest not)
protected void specialProcess(fr.dyade.aaa.agent.Notification not)
DestinationImpl
class calls this method for passing
notifications which have been partly processed, so that they are
specifically processed by the QueueImpl
class.
specialProcess
in class DestinationImpl
protected void doProcess(SetRightRequest not)
SetRightRequest
instance.
When a reader is removed, and receive requests of this reader are still
on the queue, they are replied to by an ExceptionReply
.
protected void doProcess(ClientMessages not)
ClientMessages
instance.
This method stores the messages and launches a delivery sequence.
protected void doProcess(fr.dyade.aaa.agent.UnknownAgent uA)
UnknownAgent
instance.
The specific processing is done when a QueueMsgReply
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(fr.dyade.aaa.agent.DeleteNot not)
fr.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 storeMessage(Message message)
message
- The message to store.protected void deliverMessages(int index)
protected void messageDelivered(java.lang.String msgId)
protected void messageRemoved(java.lang.String msgId)
protected boolean isUndeliverable(Message message)
true
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).
public void readBag(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void writeBag(java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
|
Joram ${version} | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |