01: /*
02: * $Id: OutputHandler.java 10489 2008-01-23 17:53:38Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10:
11: package org.mule.api.transport;
12:
13: import org.mule.api.MuleEvent;
14:
15: import java.io.IOException;
16: import java.io.OutputStream;
17:
18: /**
19: * The OutputHandler is a strategy class that is set on the StreamMessageAdapter to
20: * defer the writing of the message payload until there is a stream available to
21: * write it to.
22: *
23: * @see org.mule.transport.streaming.StreamMessageAdapter
24: */
25: public interface OutputHandler {
26:
27: /**
28: * Write the event payload to the stream. Depending on the underlying transport,
29: * attachements and message properties may be written to the stream here too.
30: *
31: * @param event the current event
32: * @param out the output stream to write to
33: * @throws IOException
34: */
35: void write(MuleEvent event, OutputStream out) throws IOException;
36:
37: }
|