Package org.jgroups

Interface StateListener

    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default void getState​(java.io.OutputStream output)
      Allows an application to write a state through a provided OutputStream.
      default void setState​(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.Exception
        Allows 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.Exception
        Allows 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()