Package com.adaptris.core.services
Class ChangeCharEncodingService
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.services.ChangeCharEncodingService
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
,Service
,StateManagedComponent
@ComponentProfile(summary="Change the character encoding of a message", tag="service,encoding") public class ChangeCharEncodingService extends ServiceImp
Changes the character encoding associated with a message.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.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.ServiceImp
log
-
-
Constructor Summary
Constructors Constructor Description ChangeCharEncodingService()
ChangeCharEncodingService(java.lang.String cs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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-
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
-
doService
public void doService(AdaptrisMessage msg) throws ServiceException
Description copied from interface:Service
Apply the service to the message.
- Parameters:
msg
- theAdaptrisMessage
to process- Throws:
ServiceException
- wrapping any underlyingException
s- See Also:
#doService(com.adaptris.core.AdaptrisMessage)
-
initService
protected void initService() throws CoreException
- Specified by:
initService
in classServiceImp
- Throws:
CoreException
-
closeService
protected void closeService()
- Specified by:
closeService
in classServiceImp
-
getCharEncoding
public java.lang.String getCharEncoding()
-
setCharEncoding
public void setCharEncoding(java.lang.String s)
Set the character encoding- Parameters:
s
- the character encoding
-
prepare
public void prepare() throws CoreException
Description copied from interface:ComponentLifecycleExtension
Prepare for initialisation.- Throws:
CoreException
-
-