Class JettyRoutingService
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,ConfigComment
,MessageEventGenerator
,Service
,StateManagedComponent
BranchingServiceCollection
to branch based on the jetty URI and method.
Takes the metadata values associated with CoreConstants.HTTP_METHOD
and JettyConstants.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.
-
Field Summary
Fields inherited from class com.adaptris.core.ServiceImp
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
doService
(AdaptrisMessage msg) Apply the service to the message.protected void
void
prepare()
Prepare for initialisation.void
Set the default service id if there are no matches.void
void
start()
Starts the component.void
stop()
Stop the componentMethods inherited from class com.adaptris.core.BranchingServiceImp
isBranching
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getComments, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setComments, setContinueOnFail, setIsTrackingEndpoint, setUniqueId
-
Constructor Details
-
JettyRoutingService
public JettyRoutingService() -
JettyRoutingService
-
-
Method Details
-
doService
Description copied from interface:Service
Apply the service to the message.
- Parameters:
msg
- theAdaptrisMessage
to process- Throws:
ServiceException
- wrapping any underlyingException
s
-
prepare
Description copied from interface:ComponentLifecycleExtension
Prepare for initialisation.- Throws:
CoreException
-
initService
- Specified by:
initService
in classServiceImp
- Throws:
CoreException
-
start
Description copied from interface:ComponentLifecycle
Starts the component.Once a component is started it should be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling start will begin message delivery.- Specified by:
start
in interfaceComponentLifecycle
- Overrides:
start
in classServiceImp
- Throws:
CoreException
- wrapping any underlyingException
s
-
stop
public void stop()Description copied from interface:ComponentLifecycle
Stop the componentA stopped component is not expected to be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling stop will pause message delivery. Throwing aRuntimeException
may cause unintended consequences- Specified by:
stop
in interfaceComponentLifecycle
- Overrides:
stop
in classServiceImp
-
closeService
protected void closeService()- Specified by:
closeService
in classServiceImp
-
getRoutes
-
setRoutes
-
getDefaultServiceId
-
setDefaultServiceId
Set the default service id if there are no matches.- Parameters:
id
-
-