Class CommandDispatcherBroadcastEndpoint
java.lang.Object
org.wildfly.extension.messaging.activemq.broadcast.CommandDispatcherBroadcastEndpoint
- All Implemented Interfaces:
BroadcastEndpoint
A
BroadcastEndpoint based on a CommandDispatcher.- Author:
- Paul Ferraro
-
Constructor Summary
ConstructorsConstructorDescriptionCommandDispatcherBroadcastEndpoint(CommandDispatcherFactory<GroupMember> factory, String name, BroadcastReceiverRegistrar registrar, Function<String, BroadcastManager> managerFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidbroadcast(byte[] data) Broadcasting data to the cluster.voidclose(boolean isBroadcast) Close the endpoint.voidThis method initializes a BroadcastEndpint as a broadcaster.voidThis method initializes a BroadcastEndpoint as a receiving end for broadcasts.byte[]Receives the broadcast data.byte[]receiveBroadcast(long time, TimeUnit unit) Receives the broadcast data with a timeout.
-
Constructor Details
-
CommandDispatcherBroadcastEndpoint
public CommandDispatcherBroadcastEndpoint(CommandDispatcherFactory<GroupMember> factory, String name, BroadcastReceiverRegistrar registrar, Function<String, BroadcastManager> managerFactory)
-
-
Method Details
-
openClient
Description copied from interface:BroadcastEndpointThis method initializes a BroadcastEndpoint as a receiving end for broadcasts. After that data can be received using one of its receiveBroadcast() methods.- Specified by:
openClientin interfaceBroadcastEndpoint- Throws:
Exception
-
openBroadcaster
Description copied from interface:BroadcastEndpointThis method initializes a BroadcastEndpint as a broadcaster. After that data can be sent via its broadcast() method.- Specified by:
openBroadcasterin interfaceBroadcastEndpoint- Throws:
Exception
-
close
Description copied from interface:BroadcastEndpointClose the endpoint. Any related resources should be cleaned up in this method.- Specified by:
closein interfaceBroadcastEndpoint- Parameters:
isBroadcast- : indicates whether this endpoint serves as a broadcast or not.- Throws:
Exception
-
broadcast
Description copied from interface:BroadcastEndpointBroadcasting data to the cluster.- Specified by:
broadcastin interfaceBroadcastEndpoint- Parameters:
data- : a byte array containing the data.- Throws:
Exception
-
receiveBroadcast
Description copied from interface:BroadcastEndpointReceives the broadcast data. It blocks until data is available.- Specified by:
receiveBroadcastin interfaceBroadcastEndpoint- Returns:
- the received data as byte array
- Throws:
Exception
-
receiveBroadcast
Description copied from interface:BroadcastEndpointReceives the broadcast data with a timeout. It blocks until either the data is available or the timeout is reached, whichever comes first.- Specified by:
receiveBroadcastin interfaceBroadcastEndpoint- Parameters:
time- : how long the method should wait for the data to arrive.unit- : unit of the time.- Returns:
- a byte array if data is arrived within the timeout, or null if no data is available after the timeout.
- Throws:
Exception
-