KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > umo > provider > UMOStreamMessageAdapter


1 /*
2  * $Id: UMOStreamMessageAdapter.java 3798 2006-11-04 04:07:14Z aperepel $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.umo.provider;
12
13 import org.mule.umo.UMOEvent;
14
15 import java.io.IOException JavaDoc;
16 import java.io.InputStream JavaDoc;
17 import java.io.OutputStream JavaDoc;
18
19 /**
20  * A stream message adapter rovides a generic base class for stream based message
21  * flows in Mule. This adapter represents the 3 flows of data that Mule identifies,
22  * namely inbound, outbound and response flows. These are represented by three
23  * streams on the adapter.
24  */

25
26 public interface UMOStreamMessageAdapter extends UMOMessageAdapter
27 {
28     /**
29      * Gets the input Stream associated with this event
30      *
31      * @return the input Stream associated with this event
32      */

33     public InputStream JavaDoc getInputStream();
34
35     /**
36      * Gets the output Stream associated with this event
37      *
38      * @return the output Stream associated with this event
39      */

40     public OutputStream JavaDoc getOutputStream();
41
42     /**
43      * Writes the event to the current outputStream using the OutputHandler set on
44      * the StreamAdapter.
45      *
46      * @param event the event to write to the stream
47      * @throws IOException
48      */

49     public void write(UMOEvent event) throws IOException JavaDoc;
50
51     /**
52      * The Output handler is a callback that will handle the writing to an output
53      * Stream when the Stream is available
54      *
55      * @return the handler used to write to the stream
56      */

57     public OutputHandler getOutputHandler();
58
59     /**
60      * The Output handler is a callback that will handle the writing to an output
61      * Stream when the Stream is available
62      *
63      * @param handler the handler used to write to the stream
64      */

65     public void setOutputHandler(OutputHandler handler);
66
67     /**
68      * The release method is called by Mule to notify this adapter that it is no
69      * longer needed. This method can be used to release any resources that a custom
70      * StreamAdapter may have associated with it.
71      */

72     public void release();
73 }
74
Popular Tags