KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgroups > ExtendedMessageListener


1 package org.jgroups;
2
3 import java.io.InputStream JavaDoc;
4 import java.io.OutputStream JavaDoc;
5
6 /**
7  *
8  * <code>ExtendedMessageListener</code> has additional callbacks for:
9  * <ul>
10  * <li>partial state transfer - http://jira.jboss.com/jira/browse/JGRP-118
11  * <li>streaming state transfer - http://jira.jboss.com/jira/browse/JGRP-89
12  * </ul>
13  * <p>
14  * Application channels interested in using streaming state transfer, beside
15  * implementing this interface, have to be configured with
16  * <code>STREAMING_STATE_TRANSFER</code> protocol rather than the default
17  * <code>STATE_TRANSFER</code> protocol.
18  *
19  * <p>
20  * Note:
21  * <p>
22  * This interface will be merged with MessageListener in 3.0 (API changes)
23  *
24  * @author Bela Ban
25  * @author Vladimir Blagojevic
26  * @see org.jgroups.JChannel#getState(Address, long)
27  * @see org.jgroups.JChannel#getState(Address, String, long)
28  * @since 2.3
29  *
30  * @version $Id: ExtendedMessageListener.java,v 1.4 2006/07/28 07:14:33 belaban Exp $
31  */

32 public interface ExtendedMessageListener extends MessageListener {
33
34     /**
35      * Allows an application to provide a partial state as a byte array
36      *
37      * @param state_id id of the partial state requested
38      * @return partial state for the given state_id
39      */

40     public byte[] getState(String JavaDoc state_id);
41
42     /**
43      * Allows an application to read a partial state indicated by state_id from
44      * a given state byte array parameter.
45      *
46      * @param state_id id of the partial state requested
47      * @param state partial state for the given state_id
48      */

49     public void setState(String JavaDoc state_id, byte[] state);
50
51     /**
52      * Allows an application to write a state through a provided OutputStream.
53      * An application is obligated to always close the given OutputStream reference.
54      *
55      * @param ostream the OutputStream
56      * @see OutputStream#close()
57      */

58     public void getState(OutputStream JavaDoc ostream);
59
60     /**
61      * Allows an application to write a partial state through a provided OutputStream.
62      * An application is obligated to always close the given OutputStream reference.
63      *
64      * @param state_id id of the partial state requested
65      * @param ostream the OutputStream
66      *
67      * @see OutputStream#close()
68      */

69     public void getState(String JavaDoc state_id, OutputStream JavaDoc ostream);
70
71
72     /**
73      * Allows an application to read a state through a provided InputStream.
74      * An application is obligated to always close the given InputStream reference.
75      *
76      * @param istream the InputStream
77      * @see InputStream#close()
78      */

79     public void setState(InputStream JavaDoc istream);
80
81     /**
82      * Allows an application to read a partial state through a provided InputStream.
83      * An application is obligated to always close the given InputStream reference.
84      *
85      * @param state_id id of the partial state requested
86      * @param istream the InputStream
87      *
88      * @see InputStream#close()
89      */

90     public void setState(String JavaDoc state_id, InputStream JavaDoc istream);
91 }
92
Popular Tags