openr66.protocol.networkhandler
Class R66ConstraintLimitHandler

java.lang.Object
  extended by goldengate.common.cpu.GgConstraintLimitHandler
      extended by openr66.protocol.networkhandler.R66ConstraintLimitHandler
All Implemented Interfaces:
Runnable

public class R66ConstraintLimitHandler
extends goldengate.common.cpu.GgConstraintLimitHandler

R66 Constraint Limit Handler Constraint Limit (CPU and connection - network and local -) handler, only for server side (requested or requester).

Author:
Frederic Bregier

Field Summary
 
Fields inherited from class goldengate.common.cpu.GgConstraintLimitHandler
lastAlert
 
Constructor Summary
R66ConstraintLimitHandler()
           
R66ConstraintLimitHandler(boolean useCpuLimit, boolean useJdKCpuLimit, double cpulimit, int channellimit)
           
R66ConstraintLimitHandler(boolean useCpuLimit, boolean useJdKCpuLimit, double cpulimit, int channellimit, double lowcpuLimit, double highcpuLimit, double percentageDecrease, org.jboss.netty.handler.traffic.GlobalTrafficShapingHandler handler, long delay, long limitLowBandwidth)
           
R66ConstraintLimitHandler(boolean useJdKCpuLimit, double lowcpuLimit, double highcpuLimit, double percentageDecrease, org.jboss.netty.handler.traffic.GlobalTrafficShapingHandler handler, long delay, long limitLowBandwidth)
           
 
Method Summary
protected  int getNumberLocalChannel()
           
protected  long getReadLimit()
           
protected  long getWriteLimit()
           
 
Methods inherited from class goldengate.common.cpu.GgConstraintLimitHandler
checkConstraints, checkConstraintsSleep, getChannelLimit, getCpuLimit, getSleepTime, release, run, setChannelLimit, setCpuLimit, setHandler, setServer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

R66ConstraintLimitHandler

public R66ConstraintLimitHandler()

R66ConstraintLimitHandler

public R66ConstraintLimitHandler(boolean useJdKCpuLimit,
                                 double lowcpuLimit,
                                 double highcpuLimit,
                                 double percentageDecrease,
                                 org.jboss.netty.handler.traffic.GlobalTrafficShapingHandler handler,
                                 long delay,
                                 long limitLowBandwidth)
Parameters:
useJdKCpuLimit - True to use JDK Cpu native or False for JavaSysMon
lowcpuLimit - for proactive cpu limitation (throttling bandwidth) (0<= x < 1 & highcpulimit)
highcpuLimit - for proactive cpu limitation (throttling bandwidth) (0<= x <= 1) 0 meaning no throttle activated
percentageDecrease - for proactive cpu limitation, throttling bandwidth reduction (0 < x < 1) as 0.25 for 25% of reduction
handler - the GlobalTrafficShapingHandler associated (null to have no proactive cpu limitation)
delay - the delay between 2 tests for proactive cpu limitation
limitLowBandwidth - the minimal bandwidth (read or write) to apply when decreasing bandwidth (low limit = 4096)

R66ConstraintLimitHandler

public R66ConstraintLimitHandler(boolean useCpuLimit,
                                 boolean useJdKCpuLimit,
                                 double cpulimit,
                                 int channellimit)
Parameters:
useCpuLimit - True to enable cpuLimit on connection check
useJdKCpuLimit - True to use JDK Cpu native or False for JavaSysMon
cpulimit - high cpu limit (0<= x < 1) to refuse new connections
channellimit - number of connection limit (0<= x)

R66ConstraintLimitHandler

public R66ConstraintLimitHandler(boolean useCpuLimit,
                                 boolean useJdKCpuLimit,
                                 double cpulimit,
                                 int channellimit,
                                 double lowcpuLimit,
                                 double highcpuLimit,
                                 double percentageDecrease,
                                 org.jboss.netty.handler.traffic.GlobalTrafficShapingHandler handler,
                                 long delay,
                                 long limitLowBandwidth)
Parameters:
useCpuLimit - True to enable cpuLimit on connection check
useJdKCpuLimit - True to use JDK Cpu native or False for JavaSysMon
cpulimit - high cpu limit (0<= x < 1) to refuse new connections
channellimit - number of connection limit (0<= x)
lowcpuLimit - for proactive cpu limitation (throttling bandwidth) (0<= x < 1 & highcpulimit)
highcpuLimit - for proactive cpu limitation (throttling bandwidth) (0<= x <= 1) 0 meaning no throttle activated
percentageDecrease - for proactive cpu limitation, throttling bandwidth reduction (0 < x < 1) as 0.25 for 25% of reduction
handler - the GlobalTrafficShapingHandler associated (null to have no proactive cpu limitation)
delay - the delay between 2 tests for proactive cpu limitation
limitLowBandwidth - the minimal bandwidth (read or write) to apply when decreasing bandwidth (low limit = 4096)
Method Detail

getNumberLocalChannel

protected int getNumberLocalChannel()
Specified by:
getNumberLocalChannel in class goldengate.common.cpu.GgConstraintLimitHandler

getReadLimit

protected long getReadLimit()
Specified by:
getReadLimit in class goldengate.common.cpu.GgConstraintLimitHandler

getWriteLimit

protected long getWriteLimit()
Specified by:
getWriteLimit in class goldengate.common.cpu.GgConstraintLimitHandler


Copyright © 2009-2012 Frederic Bregier. All Rights Reserved.