org.objectweb.joram.mom.dest
Class LoadingFactor

java.lang.Object
  extended by org.objectweb.joram.mom.dest.LoadingFactor
All Implemented Interfaces:
java.io.Serializable

public class LoadingFactor
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Nested Class Summary
static class LoadingFactor.ConsumerStatus
           
static class LoadingFactor.ProducerStatus
           
static class LoadingFactor.Status
           
 
Field Summary
 boolean autoEvalThreshold
          automatic eval threshold
 ClusterQueue clusterQueue
          reference to clusterQueue
 int consumThreshold
          consumer threshold
static org.objectweb.util.monolog.api.Logger logger
          logger
 int producThreshold
          producer threshold
 long validityPeriod
          validity period
 
Constructor Summary
LoadingFactor(ClusterQueue clusterQueue, int producThreshold, int consumThreshold, boolean autoEvalThreshold, long validityPeriod)
           
 
Method Summary
 float evalRateOfFlow(int pendingMessages, int pendingRequests)
          Evaluates the average rate of flow.
 void factorCheck(java.util.Map clusters, int pendingMessages, int pendingRequests)
          This method evaluates the rate of flow and activity.
 java.lang.String getConsumerStatus()
           
 java.lang.String getProducerStatus()
           
 float getRateOfFlow()
           
 java.lang.String getStatus()
           
 boolean isOverloaded()
          true if cluster queue is overloaded.
 void setRateOfFlow(float rateOfFlow)
           
 void setWait()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

public static org.objectweb.util.monolog.api.Logger logger
logger


clusterQueue

public ClusterQueue clusterQueue
reference to clusterQueue


producThreshold

public int producThreshold
producer threshold


consumThreshold

public int consumThreshold
consumer threshold


autoEvalThreshold

public boolean autoEvalThreshold
automatic eval threshold


validityPeriod

public long validityPeriod
validity period

Constructor Detail

LoadingFactor

public LoadingFactor(ClusterQueue clusterQueue,
                     int producThreshold,
                     int consumThreshold,
                     boolean autoEvalThreshold,
                     long validityPeriod)
Method Detail

setRateOfFlow

public void setRateOfFlow(float rateOfFlow)

getRateOfFlow

public float getRateOfFlow()

getStatus

public java.lang.String getStatus()

getProducerStatus

public java.lang.String getProducerStatus()

getConsumerStatus

public java.lang.String getConsumerStatus()

setWait

public void setWait()

evalRateOfFlow

public float evalRateOfFlow(int pendingMessages,
                            int pendingRequests)
Evaluates the average rate of flow. If rateOfFlow is greater than 1 the queue are more pending requests than pending messages else if rateOfFlow is lower than 1 the queue are more pending messages than pending requests. This value is set in all QueueClusterNot notification.

Parameters:
pendingMessages - the number of pending messages.
pendingRequests - the number of pending requests.
Returns:
the rate of flow

factorCheck

public void factorCheck(java.util.Map clusters,
                        int pendingMessages,
                        int pendingRequests)
This method evaluates the rate of flow and activity. If necessary send "give" or "hope" messages, and update threshold.

Parameters:
clusters -
pendingMessages -
pendingRequests -

isOverloaded

public boolean isOverloaded()
true if cluster queue is overloaded. depends on activity.

Returns:
true if cluster queue is overloaded.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011 ScalAgent D.T.. All Rights Reserved.