Class ReturnInterceptor
java.lang.Object
com.predic8.membrane.core.interceptor.AbstractInterceptor
com.predic8.membrane.core.interceptor.misc.ReturnInterceptor
- All Implemented Interfaces:
Interceptor
- Description
- Terminates the exchange flow. The returned response is determined in the following order:
1. If there is already a response in the exchange, that response is returned 2. If there is no response in the exchange, the body and contentType of the request is copied into a new response.
The options statusCode and contentType will overwrite the values from the messages.
This plugin is useful together with the template plugin. See examples/template.
- Topic
- 4. Interceptors/Features
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.predic8.membrane.core.interceptor.Interceptor
Interceptor.Flow -
Field Summary
Fields inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
name, router -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioninthandleRequest(Exchange exc) voidsetContentType(String contentType) voidsetStatusCode(int statusCode) Methods inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
getFlow, getHelpId, getLongDescription, getMessage, getRouter, getRule, handleAbort, handleResponse, init, init, setDisplayName, setFlow
-
Constructor Details
-
ReturnInterceptor
public ReturnInterceptor()
-
-
Method Details
-
setStatusCode
public void setStatusCode(int statusCode) -
getStatusCode
public int getStatusCode() -
setContentType
-
getContentType
-
handleRequest
- Specified by:
handleRequestin interfaceInterceptor- Overrides:
handleRequestin classAbstractInterceptor- Throws:
Exception
-
getDisplayName
- Specified by:
getDisplayNamein interfaceInterceptor- Overrides:
getDisplayNamein classAbstractInterceptor
-
getShortDescription
- Specified by:
getShortDescriptionin interfaceInterceptor- Overrides:
getShortDescriptionin classAbstractInterceptor
-