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 org.infinispan.commons.marshall.StreamingMarshaller |
marshaller |
protected List<Address> |
members |
protected CacheManagerNotifier |
notifier |
protected Address |
physicalAddress |
protected org.infinispan.commons.util.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 |
---|---|
TimeoutException |
addSuppressedExceptions(TimeoutException timeoutException,
Responses rsps) |
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(org.infinispan.commons.marshall.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() |
protected void |
startJGroupsChannelIfNeeded() |
void |
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, setConfiguration
public 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 org.infinispan.commons.util.TypedProperties props
protected org.infinispan.commons.marshall.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(org.infinispan.commons.marshall.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()
protected void startJGroupsChannelIfNeeded()
public void waitForView(int viewId) throws InterruptedException
waitForView
in interface Transport
InterruptedException
public boolean waitForView(int viewId, long timeout, TimeUnit timeUnit) throws InterruptedException
InterruptedException
public void stop()
protected void initChannel()
protected void initRPCDispatcher()
public boolean isCoordinator()
isCoordinator
in interface Transport
public Address getCoordinator()
getCoordinator
in interface Transport
public List<Address> getMembers()
Transport
getMembers
in interface Transport
public boolean isMulticastCapable()
Transport
isMulticastCapable
in interface Transport
public Address getAddress()
Transport
getAddress
in interface Transport
public List<Address> getPhysicalAddresses()
Transport
Transport.getAddress()
.getPhysicalAddresses
in interface Transport
public Map<Address,Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, ResponseFilter responseFilter, DeliverOrder deliverOrder, boolean anycast) throws Exception
Transport
invokeRemotely
in interface Transport
recipients
- 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 Transport
Exception
public TimeoutException addSuppressedExceptions(TimeoutException timeoutException, Responses rsps)
public 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 Transport
Exception
public Map<Address,Response> invokeRemotely(Map<Address,ReplicableCommand> rpcCommands, ResponseMode mode, long timeout, ResponseFilter responseFilter, DeliverOrder deliverOrder, boolean anycast) throws Exception
invokeRemotely
in interface Transport
Exception
public BackupResponse backupRemotely(Collection<XSiteBackup> backups, XSiteReplicateCommand rpcCommand) throws Exception
backupRemotely
in interface Transport
Exception
protected 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.MembershipListener
public void suspect(org.jgroups.Address suspected_mbr)
suspect
in interface org.jgroups.MembershipListener
public void block()
block
in interface org.jgroups.MembershipListener
public void unblock()
unblock
in interface org.jgroups.MembershipListener
protected static org.jgroups.Address toJGroupsAddress(Address a)
public CommandAwareRpcDispatcher getCommandAwareRpcDispatcher()
public org.jgroups.Channel getChannel()
public final void checkTotalOrderSupported()
Transport
checkTotalOrderSupported
in interface Transport
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.