Modifier | Constructor and Description |
---|---|
protected |
AbstractDelegatingTransport(Transport actual) |
Modifier and Type | Method and Description |
---|---|
BackupResponse |
backupRemotely(Collection<XSiteBackup> backups,
XSiteReplicateCommand rpcCommand) |
XSiteResponse |
backupRemotely(XSiteBackup backup,
XSiteReplicateCommand rpcCommand)
Sends a cross-site request to a remote site.
|
void |
checkCrossSiteAvailable()
Checks if this
Transport is able to perform cross-site requests. |
Address |
getAddress()
Retrieves the current cache instance's network address
|
Address |
getCoordinator() |
Transport |
getDelegate() |
Log |
getLog() |
List<Address> |
getMembers()
Returns a list of members in the current cluster view.
|
List<Address> |
getMembersPhysicalAddresses()
Returns physical addresses of members in the current cluster view.
|
List<Address> |
getPhysicalAddresses()
Retrieves the current cache instance's physical network addresses.
|
Set<String> |
getSitesView()
Get the view of interconnected sites.
|
int |
getViewId() |
<T> CompletionStage<T> |
invokeCommand(Address target,
ReplicableCommand command,
ResponseCollector<T> collector,
DeliverOrder deliverOrder,
long timeout,
TimeUnit unit)
Invoke a command on a single node and pass the response to a
ResponseCollector . |
<T> CompletionStage<T> |
invokeCommand(Collection<Address> targets,
ReplicableCommand command,
ResponseCollector<T> collector,
DeliverOrder deliverOrder,
long timeout,
TimeUnit unit)
Invoke a command on a collection of node and pass the responses to a
ResponseCollector . |
<T> CompletionStage<T> |
invokeCommandOnAll(ReplicableCommand command,
ResponseCollector<T> collector,
DeliverOrder deliverOrder,
long timeout,
TimeUnit unit)
Invoke a command on all the nodes in the cluster and pass the responses to a
ResponseCollector . |
<T> CompletionStage<T> |
invokeCommands(Collection<Address> targets,
Function<Address,ReplicableCommand> commandGenerator,
ResponseCollector<T> collector,
DeliverOrder deliverOrder,
long timeout,
TimeUnit timeUnit)
Invoke different commands on a collection of nodes and pass the responses to a
ResponseCollector . |
<T> CompletionStage<T> |
invokeCommandStaggered(Collection<Address> targets,
ReplicableCommand command,
ResponseCollector<T> collector,
DeliverOrder deliverOrder,
long timeout,
TimeUnit unit)
Invoke a command on a collection of nodes and pass the responses to a
ResponseCollector . |
Map<Address,Response> |
invokeRemotely(Collection<Address> recipients,
ReplicableCommand rpcCommand,
ResponseMode mode,
long timeout,
ResponseFilter responseFilter,
DeliverOrder deliverOrder,
boolean anycast)
Deprecated.
|
Map<Address,Response> |
invokeRemotely(Map<Address,ReplicableCommand> rpcCommands,
ResponseMode mode,
long timeout,
boolean usePriorityQueue,
ResponseFilter responseFilter,
boolean totalOrder,
boolean anycast)
Deprecated.
|
Map<Address,Response> |
invokeRemotely(Map<Address,ReplicableCommand> rpcCommands,
ResponseMode mode,
long timeout,
ResponseFilter responseFilter,
DeliverOrder deliverOrder,
boolean anycast)
Deprecated.
|
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
|
String |
localSiteName() |
void |
sendTo(Address destination,
ReplicableCommand rpcCommand,
DeliverOrder deliverOrder)
Asynchronously sends the
ReplicableCommand to the destination using the specified DeliverOrder . |
void |
sendToAll(ReplicableCommand rpcCommand,
DeliverOrder deliverOrder)
Asynchronously sends the
ReplicableCommand to the entire cluster. |
void |
sendToMany(Collection<Address> destinations,
ReplicableCommand rpcCommand,
DeliverOrder deliverOrder)
Asynchronously sends the
ReplicableCommand to the set of destination using the specified DeliverOrder . |
void |
start()
Invoked on component start
|
void |
stop()
Invoked on component stop
|
void |
waitForView(int viewId)
Deprecated.
|
CompletableFuture<Void> |
withView(int expectedViewId) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkTotalOrderSupported, invokeCommandOnAll, invokeCommands
protected final Transport actual
protected AbstractDelegatingTransport(Transport actual)
@Deprecated 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.@Deprecated 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
@Deprecated 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 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 void sendTo(Address destination, ReplicableCommand rpcCommand, DeliverOrder deliverOrder) throws Exception
Transport
ReplicableCommand
to the destination using the specified DeliverOrder
.sendTo
in interface Transport
destination
- the destination's Address
.rpcCommand
- the ReplicableCommand
to send.deliverOrder
- the DeliverOrder
to use.Exception
- if there was problem sending the request.public void sendToMany(Collection<Address> destinations, ReplicableCommand rpcCommand, DeliverOrder deliverOrder) throws Exception
Transport
ReplicableCommand
to the set of destination using the specified DeliverOrder
.sendToMany
in interface Transport
destinations
- the collection of destination's Address
. If null
, it sends to all the members
in the cluster.rpcCommand
- the ReplicableCommand
to send.deliverOrder
- the DeliverOrder
to use.Exception
- if there was problem sending the request.public void sendToAll(ReplicableCommand rpcCommand, DeliverOrder deliverOrder) throws Exception
Transport
ReplicableCommand
to the entire cluster.public BackupResponse backupRemotely(Collection<XSiteBackup> backups, XSiteReplicateCommand rpcCommand) throws Exception
backupRemotely
in interface Transport
Exception
public XSiteResponse backupRemotely(XSiteBackup backup, XSiteReplicateCommand rpcCommand)
Transport
Currently, no reply values are supported. Or the request completes successfully or it throws an Exception
.
If XSiteBackup.isSync()
returns false
, the XSiteResponse
is only completed when the an
ACK from the remote site is received. The invoker needs to make sure not to wait for the XSiteResponse
.
backupRemotely
in interface Transport
backup
- The remote site.rpcCommand
- The command to send.XSiteResponse
that is completed when the request is completed.public boolean isCoordinator()
isCoordinator
in interface Transport
public Address getCoordinator()
getCoordinator
in interface Transport
public Address getAddress()
Transport
getAddress
in interface Transport
public List<Address> getPhysicalAddresses()
Transport
Transport.getAddress()
.getPhysicalAddresses
in interface Transport
public List<Address> getMembers()
Transport
getMembers
in interface Transport
public List<Address> getMembersPhysicalAddresses()
Transport
getMembersPhysicalAddresses
in interface Transport
public boolean isMulticastCapable()
Transport
isMulticastCapable
in interface Transport
public void checkCrossSiteAvailable() throws CacheConfigurationException
Transport
Transport
is able to perform cross-site requests.checkCrossSiteAvailable
in interface Transport
CacheConfigurationException
- if cross-site isn't available.public String localSiteName()
localSiteName
in interface Transport
null
if this Transport
cannot make cross-site requests.public void start()
Lifecycle
public void stop()
Lifecycle
public CompletableFuture<Void> withView(int expectedViewId)
withView
in interface Transport
CompletableFuture
that completes when the transport has installed the expected view.@Deprecated public void waitForView(int viewId) throws InterruptedException
waitForView
in interface Transport
InterruptedException
public Transport getDelegate()
public Set<String> getSitesView()
Transport
getSitesView
in interface Transport
public <T> CompletionStage<T> invokeCommand(Address target, ReplicableCommand command, ResponseCollector<T> collector, DeliverOrder deliverOrder, long timeout, TimeUnit unit)
Transport
ResponseCollector
.
If the target is the local node, the command is never executed and ResponseCollector.finish()
is called directly.
invokeCommand
in interface Transport
public <T> CompletionStage<T> invokeCommand(Collection<Address> targets, ReplicableCommand command, ResponseCollector<T> collector, DeliverOrder deliverOrder, long timeout, TimeUnit unit)
Transport
ResponseCollector
.
If one of the targets is the local node, it is ignored. The command is only executed on the remote nodes.
invokeCommand
in interface Transport
public <T> CompletionStage<T> invokeCommandOnAll(ReplicableCommand command, ResponseCollector<T> collector, DeliverOrder deliverOrder, long timeout, TimeUnit unit)
Transport
ResponseCollector
.
The command is not executed locally and it is not sent across RELAY2 bridges to remote sites.
invokeCommandOnAll
in interface Transport
public <T> CompletionStage<T> invokeCommandStaggered(Collection<Address> targets, ReplicableCommand command, ResponseCollector<T> collector, DeliverOrder deliverOrder, long timeout, TimeUnit unit)
Transport
ResponseCollector
.
The command is only sent immediately to the first target, and there is an implementation-dependent
delay before sending the command to each target. There is no delay if the target responds or leaves
the cluster. The remaining targets are skipped if ResponseCollector.addResponse(Address, Response)
returns a non-null
value.
The command is only executed on the remote nodes.
invokeCommandStaggered
in interface Transport
public <T> CompletionStage<T> invokeCommands(Collection<Address> targets, Function<Address,ReplicableCommand> commandGenerator, ResponseCollector<T> collector, DeliverOrder deliverOrder, long timeout, TimeUnit timeUnit)
Transport
ResponseCollector
.
The command is only executed on the remote nodes.
invokeCommands
in interface Transport
Copyright © 2021 JBoss by Red Hat. All rights reserved.