|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.web.ara.rules.ThreadRatioRule
public class ThreadRatioRule
Based on the application context-root, configure the ReadTask
Pipeline. Based on the thread-ratio defined in domain.xml, an
application can have privileged Pipeline, configured to
use specific percentage of the maximum number of threads. This
Rule instanciate two types of Pipeline
privilegedPipeline is will be used to execute privileged
applications.
victimsPipeline is will be used to execute others
application that aren't included within the privileged tokens.
An application is marked privileged if the set of Rule applied
to the application requests is matched.
| Field Summary | |
|---|---|
protected static String |
ALLOCATION_MODE
|
protected static String |
allocationPolicy
The allocation mode used: celling or Reserve. |
protected static String |
CEILING
|
protected static double |
leftRatio
The thread ratio used when an application isn't listed as a privileged application. |
protected static String |
PATH_STRING
|
protected static ConcurrentHashMap<String,Pipeline> |
pipelines
The Pipeline configured based on the
threadRatio. |
protected static ConcurrentHashMap<String,Double> |
privilegedTokens
The list of privileged token used to decide if a request can be serviced by the privileged Pipeline. |
protected static String |
QUERY_STRING
|
protected ReadTask |
readTask
The ReadTask attached to this Rule |
protected static String |
RESERVE
|
protected static String |
RULE_TOKENS
|
| Constructor Summary | |
|---|---|
ThreadRatioRule()
Creates a new ThreadRationRule. |
|
| Method Summary | |
|---|---|
protected Pipeline |
applyRule(String token)
Apply the thread ratio. |
void |
attach(ReadTask o)
Attach a ReadTask to this rule. |
ReadTask |
attachement()
Return the current attachement. |
Integer |
call()
Invoke the rule. |
void |
cancel()
Cancel execution of this rule. |
protected String |
getContextRoot()
Get the context-root from the ByteBuffer |
int |
getExecutionTime()
Return the time in second before this rule will be executed. |
protected boolean |
isPipelineInUse()
Check to see if the privileged pipeline are in-use right now. |
protected Pipeline |
newPipeline(int threadCount,
Pipeline p)
Creates a new Pipeline |
void |
setExecutionTime(int time)
Set the interval in seconds to wait before executing this rule. |
void |
setFuture(Future future)
Set the Future associated with this execution of this rule. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String RESERVE
protected static final String CEILING
protected static final String ALLOCATION_MODE
protected static final String RULE_TOKENS
protected static final String QUERY_STRING
protected static final String PATH_STRING
protected ReadTask readTask
ReadTask attached to this Rule
protected static final ConcurrentHashMap<String,Pipeline> pipelines
Pipeline configured based on the
threadRatio. This Pipeline is only used
by privileged application.
protected static final ConcurrentHashMap<String,Double> privilegedTokens
Pipeline.
protected static double leftRatio
protected static String allocationPolicy
| Constructor Detail |
|---|
public ThreadRatioRule()
| Method Detail |
|---|
public void attach(ReadTask o)
ReadTask to this rule.
attach in interface Rule<ReadTask>public ReadTask attachement()
attachement in interface Rule<ReadTask>
public Integer call()
throws Exception
ContextRootAlgorithm, configure the ReadTask
Pipeline.
call in interface CallableExceptionprotected String getContextRoot()
ByteBuffer
protected Pipeline applyRule(String token)
protected Pipeline newPipeline(int threadCount,
Pipeline p)
Pipeline
protected boolean isPipelineInUse()
public void cancel()
cancel in interface Rule<ReadTask>public int getExecutionTime()
getExecutionTime in interface Rule<ReadTask>public void setExecutionTime(int time)
setExecutionTime in interface Rule<ReadTask>public void setFuture(Future future)
Future associated with this execution of this rule.
setFuture in interface Rule<ReadTask>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||