public class ControlPoint extends Object
Modifier and Type | Method and Description |
---|---|
RunResult |
beginRequest()
All tasks entering the system via this entry point must call this method.
|
RunResult |
forceBeginRequest()
This task should only be called by a thread that has already been accepted from an entry point.
|
void |
forceQueueTask(Runnable task,
Executor taskExecutor)
Queues a task to run when the request controller allows it.
|
int |
getActiveRequestCount() |
String |
getDeployment() |
String |
getEntryPoint() |
boolean |
isPaused() |
void |
pause(ServerActivityCallback requestCountListener)
Pause the current entry point, and invoke the provided listener when all current requests have finished.
|
void |
queueTask(Runnable task,
Executor taskExecutor,
long timeout,
Runnable timeoutTask,
boolean rejectOnSuspend)
Queues a task to run when the request controller allows it.
|
void |
requestComplete()
Method that should be invoked once (and only once) to signify that a request has finished.
|
void |
resume()
Cancel the pause operation
|
public String getEntryPoint()
public String getDeployment()
public void pause(ServerActivityCallback requestCountListener)
requestCountListener
- The listener to invokepublic void resume()
public RunResult beginRequest() throws Exception
RUN
then the task should proceed as normal, and the requestComplete()
method
must be called once the task is complete, usually via a try/finally construct.Exception
public RunResult forceBeginRequest() throws Exception
Note that this can still be rejected if the global request limit has been hit.
If it returnsRUN
then the task should proceed as normal, and the requestComplete()
method
must be called once the task is complete, usually via a try/finally construct.Exception
public void requestComplete()
public void queueTask(Runnable task, Executor taskExecutor, long timeout, Runnable timeoutTask, boolean rejectOnSuspend)
Note that the task will be run within the context of a beginRequest()
call, if the task
is executed there is no need to invoke on the control point again.
task
- The task to runtimeout
- The timeout in milliseconds, if this is larger than zero the task will be timed out after
this much time has elapsedtimeoutTask
- The task that is run on timeoutrejectOnSuspend
- If the task should be rejected if the container is suspended, if this happens the timeout task is invoked immediatelypublic void forceQueueTask(Runnable task, Executor taskExecutor)
beginRequest()
call, if the task
is executed there is no need to invoke on the control point again.task
- The task to runtaskExecutor
- The executor to run the task inpublic boolean isPaused()
public int getActiveRequestCount()
Copyright © 2023 JBoss by Red Hat. All rights reserved.