public interface SpreadWrapper extends Activatable
Modifier and Type | Interface and Description |
---|---|
static class |
SpreadWrapper.State
Describes the current state of the underlying connection.
|
Modifier and Type | Method and Description |
---|---|
String |
getPrivateGroup()
Returns the name of the private spread group for the wrapped connection.
|
InetAddress |
getSpreadhost() |
SpreadWrapper.State |
getStatus()
Indicates the current state of the underlying connection.
|
URI |
getTransportUri()
Returns the transport URI for this spread connection.
|
boolean |
isConnected()
Indicate whether this wrapper is currently successfully connected to a
spread daemon.
|
boolean |
isShutdown()
Indicate whether a shutdown was requested.
|
boolean |
isUseTcpNoDelay() |
void |
join(String group)
If connected, joins the specified group.
|
void |
leave(String group)
If connected and joined, leaves the specified group.
|
spread.SpreadMessage |
receive()
Receive the next message from the spread connection in groups this
wrapper has joined.
|
void |
send(DataMessage msg)
Sends the given message.
|
activate, deactivate, isActive
SpreadWrapper.State getStatus()
InetAddress getSpreadhost()
boolean isUseTcpNoDelay()
void join(String group) throws spread.SpreadException
group
- group to joinspread.SpreadException
- error joiningvoid send(DataMessage msg)
msg
- the message to sendSendException
- error sending the messagevoid leave(String group)
group
- the group to leaveString getPrivateGroup()
null
if not connected so far.boolean isConnected()
true
if connected, else false
spread.SpreadMessage receive() throws InterruptedIOException, spread.SpreadException
InterruptedIOException
- interrupted while waiting for the messagespread.SpreadException
- error while reading the next messageboolean isShutdown()
true
if requested.URI getTransportUri()
Copyright © 2018 CoR-Lab. All rights reserved.