Class BackgroundSupport
java.lang.Object
uk.ac.manchester.spinnaker.alloc.web.BackgroundSupport
- Direct Known Subclasses:
SpallocServiceImpl
Enables a web service class to move processing a request into a background
task easily.
- Author:
- Donal Fellows
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interface
An action that produces a response, usually handled asynchronously. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
bgAction
(jakarta.ws.rs.container.AsyncResponse response, Permit permit, BackgroundSupport.BackgroundAction action) Run the action in the background and wrap it into the response when it completes.protected void
bgAction
(jakarta.ws.rs.container.AsyncResponse response, BackgroundSupport.BackgroundAction action) Run the action in the background and wrap it into the response when it completes.protected static void
fgAction
(jakarta.ws.rs.container.AsyncResponse response, BackgroundSupport.BackgroundAction action) Run the action immediately and wrap it into the response.
-
Constructor Details
-
BackgroundSupport
public BackgroundSupport()
-
-
Method Details
-
bgAction
protected void bgAction(jakarta.ws.rs.container.AsyncResponse response, BackgroundSupport.BackgroundAction action) Run the action in the background and wrap it into the response when it completes.- Parameters:
response
- The asynchronous response.action
- The action that generates aResponse
-
bgAction
protected void bgAction(jakarta.ws.rs.container.AsyncResponse response, Permit permit, BackgroundSupport.BackgroundAction action) Run the action in the background and wrap it into the response when it completes.- Parameters:
response
- The asynchronous response.permit
- The permissions granted to the asynchronous task from the context that asked for it to happen.action
- The action that generates aResponse
-
fgAction
protected static void fgAction(jakarta.ws.rs.container.AsyncResponse response, BackgroundSupport.BackgroundAction action) Run the action immediately and wrap it into the response.- Parameters:
response
- The asynchronous response.action
- The action that generates aResponse
-