@ComponentProfile(summary="Change the character encoding of a message", tag="service,encoding") public class ChangeCharEncodingService extends ServiceImp
this service does nothing with the data, but simply changes the character encoding associated with the message using
InterlokMessage.setContentEncoding(String)
. If this service is used, and there is no configured
character encoding then the
character encoding associated with the message is set to null (which forces the platform default encoding).
In the adapter configuration file this class is aliased as change-char-encoding-service which is the preferred alternative to the fully qualified classname when building your configuration.
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
ChangeCharEncodingService() |
ChangeCharEncodingService(java.lang.String cs) |
Modifier and Type | Method and Description |
---|---|
protected void |
closeService() |
void |
doService(AdaptrisMessage msg)
Apply the service to the message.
|
java.lang.String |
getCharEncoding() |
protected void |
initService() |
void |
prepare()
Prepare for initialisation.
|
void |
setCharEncoding(java.lang.String s)
Set the character encoding
|
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setLookupName, setUniqueId, start, stop
public ChangeCharEncodingService()
public ChangeCharEncodingService(java.lang.String cs)
public void doService(AdaptrisMessage msg) throws ServiceException
Service
Apply the service to the message.
msg
- the AdaptrisMessage
to processServiceException
- wrapping any underlying Exception
s#doService(com.adaptris.core.AdaptrisMessage)
protected void initService() throws CoreException
initService
in class ServiceImp
CoreException
protected void closeService()
closeService
in class ServiceImp
public java.lang.String getCharEncoding()
public void setCharEncoding(java.lang.String s)
s
- the character encodingpublic void prepare() throws CoreException
ComponentLifecycleExtension
CoreException