|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.glassfish.grizzly.filterchain.BaseFilter
org.glassfish.grizzly.rcm.ResourceAllocationFilter
public class ResourceAllocationFilter
This Filter is an implementation of a Resource Consumption Management
(RCM) system. RCM system are allowing you to enable virtualization of system
resources per web application, similar to Solaris 10 Zone or the outcome of
the upcoming JSR 284.
This Filter uses system properties to determine which
token to use to enable virtualization. As an example, configuring this class
to use the ContextRootAlgorithm will allow virtualization
and isolation of http request. As an example, if you define:
-Dcom.glassfish.grizzly.rcm.policyMetric="/myApplication|0.9"
This Filter will allocate 90% of the current threads count to
application myApplication, and the remaining 10% to any other context-root
(or application).
| Field Summary | |
|---|---|
protected static java.lang.String |
ALLOCATION_MODE
|
protected static java.lang.String |
allocationPolicy
The allocation mode used: ceiling or Reserve. |
protected static java.lang.String |
CEILING
|
protected static double |
leftRatio
The thread ratio used when an application isn't listed as a privileged application. |
protected static java.lang.String |
PATH_STRING
|
protected static java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.Double> |
privilegedTokens
The list of privileged token used to decide if a request can be serviced by the privileged ExecutorService. |
protected static java.lang.String |
QUERY_STRING
|
protected static java.lang.String |
RESERVE
|
protected static java.lang.String |
RULE_TOKENS
|
protected static java.util.concurrent.ConcurrentHashMap<java.lang.String,java.util.concurrent.ExecutorService> |
threadPools
The ExecutorService configured based on the
threadRatio. |
| Constructor Summary | |
|---|---|
ResourceAllocationFilter()
|
|
ResourceAllocationFilter(int standardThreadPoolSize)
|
|
| Method Summary | |
|---|---|
java.util.concurrent.ExecutorService |
filterRequest(java.lang.String token)
Filter the request and decide which thread pool to use. |
protected java.lang.String |
getContextRoot(java.lang.String token)
Get the context-root from the StreamReader |
int |
getStandardThreadPoolSize()
|
NextAction |
handleRead(FilterChainContext ctx)
|
protected boolean |
isThreadPoolInUse()
Check to see if the privileged thread pool are in-use right now. |
protected java.util.concurrent.ExecutorService |
newThreadPool(int threadCount)
Creates a new ExecutorService |
protected boolean |
parse(Buffer inputMessage,
int state,
java.lang.StringBuilder sb)
|
| Methods inherited from class org.glassfish.grizzly.filterchain.BaseFilter |
|---|
createContext, exceptionOccurred, getFilterChain, getIndex, handleAccept, handleClose, handleConnect, handleEvent, handleWrite, onAdded, onFilterChainChanged, onRemoved |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String RESERVE
protected static final java.lang.String CEILING
protected static final java.lang.String ALLOCATION_MODE
protected static final java.lang.String RULE_TOKENS
protected static final java.lang.String QUERY_STRING
protected static final java.lang.String PATH_STRING
protected static final java.util.concurrent.ConcurrentHashMap<java.lang.String,java.util.concurrent.ExecutorService> threadPools
ExecutorService configured based on the
threadRatio. This ExecutorService is only used
by privileged application.
protected static final java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.Double> privilegedTokens
ExecutorService.
protected static double leftRatio
protected static java.lang.String allocationPolicy
| Constructor Detail |
|---|
public ResourceAllocationFilter()
public ResourceAllocationFilter(int standardThreadPoolSize)
| Method Detail |
|---|
public NextAction handleRead(FilterChainContext ctx)
throws java.io.IOException
handleRead in interface FilterhandleRead in class BaseFilterjava.io.IOExceptionpublic int getStandardThreadPoolSize()
public java.util.concurrent.ExecutorService filterRequest(java.lang.String token)
protected java.util.concurrent.ExecutorService newThreadPool(int threadCount)
ExecutorService
protected boolean isThreadPoolInUse()
protected java.lang.String getContextRoot(java.lang.String token)
StreamReader
protected boolean parse(Buffer inputMessage,
int state,
java.lang.StringBuilder sb)
throws java.io.IOException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||