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
org.objectweb.joram.mom.dest.ClusterQueueImpl
public class ClusterQueueImpl
extends QueueImpl
ClusterQueueImpl
class implements the MOM queue behaviour,
basically storing messages and delivering them upon clients requests or
delivering to an other cluster queue.
Field Summary | |
protected Hashtable |
|
protected LoadingFactor |
|
protected long |
|
protected long |
|
Fields inherited from class org.objectweb.joram.mom.dest.QueueImpl | |
arrivalsCounter , consumers , contexts , deliveredMsgs , messages , persistenceModule , receiving , requests |
Fields inherited from class org.objectweb.joram.mom.dest.DestinationImpl | |
READ , READWRITE , WRITE , adminId , clients , destId , dmqId , freeReading , freeWriting |
Constructor Summary | |
|
Method Summary | |
protected void |
|
protected void |
|
protected Object |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void | |
protected void |
|
protected void |
|
protected void |
|
protected void | |
long |
|
int | |
int | |
protected void |
|
protected void |
|
protected void |
|
void |
|
protected void |
|
protected void |
|
protected Object |
|
protected void |
|
String |
|
Methods inherited from class org.objectweb.joram.mom.dest.QueueImpl | |
deliverMessages , doProcess , doProcess , doProcess , doProcess , doReact , doReact , doReact , doReact , doReact , doReact , doReact , doReact , isUndeliverable , messageDelivered , messageRemoved , react , specialProcess , storeMessage , toString |
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 Hashtable clusters
key = agentId of ClusterQueue value = rateOfFlow (Float)
protected long period
period to eval the loading factor
protected long waitAfterClusterReq
waiting after a cluster request
public ClusterQueueImpl(AgentId destId, AgentId adminId, long period, int producThreshold, int consumThreshold, boolean autoEvalThreshold, long waitAfterClusterReq)
Constructs aClusterQueueImpl
instance.
- Parameters:
destId
- Identifier of the agent hosting the queue.adminId
- Identifier of the administrator of the queue.
protected void addQueueCluster(String joiningQueue, float rateOfFlow)
send to joiningQueue a JoinQueueCluster not.
protected void broadcastLeave(String removeQueue)
broadcast to cluster the removeQueue.
protected void doProcess(ClientMessages not)
overload doProcess(ClientMessages) store all msgId in timeTable and visitTable, store message and deliver message if consumer wait. call factorCheck to evaluate the loading factor, activity, ... and send message to cluster if need.
- Overrides:
- doProcess in interface QueueImpl
protected void doProcess(SetRightRequest not)
propagate right to all cluster.
- Overrides:
- doProcess in interface QueueImpl
protected void doReact(AgentId from, LBCycleLife not)
The messages are not consumed by an other cluster's queue in a periode time, try to consume in this queue. update visitTable, and process clientMessages.
protected void doReact(AgentId from, LBMessageGive not) throws UnknownNotificationException
load balancing message give by an other cluster queue. process ClientMessages, no need to check if sender is writer.
protected void doReact(AgentId from, LBMessageHope not)
load balancing message hope by the "from" queue.
protected void doReact(JoinQueueCluster not)
new queue come in cluster, update clusters. and spread to clusters the AckjoiningQueue.
protected void doReact(WakeUpNot not)
wake up, and call factorCheck to evaluate the loading factor... if msg stay more a periode time in timeTable send to an other (no visited) queue in cluster.
public long getClusterDeliveryCount()
return the number of Message send to cluster.
public int getNumberOfPendingMessages()
public int getNumberOfPendingRequests()
protected void messageDelivered(String msgId)
call in deliverMessages just after channel.sendTo(msg), overload this methode to process a specific treatment.
- Overrides:
- messageDelivered in interface QueueImpl
protected void messageRemoved(String msgId)
call in deliverMessages just after a remove message (invalid), overload this methode to process a specific treatment.
- Overrides:
- messageRemoved in interface QueueImpl
protected void messageSendToCluster(String msgId)
public void react(AgentId from, Notification not) throws UnknownNotificationException
Distributes the received notifications to the appropriate reactions.
- Overrides:
- react in interface QueueImpl
- Throws:
UnknownNotificationException
- When receiving an unexpected notification.
protected void removeQueueCluster(String removeQueue)
removeQueue leave the cluster.
protected Object specialAdminProcess(SpecialAdminRequest not) throws RequestException
use to add or remove ClusterQueue to cluster.
- Overrides:
- specialAdminProcess in interface DestinationImpl
protected void specialProcess(Notification not)
implement special process (see QueueImpl).
- Overrides:
- specialProcess in interface QueueImpl