Package org.zalando.riptide
Interface Plugin
- All Known Implementing Classes:
OriginalStackTracePlugin
@API(status=MAINTAINED)
public interface Plugin
Plugins allow to modify
executions of requests in order to inject specific behaviour.
The chronological order of phases is
- Async
- Phases afterwards are executed asynchronously.
- Dispatch
- Performs the response routing onto the supplied routing tree upon receiving a response.
- Serialization
- Serialization of the request body.
- Network
- The actual network communication.
request executions allows plugins to inject behavior before, after and even
during the execution on a request.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault RequestExecutionaroundAsync(RequestExecution execution) The given execution will be executed in a different thread and therefore be properly asynchronous.default RequestExecutionaroundDispatch(RequestExecution execution) The given execution will have the response already being dispatched onto the givenRoute.default RequestExecutionaroundNetwork(RequestExecution execution) The given execution will include the pure network communication.default RequestExecutionaroundSerialization(RequestExecution execution) The given execution will have the request body already serialized into bytes.static Pluginstatic Plugin
-
Method Details
-
aroundAsync
The given execution will be executed in a different thread and therefore be properly asynchronous. This phase is useful for plugins which either need to perform some task in the calling thread or (more commonly) may trigger other asynchronous operations concurrently to the request.- Parameters:
execution- the execution that includes the thread switch as well as the dispatch, serialization and network phases- Returns:
- the new, potentially modified execution
-
aroundDispatch
The given execution will have the response already being dispatched onto the givenRoute. Any exceptions that were produced from the response will be observable in this stage.- Parameters:
execution- the execution that includes the dispatch, serialization and network phase- Returns:
- the new, potentially modified execution
-
aroundSerialization
The given execution will have the request body already serialized into bytes.- Parameters:
execution- the execution that includes serialization and network phase- Returns:
- the new, potentially modified execution
-
aroundNetwork
The given execution will include the pure network communication. Any exceptions that were the result of writing to and reading from the TCP socket will be observable in this stage.- Parameters:
execution- the execution that includes the network communication- Returns:
- the new, potentially modified execution
-
composite
-
composite
-