org.jboss.soa.esb.actions.converters
Class BOMFilter

java.lang.Object
  extended by org.jboss.soa.esb.actions.AbstractActionLifecycle
      extended by org.jboss.soa.esb.actions.AbstractActionPipelineProcessor
          extended by org.jboss.soa.esb.actions.converters.BOMFilter
All Implemented Interfaces:
ActionLifecycle, ActionPipelineProcessor

public class BOMFilter
extends AbstractActionPipelineProcessor

Byte Order Mark (BOM) Filtering Action.

Only works on byte arrays and InputStreams.

Author:
tom.fennelly@gmail.com

Field Summary
 
Fields inherited from interface org.jboss.soa.esb.actions.ActionPipelineProcessor
PROCESS_EXCEPTION_METHOD, PROCESS_METHOD, PROCESS_SUCCESS_METHOD
 
Constructor Summary
BOMFilter(ConfigTree config)
          Public constructor.
 
Method Summary
protected static byte[] getBOM(java.lang.String bomEncoding)
           
protected static boolean hasBOM(byte[] dataBuffer, byte[] bom)
           
 Message process(Message message)
          Perform the action processing on the specified message.
 
Methods inherited from class org.jboss.soa.esb.actions.AbstractActionPipelineProcessor
processException, processSuccess
 
Methods inherited from class org.jboss.soa.esb.actions.AbstractActionLifecycle
destroy, initialise
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.soa.esb.actions.ActionLifecycle
destroy, initialise
 

Constructor Detail

BOMFilter

public BOMFilter(ConfigTree config)
Public constructor.

Parameters:
config - Config.
Method Detail

process

public Message process(Message message)
                throws ActionProcessingException
Description copied from interface: ActionPipelineProcessor
Perform the action processing on the specified message. This method is invoked for each message passing throught the pipeline.

Parameters:
message - The current message being processed.
Returns:
The message to be passed to the next stage of the pipeline.
Throws:
ActionProcessingException - for errors during processing.

getBOM

protected static byte[] getBOM(java.lang.String bomEncoding)

hasBOM

protected static boolean hasBOM(byte[] dataBuffer,
                                byte[] bom)