Package com.adaptris.core
Class SwitchPayloadService
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.SwitchPayloadService
-
- All Implemented Interfaces:
AdaptrisComponent,ComponentLifecycle,ComponentLifecycleExtension,MessageEventGenerator,Service,StateManagedComponent
@ComponentProfile(summary="Switch the active payload of a multi-payload message", tag="multi-payload,multi,payload,switch") public class SwitchPayloadService extends ServiceImpSwitch the message payload from one payload to another.<switch-payload-service> <unique-id>switch-payload-unique-id</unique-id> <new-payload-id>payload-1</new-payload-id> </switch-payload-service>- Since:
- 3.9.x
-
-
Constructor Summary
Constructors Constructor Description SwitchPayloadService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcloseService().voiddoService(AdaptrisMessage msg)Switch the message payload from one to another.java.lang.StringgetNewPayloadId()Get the ID of the payload to switch to.protected voidinitService().voidprepare()Prepare for initialisation.voidsetNewPayloadId(java.lang.String newPayloadId)Set the ID of the payload to switch to.-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
-
-
-
-
Method Detail
-
setNewPayloadId
public void setNewPayloadId(java.lang.String newPayloadId)
Set the ID of the payload to switch to.- Parameters:
newPayloadId- The new payload ID.
-
getNewPayloadId
public java.lang.String getNewPayloadId()
Get the ID of the payload to switch to.- Returns:
- The new payload ID.
-
doService
public void doService(AdaptrisMessage msg) throws ServiceException
Switch the message payload from one to another.Apply the service to the message.
.- Parameters:
msg- The message whose payload to switch.- Throws:
ServiceException- wrapping any underlyingExceptions
-
initService
protected void initService()
.- Specified by:
initServicein classServiceImp
-
closeService
protected void closeService()
.- Specified by:
closeServicein classServiceImp
-
prepare
public void prepare()
Prepare for initialisation..
-
-