public class JGroupsTransport extends AbstractTransport implements org.jgroups.MembershipListener
JGroupsChannelLookup instanceTransportConfigurationBuilder.withProperties(java.util.Properties) or
in the Infinispan XML configuration file.| Modifier and Type | Field and Description |
|---|---|
protected Address |
address |
protected org.jgroups.Channel |
channel |
static String |
CHANNEL_LOOKUP |
protected boolean |
closeChannel |
static String |
CONFIGURATION_FILE |
static String |
CONFIGURATION_STRING |
static String |
CONFIGURATION_XML |
protected boolean |
connectChannel |
protected Address |
coordinator |
protected static String |
DEFAULT_JGROUPS_CONFIGURATION_FILE |
protected boolean |
disconnectChannel |
protected CommandAwareRpcDispatcher |
dispatcher |
protected GlobalComponentRegistry |
gcr |
protected InboundInvocationHandler |
globalHandler |
protected boolean |
isCoordinator |
protected StreamingMarshaller |
marshaller |
protected List<Address> |
members |
protected CacheManagerNotifier |
notifier |
protected Address |
physicalAddress |
protected TypedProperties |
props |
protected TimeService |
timeService |
protected int |
viewId |
protected Condition |
viewUpdateCondition |
protected Lock |
viewUpdateLock |
configuration| Constructor and Description |
|---|
JGroupsTransport() |
JGroupsTransport(org.jgroups.Channel channel)
This form is used when the transport is created by an external source and passed in to the
GlobalConfiguration.
|
| Modifier and Type | Method and Description |
|---|---|
BackupResponse |
backupRemotely(Collection<XSiteBackup> backups,
XSiteReplicateCommand rpcCommand) |
void |
block() |
protected Response |
checkRsp(org.jgroups.util.Rsp<Response> rsp,
Address sender,
boolean ignoreTimeout,
boolean ignoreLeavers) |
void |
checkTotalOrderSupported()
check if the transport has configured with total order deliver properties (has the sequencer in JGroups
protocol stack.
|
Address |
getAddress()
Retrieves the current cache instance's network address
|
org.jgroups.Channel |
getChannel() |
CommandAwareRpcDispatcher |
getCommandAwareRpcDispatcher() |
Address |
getCoordinator() |
Log |
getLog() |
List<Address> |
getMembers()
Returns a list of members in the current cluster view.
|
List<Address> |
getPhysicalAddresses()
Retrieves the current cache instance's physical network addresses.
|
protected ScheduledExecutorService |
getTimeoutExecutor() |
int |
getViewId() |
protected void |
initChannel() |
void |
initialize(StreamingMarshaller marshaller,
CacheManagerNotifier notifier,
GlobalComponentRegistry gcr,
TimeService timeService,
InboundInvocationHandler globalHandler,
ScheduledExecutorService timeoutExecutor)
Initializes the transport with global cache configuration and transport-specific properties.
|
protected void |
initRPCDispatcher() |
Map<Address,Response> |
invokeRemotely(Collection<Address> recipients,
ReplicableCommand rpcCommand,
ResponseMode mode,
long timeout,
ResponseFilter responseFilter,
DeliverOrder deliverOrder,
boolean anycast)
Invokes an RPC call on other caches in the cluster.
|
Map<Address,Response> |
invokeRemotely(Map<Address,ReplicableCommand> rpcCommands,
ResponseMode mode,
long timeout,
boolean usePriorityQueue,
ResponseFilter responseFilter,
boolean totalOrder,
boolean anycast) |
Map<Address,Response> |
invokeRemotely(Map<Address,ReplicableCommand> rpcCommands,
ResponseMode mode,
long timeout,
ResponseFilter responseFilter,
DeliverOrder deliverOrder,
boolean anycast) |
CompletableFuture<Map<Address,Response>> |
invokeRemotelyAsync(Collection<Address> recipients,
ReplicableCommand rpcCommand,
ResponseMode mode,
long timeout,
ResponseFilter responseFilter,
DeliverOrder deliverOrder,
boolean anycast) |
boolean |
isCoordinator() |
boolean |
isMulticastCapable()
Tests whether the transport supports true multicast
|
void |
start()
Invoked on component start
|
protected void |
startJGroupsChannelIfNeeded() |
void |
stop()
Invoked on component stop
|
void |
suspect(org.jgroups.Address suspected_mbr) |
protected static org.jgroups.Address |
toJGroupsAddress(Address a) |
void |
unblock() |
void |
viewAccepted(org.jgroups.View newView) |
void |
waitForView(int viewId) |
boolean |
waitForView(int viewId,
long timeout,
TimeUnit timeUnit) |
checkResponse, setConfigurationpublic static final String CONFIGURATION_STRING
public static final String CONFIGURATION_XML
public static final String CONFIGURATION_FILE
public static final String CHANNEL_LOOKUP
protected static final String DEFAULT_JGROUPS_CONFIGURATION_FILE
protected boolean connectChannel
protected boolean disconnectChannel
protected boolean closeChannel
protected CommandAwareRpcDispatcher dispatcher
protected TypedProperties props
protected StreamingMarshaller marshaller
protected CacheManagerNotifier notifier
protected GlobalComponentRegistry gcr
protected TimeService timeService
protected InboundInvocationHandler globalHandler
protected org.jgroups.Channel channel
protected Address address
protected Address physicalAddress
protected volatile int viewId
protected volatile Address coordinator
protected volatile boolean isCoordinator
protected Lock viewUpdateLock
protected Condition viewUpdateCondition
public JGroupsTransport(org.jgroups.Channel channel)
channel - created and running channel to usepublic JGroupsTransport()
protected ScheduledExecutorService getTimeoutExecutor()
public void initialize(StreamingMarshaller marshaller, CacheManagerNotifier notifier, GlobalComponentRegistry gcr, TimeService timeService, InboundInvocationHandler globalHandler, ScheduledExecutorService timeoutExecutor)
marshaller - marshaller to use for marshalling and unmarshallingnotifier - notifier to usegcr - the global component registrypublic void start()
Lifecycleprotected void startJGroupsChannelIfNeeded()
public void waitForView(int viewId)
throws InterruptedException
waitForView in interface TransportInterruptedExceptionpublic boolean waitForView(int viewId,
long timeout,
TimeUnit timeUnit)
throws InterruptedException
InterruptedExceptionpublic void stop()
Lifecycleprotected void initChannel()
protected void initRPCDispatcher()
public boolean isCoordinator()
isCoordinator in interface Transportpublic Address getCoordinator()
getCoordinator in interface Transportpublic List<Address> getMembers()
TransportgetMembers in interface Transportpublic boolean isMulticastCapable()
TransportisMulticastCapable in interface Transportpublic Address getAddress()
TransportgetAddress in interface Transportpublic List<Address> getPhysicalAddresses()
TransportTransport.getAddress().getPhysicalAddresses in interface Transportpublic Map<Address,Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, ResponseFilter responseFilter, DeliverOrder deliverOrder, boolean anycast) throws Exception
TransportinvokeRemotely in interface Transportrecipients - a list of Addresses to invoke the call on. If this is null, the call is broadcast to the
entire cluster.rpcCommand - the cache command to invokemode - the response mode to usetimeout - a timeout after which to throw a replication exception. implementations.responseFilter - a response filter with which to filter out failed/unwanted/invalid responses.deliverOrder - the DeliverOrder.anycast - used when is true, it means that it must use TOA instead of
TOB.Exception - in the event of problems.public CompletableFuture<Map<Address,Response>> invokeRemotelyAsync(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, ResponseFilter responseFilter, DeliverOrder deliverOrder, boolean anycast) throws Exception
invokeRemotelyAsync in interface TransportExceptionpublic Map<Address,Response> invokeRemotely(Map<Address,ReplicableCommand> rpcCommands, ResponseMode mode, long timeout, boolean usePriorityQueue, ResponseFilter responseFilter, boolean totalOrder, boolean anycast) throws Exception
invokeRemotely in interface TransportExceptionpublic Map<Address,Response> invokeRemotely(Map<Address,ReplicableCommand> rpcCommands, ResponseMode mode, long timeout, ResponseFilter responseFilter, DeliverOrder deliverOrder, boolean anycast) throws Exception
invokeRemotely in interface TransportExceptionpublic BackupResponse backupRemotely(Collection<XSiteBackup> backups, XSiteReplicateCommand rpcCommand) throws Exception
backupRemotely in interface TransportExceptionprotected Response checkRsp(org.jgroups.util.Rsp<Response> rsp, Address sender, boolean ignoreTimeout, boolean ignoreLeavers)
public void viewAccepted(org.jgroups.View newView)
viewAccepted in interface org.jgroups.MembershipListenerpublic void suspect(org.jgroups.Address suspected_mbr)
suspect in interface org.jgroups.MembershipListenerpublic void block()
block in interface org.jgroups.MembershipListenerpublic void unblock()
unblock in interface org.jgroups.MembershipListenerprotected static org.jgroups.Address toJGroupsAddress(Address a)
public CommandAwareRpcDispatcher getCommandAwareRpcDispatcher()
public org.jgroups.Channel getChannel()
public final void checkTotalOrderSupported()
TransportcheckTotalOrderSupported in interface TransportCopyright © 2024 JBoss, a division of Red Hat. All rights reserved.