org.mule.tck.functional
Class FunctionalStreamingTestComponent

java.lang.Object
  extended by org.mule.tck.functional.FunctionalStreamingTestComponent
All Implemented Interfaces:
Callable, EventListener

public class FunctionalStreamingTestComponent
extends Object
implements Callable

A service that can be used by streaming functional tests. This service accepts an EventCallback that can be used to assert the state of the current event. To access the service when embedded in an (XML) model, make sure that the descriptor sets the singleton attribute true - see uses in TCP and FTP. Note that although this implements the full StreamingService interface, nothing is written to the output stream - this is intended as a final sink.

See Also:
EventCallback

Field Summary
protected  Log logger
           
static int STREAM_BUFFER_SIZE
           
static int STREAM_SAMPLE_SIZE
           
 
Constructor Summary
FunctionalStreamingTestComponent()
           
 
Method Summary
 int getNumber()
           
 String getSummary()
           
 Object onCall(MuleEventContext context)
          Passes the event to the listener
protected  int read(InputStream in, byte[] buffer)
           
 void setEventCallback(EventCallback eventCallback, long targetSize)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected transient Log logger

STREAM_SAMPLE_SIZE

public static final int STREAM_SAMPLE_SIZE
See Also:
Constant Field Values

STREAM_BUFFER_SIZE

public static final int STREAM_BUFFER_SIZE
See Also:
Constant Field Values
Constructor Detail

FunctionalStreamingTestComponent

public FunctionalStreamingTestComponent()
Method Detail

setEventCallback

public void setEventCallback(EventCallback eventCallback,
                             long targetSize)

getSummary

public String getSummary()

getNumber

public int getNumber()

onCall

public Object onCall(MuleEventContext context)
              throws Exception
Description copied from interface: Callable
Passes the event to the listener

Specified by:
onCall in interface Callable
Parameters:
context - the context of the current event being process
Returns:
Object this object can be anything. When the LifecycleAdapter for the service receives this object it will first see if the Object is an MuleMessage if not and the Object is not null a new message will be created using the returned object as the payload. This new event will then get published via the configured outbound router if-
  1. One has been configured for the component.
  2. the setStopFurtherProcessing(true) wasn't called on the event context event.
Throws:
Exception - if the event fails to process properly. If exceptions aren't handled by the implementation they will be handled by the exceptionListener associated with the service

read

protected int read(InputStream in,
                   byte[] buffer)
            throws IOException
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


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