org.mule.tck.testmodels.mule
Class TestConnector.DummyMessageAdapter

java.lang.Object
  extended byorg.mule.providers.AbstractMessageAdapter
      extended byorg.mule.tck.testmodels.mule.TestConnector.DummyMessageAdapter
All Implemented Interfaces:
Serializable, ThreadSafeAccess, UMOMessageAdapter, UMOStreamMessageAdapter
Enclosing class:
TestConnector

public class TestConnector.DummyMessageAdapter
extends AbstractMessageAdapter
implements UMOStreamMessageAdapter

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mule.providers.AbstractMessageAdapter
attachments, DEFAULT_FAILFAST, encoding, exceptionPayload, id, logger, properties, READ, WRITE
 
Constructor Summary
TestConnector.DummyMessageAdapter(Object message)
           
 
Method Summary
 InputStream getInputStream()
          Gets the input Stream associated with this event
 OutputHandler getOutputHandler()
          The Output handler is a callback that will handle the writing to an output Stream when the Stream is available
 OutputStream getOutputStream()
          Gets the output Stream associated with this event
 Object getPayload()
           
 byte[] getPayloadAsBytes()
          Converts the message implementation into a byte array representation
 String getPayloadAsString(String encoding)
          Converts the message implementation into a String representation
 ThreadSafeAccess newThreadCopy()
          By default we return "this".
 void release()
          The release method is called by Mule to notify this adapter that it is no longer needed.
 void setOutputHandler(OutputHandler handler)
          The Output handler is a callback that will handle the writing to an output Stream when the Stream is available
 void write(UMOEvent event)
          Writes the event to the current outputStream using the OutputHandler set on the StreamAdapter.
 
Methods inherited from class org.mule.providers.AbstractMessageAdapter
addAttachment, addProperties, assertAccess, clearProperties, convertToBytes, getAttachment, getAttachmentNames, getBooleanProperty, getCorrelationGroupSize, getCorrelationId, getCorrelationSequence, getDoubleProperty, getEncoding, getExceptionPayload, getIntProperty, getLongProperty, getPayloadAsString, getProperty, getProperty, getPropertyNames, getReplyTo, getStringProperty, getUniqueId, isDisabled, newException, removeAttachment, removeProperty, resetAccessControl, setBooleanProperty, setCorrelationGroupSize, setCorrelationId, setCorrelationSequence, setDoubleProperty, setEncoding, setExceptionPayload, setIntProperty, setLongProperty, setProperty, setReplyTo, setStringProperty, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mule.umo.provider.UMOMessageAdapter
addAttachment, addProperties, clearProperties, getAttachment, getAttachmentNames, getBooleanProperty, getCorrelationGroupSize, getCorrelationId, getCorrelationSequence, getDoubleProperty, getEncoding, getExceptionPayload, getIntProperty, getLongProperty, getPayloadAsString, getProperty, getProperty, getPropertyNames, getReplyTo, getStringProperty, getUniqueId, removeAttachment, removeProperty, setBooleanProperty, setCorrelationGroupSize, setCorrelationId, setCorrelationSequence, setDoubleProperty, setEncoding, setExceptionPayload, setIntProperty, setLongProperty, setProperty, setReplyTo, setStringProperty
 

Constructor Detail

TestConnector.DummyMessageAdapter

public TestConnector.DummyMessageAdapter(Object message)
Method Detail

getPayload

public Object getPayload()
Specified by:
getPayload in interface UMOMessageAdapter
Returns:
the current message

getPayloadAsBytes

public byte[] getPayloadAsBytes()
                         throws Exception
Description copied from interface: UMOMessageAdapter
Converts the message implementation into a byte array representation

Specified by:
getPayloadAsBytes in interface UMOMessageAdapter
Returns:
byte array of the message
Throws:
Exception - Implemetation may throw an endpoint specific exception

getPayloadAsString

public String getPayloadAsString(String encoding)
                          throws Exception
Description copied from interface: UMOMessageAdapter
Converts the message implementation into a String representation

Specified by:
getPayloadAsString in interface UMOMessageAdapter
Parameters:
encoding - The encoding to use when transforming the message (if necessary). The parameter is used when converting from a byte array
Returns:
String representation of the message payload
Throws:
Exception - Implementation may throw an endpoint specific exception

getInputStream

public InputStream getInputStream()
Description copied from interface: UMOStreamMessageAdapter
Gets the input Stream associated with this event

Specified by:
getInputStream in interface UMOStreamMessageAdapter
Returns:
the input Stream associated with this event

getOutputStream

public OutputStream getOutputStream()
Description copied from interface: UMOStreamMessageAdapter
Gets the output Stream associated with this event

Specified by:
getOutputStream in interface UMOStreamMessageAdapter
Returns:
the output Stream associated with this event

write

public void write(UMOEvent event)
           throws IOException
Description copied from interface: UMOStreamMessageAdapter
Writes the event to the current outputStream using the OutputHandler set on the StreamAdapter.

Specified by:
write in interface UMOStreamMessageAdapter
Parameters:
event - the event to write to the stream
Throws:
IOException

getOutputHandler

public OutputHandler getOutputHandler()
Description copied from interface: UMOStreamMessageAdapter
The Output handler is a callback that will handle the writing to an output Stream when the Stream is available

Specified by:
getOutputHandler in interface UMOStreamMessageAdapter
Returns:
the handler used to write to the stream

setOutputHandler

public void setOutputHandler(OutputHandler handler)
Description copied from interface: UMOStreamMessageAdapter
The Output handler is a callback that will handle the writing to an output Stream when the Stream is available

Specified by:
setOutputHandler in interface UMOStreamMessageAdapter
Parameters:
handler - the handler used to write to the stream

release

public void release()
Description copied from interface: UMOStreamMessageAdapter
The release method is called by Mule to notify this adapter that it is no longer needed. This method can be used to release any resources that a custom StreamAdapter may have associated with it.

Specified by:
release in interface UMOStreamMessageAdapter

newThreadCopy

public ThreadSafeAccess newThreadCopy()
Description copied from class: AbstractMessageAdapter
By default we return "this". This allows older code to inter-operate but doesn't, of course, give the required safety. Subclasses should override this method. Re-writing the threading handling should remove this requirement....

Specified by:
newThreadCopy in interface ThreadSafeAccess
Overrides:
newThreadCopy in class AbstractMessageAdapter
Returns:
A new copy of this


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.