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
BroadcastEndpointbroadcast in interface BroadcastEndpointdata - : a byte array containing the data.Exceptionpublic byte[] receiveBroadcast()
throws Exception
BroadcastEndpointreceiveBroadcast in interface BroadcastEndpointExceptionpublic byte[] receiveBroadcast(long time,
TimeUnit unit)
throws Exception
BroadcastEndpointreceiveBroadcast in interface BroadcastEndpointtime - : how long the method should wait for the data to arrive.unit - : unit of the time.Exceptionpublic void openClient()
throws Exception
BroadcastEndpointopenClient in interface BroadcastEndpointExceptionpublic void openBroadcaster()
throws Exception
BroadcastEndpointopenBroadcaster in interface BroadcastEndpointExceptionpublic abstract org.jgroups.JChannel createChannel()
throws Exception
Exceptionpublic JGroupsBroadcastEndpoint initChannel() throws Exception
Exceptionpublic void close(boolean isBroadcast)
throws Exception
BroadcastEndpointclose in interface BroadcastEndpointisBroadcast - : indicates whether this endpoint serves as a broadcast or not.Exceptionprotected void internalCloseChannel(JChannelWrapper channel)
channel - Copyright © 2018 The Apache Software Foundation. All rights reserved.