Package org.restlet.service
Class ConnectorService
java.lang.Object
org.restlet.service.Service
org.restlet.service.ConnectorService
Application service declaring client and server connectors. This is useful at
deployment time to know which connectors an application expects to be able to
use.
If you need to override the
Implementation note: the parent component will ensure that client connectors won't automatically follow redirections. This will ensure a consistent behavior and portability of applications.
If you need to override the
afterSend(Representation) method for
example, just create a subclass and set it on your application with the
Application.setConnectorService(ConnectorService) method.Implementation note: the parent component will ensure that client connectors won't automatically follow redirections. This will ensure a consistent behavior and portability of applications.
- Author:
- Jerome Louvel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterSend(Representation entity) Call-back method invoked by the client or server connectors just after sending the response to the target component.voidbeforeSend(Representation entity) Call-back method invoked by the client or server connectors just before sending the response to the target component.Returns the modifiable list of required client protocols.Returns the modifiable list of required server protocols.voidsetClientProtocols(List<Protocol> clientProtocols) Sets the modifiable list of required client protocols.voidsetServerProtocols(List<Protocol> serverProtocols) Sets the modifiable list of required server protocols.Methods inherited from class org.restlet.service.Service
createInboundFilter, createOutboundFilter, getContext, isEnabled, isStarted, isStopped, setContext, setEnabled, start, stop
-
Constructor Details
-
ConnectorService
public ConnectorService()Constructor.
-
-
Method Details
-
afterSend
Call-back method invoked by the client or server connectors just after sending the response to the target component. The default implementation does nothing.- Parameters:
entity- The optional entity about to be committed.
-
beforeSend
Call-back method invoked by the client or server connectors just before sending the response to the target component. The default implementation does nothing.- Parameters:
entity- The optional entity about to be committed.
-
getClientProtocols
Returns the modifiable list of required client protocols. You need to update this list if you need the parent component to provide additional client connectors.- Returns:
- The list of required client protocols.
-
getServerProtocols
Returns the modifiable list of required server protocols. An empty list means that all protocols are potentially supported (default case). You should update this list to restrict the actual protocols supported by your application.- Returns:
- The list of required server protocols.
-
setClientProtocols
Sets the modifiable list of required client protocols. This method clears the current list and adds all entries in the parameter list.- Parameters:
clientProtocols- A list of required client protocols.
-
setServerProtocols
Sets the modifiable list of required server protocols. This method clears the current list and adds all entries in the parameter list.- Parameters:
serverProtocols- A list of required server protocols.
-