@ComponentProfile(summary="Specify the next branch based on the jettyURI and method", tag="service,jetty,branching", branchSelector=true) public class JettyRoutingService extends BranchingServiceImp
BranchingServiceCollection
to branch based on the jetty URI and method.
Takes the metadata values associated with CoreConstants.HTTP_METHOD
and CoreConstants.JETTY_URI
and matches them
against a list of configured routes. If a route matches the URI and the http method (if specified) then the next service id is
set appropriately.
In the adapter configuration file this class is aliased as jetty-routing-service which is the preferred alternative to the fully qualified classname when building your configuration.
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
JettyRoutingService() |
JettyRoutingService(java.lang.String defaultServiceId,
java.util.List<JettyRouteSpec> specs) |
Modifier and Type | Method and Description |
---|---|
protected void |
closeService() |
void |
doService(AdaptrisMessage msg)
Apply the service to the message.
|
java.lang.String |
getDefaultServiceId() |
java.util.List<JettyRouteSpec> |
getRoutes() |
protected void |
initService() |
void |
prepare()
Prepare for initialisation.
|
void |
setDefaultServiceId(java.lang.String id)
Set the default service id if there are no matches.
|
void |
setRoutes(java.util.List<JettyRouteSpec> r) |
isBranching
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsConfirmation, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isConfirmation, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, rethrowServiceException, retrieveComponentState, setContinueOnFail, setIsConfirmation, setIsTrackingEndpoint, setLookupName, setUniqueId, start, stop
public JettyRoutingService()
public JettyRoutingService(java.lang.String defaultServiceId, java.util.List<JettyRouteSpec> specs)
public void doService(AdaptrisMessage msg) throws ServiceException
Service
Apply the service to the message.
msg
- the AdaptrisMessage
to processServiceException
- wrapping any underlying Exception
spublic void prepare() throws CoreException
ComponentLifecycleExtension
CoreException
protected void initService() throws CoreException
initService
in class ServiceImp
CoreException
protected void closeService()
closeService
in class ServiceImp
public java.util.List<JettyRouteSpec> getRoutes()
public void setRoutes(java.util.List<JettyRouteSpec> r)
public java.lang.String getDefaultServiceId()
public void setDefaultServiceId(java.lang.String id)
id
-