|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.dyade.aaa.agent.Agent
org.objectweb.joram.mom.dest.Destination
org.objectweb.joram.mom.dest.Queue
org.objectweb.joram.mom.dest.ClusterQueue
public class ClusterQueue
The ClusterQueue
class implements the cluster queue behavior.
Field Summary | |
---|---|
protected java.util.Map |
clusters
key = agentId of ClusterQueue value = rateOfFlow (Float) |
protected LoadingFactor |
loadingFactor
to evaluate the loading factor, overloading, ... |
Fields inherited from class org.objectweb.joram.mom.dest.Queue |
---|
arrivalsCounter, consumers, contexts, deliveredMsgs, logger, messages, nbMaxMsg, receiving, requests |
Fields inherited from class org.objectweb.joram.mom.dest.Destination |
---|
_rights, clients, creationDate, dmqId, freeReading, freeWriting, nbMsgsDeliverSinceCreation, nbMsgsReceiveSinceCreation, nbMsgsSentToDMQSinceCreation, READ, READWRITE, task, WAKEUP_PERIOD, WRITE |
Fields inherited from class fr.dyade.aaa.agent.Agent |
---|
emptyString, fixed, logmon |
Constructor Summary | |
---|---|
ClusterQueue()
|
Method Summary | |
---|---|
protected void |
doDeleteNot(DeleteNot not)
Method specifically processing a fr.dyade.aaa.agent.DeleteNot instance. |
protected void |
doUnknownAgent(UnknownAgent uA)
Method specifically processing an UnknownAgent instance. |
protected ClientMessages |
getClientMessages(int nb,
java.lang.String selector,
boolean remove)
get a client message contain nb messages. |
long |
getClusterDeliveryCount()
return the number of Message send to cluster. |
java.lang.String[] |
getClusterElements()
|
java.lang.String |
getConsumerStatus()
Gets consumer status (NO, NORMAL, HIGH). |
int |
getConsumThreshold()
Gets the number of pending "receive" requests above which a queue will request messages from the other queues of the cluster. |
java.lang.String |
getProducerStatus()
Gets producer status (NO, NORMAL, HIGH). |
int |
getProducThreshold()
Gets the number of messages above which a queue is considered loaded. |
protected Message |
getQueueMessage(java.lang.String msgId,
boolean remove)
get mom message, delete if remove = true. |
float |
getRateOfFlow()
Gets an evaluation of the flow of messages handled by the queue. |
java.lang.String |
getStatus()
Gets the status of the queue (RUN, INIT or WAIT). |
long |
getWaitAfterClusterReq()
Gets the time (in ms) during which a queue which requested something from the cluster is not authorized to do it again. |
void |
handleAdminRequestNot(AgentId from,
FwdAdminRequestNot not)
|
void |
initialize(boolean firstTime)
Initializes the destination. |
boolean |
isAutoEvalThreshold()
True if an automatic reevaluation of the queues' thresholds values is allowed according to their activity. |
boolean |
isOverloaded()
Tells if the queue is overloaded. |
protected void |
messageDelivered(java.lang.String msgId)
call in deliverMessages just after forward(msg), overload this method to process a specific treatment. |
protected void |
monitoringMsgSendToCluster(java.lang.String msgId)
|
void |
postProcess(ClientMessages not)
call factorCheck to evaluate the loading factor, activity, ... and send message to cluster if need. |
ClientMessages |
preProcess(AgentId from,
ClientMessages not)
overload preProcess(AgentId, ClientMessages) store all msgId in timeTable and visitTable. |
void |
react(AgentId from,
Notification not)
Distributes the received notifications to the appropriate reactions. |
void |
receiveRequest(AgentId from,
ReceiveRequest not)
Method implementing the reaction to a ReceiveRequest
instance, requesting a message. |
protected void |
sendToCluster(Notification not)
Sends a notification to all queue in cluster. |
void |
setAutoEvalThreshold(boolean autoEvalThreshold)
Automatic reevaluation of the queues' thresholds can be done according to their activity. |
void |
setConsumThreshold(int consumThreshold)
Sets the number of pending "receive" requests above which a queue will request messages from the other queues of the cluster. |
void |
setProducThreshold(int producThreshold)
Sets the number of messages above which a queue is considered loaded. |
void |
setProperties(java.util.Properties prop)
Configures a ClusterQueue instance. |
void |
setWaitAfterClusterReq(long waitAfterClusterReq)
Sets the time (in ms) during which a queue which requested something from the cluster is not authorized to do it again. |
java.lang.String |
toString()
Returns a string representation of this destination. |
void |
wakeUpNot(WakeUpNot not)
wake up, and call factorCheck to evaluate the loading factor... if a message stays more than a period of time in timeTable, it is sent to an other (not visited) queue in cluster. |
Methods inherited from class fr.dyade.aaa.agent.Agent |
---|
delete, delete, deploy, deploy, getAgentId, getCommitTime, getId, getLogTopic, getName, getReactNb, getReactTime, isDeployed, isFixed, needToBeCommited, save, sendTo, sendTo, sendTo, setName, setNoSave, setSave |
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.QueueMBean |
---|
cleanPendingMessage, cleanWaitingRequest, getDeliveredMessageCount, getMessage, getMessages, getMessagesView, getNbMaxMsg, getPendingMessageCount, getThreshold, getWaitingRequestCount, setNbMaxMsg, setThreshold |
Methods inherited from interface org.objectweb.joram.mom.dest.DestinationMBean |
---|
delete, getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQId, getName, getNbMsgsDeliverSinceCreation, getNbMsgsReceiveSinceCreation, getNbMsgsSentToDMQSinceCreation, getPeriod, getRight, getRights, isFreeReading, isFreeWriting, setFreeReading, setFreeWriting, setPeriod |
Methods inherited from interface fr.dyade.aaa.agent.AgentMBean |
---|
getAgentId, getCommitTime, getReactNb, getReactTime, isFixed |
Field Detail |
---|
protected java.util.Map clusters
protected LoadingFactor loadingFactor
Constructor Detail |
---|
public ClusterQueue()
Method Detail |
---|
public void setProperties(java.util.Properties prop) throws RequestException
ClusterQueue
instance.
setProperties
in class Destination
prop
- The initial set of properties.
RequestException
public void initialize(boolean firstTime)
initialize
in class Queue
firstTime
- true when first called by the factorypublic void handleAdminRequestNot(AgentId from, FwdAdminRequestNot not)
handleAdminRequestNot
in class Queue
Destination.handleAdminRequestNot(fr.dyade.aaa.agent.AgentId, org.objectweb.joram.mom.notifications.FwdAdminRequestNot)
public void react(AgentId from, Notification not) throws java.lang.Exception
react
in class Queue
from
- agent sending notificationnot
- notification to react to
java.lang.Exception
public java.lang.String toString()
Queue
toString
in interface AgentMBean
toString
in interface DestinationMBean
toString
in class Queue
public java.lang.String[] getClusterElements()
getClusterElements
in interface ClusterDestinationMBean
public ClientMessages preProcess(AgentId from, ClientMessages not)
preProcess
in class Destination
from
- not
-
public void postProcess(ClientMessages not)
postProcess
in class Destination
not
- public void wakeUpNot(WakeUpNot not)
wakeUpNot
in class Queue
not
- public void receiveRequest(AgentId from, ReceiveRequest not) throws AccessException
Queue
ReceiveRequest
instance, requesting a message.
This method stores the request and launches a delivery sequence.
receiveRequest
in class Queue
not
- ReceiveRequest
AccessException
- If the sender is not a reader.protected ClientMessages getClientMessages(int nb, java.lang.String selector, boolean remove)
getClientMessages
in class Queue
nb
- number of messages returned in ClientMessage.selector
- jms selectorremove
- delete all messages returned if true
protected Message getQueueMessage(java.lang.String msgId, boolean remove)
getQueueMessage
in class Queue
msgId
- message identificationremove
- if true delete message
protected void sendToCluster(Notification not)
not
- The notification to send.protected void doDeleteNot(DeleteNot not)
Queue
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.
doDeleteNot
in class Queue
protected void doUnknownAgent(UnknownAgent uA)
Queue
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.
doUnknownAgent
in class Queue
public long getClusterDeliveryCount()
protected void messageDelivered(java.lang.String msgId)
Queue
messageDelivered
in class Queue
msgId
- protected void monitoringMsgSendToCluster(java.lang.String msgId)
msgId
- public void setWaitAfterClusterReq(long waitAfterClusterReq)
ClusterQueueMBean
setWaitAfterClusterReq
in interface ClusterQueueMBean
waitAfterClusterReq
- public void setProducThreshold(int producThreshold)
ClusterQueueMBean
setProducThreshold
in interface ClusterQueueMBean
producThreshold
- public void setConsumThreshold(int consumThreshold)
ClusterQueueMBean
setConsumThreshold
in interface ClusterQueueMBean
consumThreshold
- public void setAutoEvalThreshold(boolean autoEvalThreshold)
ClusterQueueMBean
setAutoEvalThreshold
in interface ClusterQueueMBean
autoEvalThreshold
- public int getProducThreshold()
ClusterQueueMBean
getProducThreshold
in interface ClusterQueueMBean
public int getConsumThreshold()
ClusterQueueMBean
getConsumThreshold
in interface ClusterQueueMBean
public boolean isAutoEvalThreshold()
ClusterQueueMBean
isAutoEvalThreshold
in interface ClusterQueueMBean
public long getWaitAfterClusterReq()
ClusterQueueMBean
getWaitAfterClusterReq
in interface ClusterQueueMBean
public float getRateOfFlow()
ClusterQueueMBean
getRateOfFlow
in interface ClusterQueueMBean
public boolean isOverloaded()
ClusterQueueMBean
isOverloaded
in interface ClusterQueueMBean
public java.lang.String getStatus()
ClusterQueueMBean
getStatus
in interface ClusterQueueMBean
LoadingFactor.Status
public java.lang.String getConsumerStatus()
ClusterQueueMBean
getConsumerStatus
in interface ClusterQueueMBean
LoadingFactor.ConsumerStatus
public java.lang.String getProducerStatus()
ClusterQueueMBean
getProducerStatus
in interface ClusterQueueMBean
LoadingFactor.ProducerStatus
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |