Package org.jgroups
Interface StateListener
-
- All Known Subinterfaces:
MessageListener,Receiver
- All Known Implementing Classes:
Chat,Draw,MyReceiver,QuoteServer,ReceiverAdapter,RELAY.Receiver,RelayDemo,RelayDemoRpc,Relayer.Bridge,ReplicatedHashMap,ReplicatedTree,ViewDemo
public interface StateListenerInterface to provide state (state provider) and set state (state requester)- Since:
- 4.0
- Author:
- Bela Ban, Vladimir Blagojevic
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidgetState(java.io.OutputStream output)Allows an application to write a state through a provided OutputStream.default voidsetState(java.io.InputStream input)Allows an application to read a state through a provided InputStream.
-
-
-
Method Detail
-
getState
default void getState(java.io.OutputStream output) throws java.lang.ExceptionAllows an application to write a state through a provided OutputStream. After the state has been written the OutputStream doesn't need to be closed as stream closing is automatically done when a calling thread returns from this callback.- Parameters:
output- the OutputStream- Throws:
java.lang.Exception- if the streaming fails, any exceptions should be thrown so that the state requester can re-throw them and let the caller know what happened- See Also:
OutputStream.close()
-
setState
default void setState(java.io.InputStream input) throws java.lang.ExceptionAllows an application to read a state through a provided InputStream. After the state has been read the InputStream doesn't need to be closed as stream closing is automatically done when a calling thread returns from this callback.- Parameters:
input- the InputStream- Throws:
java.lang.Exception- if the streaming fails, any exceptions should be thrown so that the state requester can catch them and thus know what happened- See Also:
InputStream.close()
-
-