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 ExecutorService |
asyncExecutor |
protected org.jgroups.Channel |
channel |
static String |
CHANNEL_LOOKUP |
protected CountDownLatch |
channelConnectedLatch |
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 InboundInvocationHandler |
inboundInvocationHandler |
protected boolean |
isCoordinator |
protected StreamingMarshaller |
marshaller |
protected List<Address> |
members |
protected CacheManagerNotifier |
notifier |
protected Address |
physicalAddress |
protected TypedProperties |
props |
protected ExecutorService |
remoteCommandsExecutor |
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,
ReplicableCommand rpcCommand) |
void |
block() |
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.
|
int |
getViewId() |
protected void |
initChannel() |
void |
initialize(StreamingMarshaller marshaller,
ExecutorService asyncExecutor,
ExecutorService remoteCommandsExecutor,
InboundInvocationHandler inboundInvocationHandler,
CacheManagerNotifier notifier,
GlobalComponentRegistry gcr,
BackupReceiverRepository backupReceiverRepository,
TimeService timeService)
Initializes the transport with global cache configuration and transport-specific properties.
|
Map<Address,Response> |
invokeRemotely(Collection<Address> recipients,
ReplicableCommand rpcCommand,
ResponseMode mode,
long timeout,
boolean usePriorityQueue,
ResponseFilter responseFilter,
boolean totalOrder,
boolean anycast)
Invokes an RPC call on other caches in the cluster.
|
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 |
waitForChannelToConnect() |
checkResponse, parseResponseAndAddToResponseList, 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 TypedProperties props
protected InboundInvocationHandler inboundInvocationHandler
protected StreamingMarshaller marshaller
protected ExecutorService asyncExecutor
protected ExecutorService remoteCommandsExecutor
protected CacheManagerNotifier notifier
protected org.jgroups.Channel channel
protected Address address
protected Address physicalAddress
protected volatile Address coordinator
protected volatile boolean isCoordinator
protected CountDownLatch channelConnectedLatch
public JGroupsTransport(org.jgroups.Channel channel)
channel
- created and running channel to usepublic JGroupsTransport()
public void initialize(StreamingMarshaller marshaller, ExecutorService asyncExecutor, ExecutorService remoteCommandsExecutor, InboundInvocationHandler inboundInvocationHandler, CacheManagerNotifier notifier, GlobalComponentRegistry gcr, BackupReceiverRepository backupReceiverRepository, TimeService timeService)
marshaller
- marshaller to use for marshalling and unmarshallingasyncExecutor
- executor to use for asynchronous callsinboundInvocationHandler
- handler for invoking remotely originating calls on the local cachenotifier
- notifier to usegcr
- public void start()
protected void startJGroupsChannelIfNeeded()
public void stop()
protected void initChannel()
public boolean isCoordinator()
isCoordinator
in interface Transport
public Address getCoordinator()
getCoordinator
in interface Transport
public void waitForChannelToConnect()
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, boolean usePriorityQueue, ResponseFilter responseFilter, boolean totalOrder, 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.usePriorityQueue
- if true, a priority queue is used to deliver messages. May not be supported by all
implementations.responseFilter
- a response filter with which to filter out failed/unwanted/invalid responses.totalOrder
- the command will be send with total order propertiesanycast
- used when is true
, it means that it must use TOA instead of TOB.Exception
- in the event of problems.public BackupResponse backupRemotely(Collection<XSiteBackup> backups, ReplicableCommand rpcCommand) throws Exception
backupRemotely
in interface Transport
Exception
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 © 2014 JBoss, a division of Red Hat. All Rights Reserved.