public abstract class JGroupsBroadcastEndpoint extends Object implements BroadcastEndpoint
Constructor and Description |
---|
JGroupsBroadcastEndpoint(JChannelManager manager,
String channelName) |
Modifier and Type | Method and Description |
---|---|
void |
broadcast(byte[] data)
Broadcasting data to the cluster.
|
void |
close(boolean isBroadcast)
Close the endpoint.
|
abstract org.jgroups.JChannel |
createChannel() |
JGroupsBroadcastEndpoint |
initChannel() |
protected void |
internalCloseChannel(JChannelWrapper channel)
Closes the channel used in this JGroups Broadcast.
|
protected void |
internalOpen() |
void |
openBroadcaster()
This method initializes a BroadcastEndpint as
a broadcaster.
|
void |
openClient()
This method initializes a BroadcastEndpoint as
a receiving end for broadcasts.
|
byte[] |
receiveBroadcast()
Receives the broadcast data.
|
byte[] |
receiveBroadcast(long time,
TimeUnit unit)
Receives the broadcast data with a timeout.
|
public JGroupsBroadcastEndpoint(JChannelManager manager, String channelName)
public void broadcast(byte[] data) throws Exception
BroadcastEndpoint
broadcast
in interface BroadcastEndpoint
data
- : a byte array containing the data.Exception
public byte[] receiveBroadcast() throws Exception
BroadcastEndpoint
receiveBroadcast
in interface BroadcastEndpoint
Exception
public byte[] receiveBroadcast(long time, TimeUnit unit) throws Exception
BroadcastEndpoint
receiveBroadcast
in interface BroadcastEndpoint
time
- : how long the method should wait for the data to arrive.unit
- : unit of the time.Exception
public void openClient() throws Exception
BroadcastEndpoint
openClient
in interface BroadcastEndpoint
Exception
public void openBroadcaster() throws Exception
BroadcastEndpoint
openBroadcaster
in interface BroadcastEndpoint
Exception
public abstract org.jgroups.JChannel createChannel() throws Exception
Exception
public JGroupsBroadcastEndpoint initChannel() throws Exception
Exception
public void close(boolean isBroadcast) throws Exception
BroadcastEndpoint
close
in interface BroadcastEndpoint
isBroadcast
- : indicates whether this endpoint serves as a broadcast or not.Exception
protected void internalCloseChannel(JChannelWrapper channel)
channel
- Copyright © 2018 JBoss by Red Hat. All rights reserved.