public class JGroupsTransport extends AbstractTransport implements MembershipListener
JGroupsChannelLookup
instanceGlobalConfiguration.setTransportProperties(java.util.Properties)
or
in the Infinispan XML configuration file.Modifier and Type | Field and Description |
---|---|
protected Address |
address |
protected ExecutorService |
asyncExecutor |
protected Channel |
channel |
static String |
CHANNEL_LOOKUP |
protected CountDownLatch |
channelConnectedLatch |
static String |
CONFIGURATION_FILE |
static String |
CONFIGURATION_STRING |
static String |
CONFIGURATION_XML |
protected Address |
coordinator |
protected static String |
DEFAULT_JGROUPS_CONFIGURATION_FILE |
protected InboundInvocationHandler |
inboundInvocationHandler |
protected boolean |
isCoordinator |
protected StreamingMarshaller |
marshaller |
protected List<Address> |
members |
protected CacheManagerNotifier |
notifier |
protected Address |
physicalAddress |
protected TypedProperties |
props |
protected boolean |
startChannel |
protected boolean |
stopChannel |
configuration
Constructor and Description |
---|
JGroupsTransport() |
JGroupsTransport(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 |
---|---|
void |
block()
Called (usually by the FLUSH protocol), as an indication that the member should stop sending
messages.
|
Address |
getAddress()
Retrieves the current cache instance's network address
|
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,
InboundInvocationHandler inboundInvocationHandler,
CacheManagerNotifier notifier)
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)
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(Address suspected_mbr)
Called whenever a member is suspected of having crashed, but has not yet been excluded.
|
protected static Address |
toJGroupsAddress(Address a) |
void |
unblock()
Called after the FLUSH protocol has unblocked previously blocked senders, and
messages can be sent again.
|
void |
viewAccepted(View newView)
Called when a change in membership has occurred.
|
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 startChannel
protected boolean stopChannel
protected TypedProperties props
protected InboundInvocationHandler inboundInvocationHandler
protected StreamingMarshaller marshaller
protected ExecutorService asyncExecutor
protected CacheManagerNotifier notifier
protected Channel channel
protected Address address
protected Address physicalAddress
protected volatile Address coordinator
protected volatile boolean isCoordinator
protected CountDownLatch channelConnectedLatch
public JGroupsTransport(Channel channel)
channel
- created and running channel to usepublic JGroupsTransport()
public void initialize(StreamingMarshaller marshaller, ExecutorService asyncExecutor, InboundInvocationHandler inboundInvocationHandler, CacheManagerNotifier notifier)
Transport
initialize
in interface Transport
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 usepublic 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) 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.Exception
- in the event of problems.public void viewAccepted(View newView)
MembershipListener
Channel.connect(String)
returns.viewAccepted
in interface MembershipListener
public void suspect(Address suspected_mbr)
MembershipListener
suspect
in interface MembershipListener
public void block()
MembershipListener
MembershipListener.unblock()
. Note that block() is the equivalent
of reception of a BlockEvent in the pull mode.block
in interface MembershipListener
public void unblock()
MembershipListener
Note that during new view installation we provide guarantee that unblock invocation strictly follows view installation at some node A belonging to that view . However, some other message M may squeeze in between view and unblock callbacks. For more details see https://jira.jboss.org/jira/browse/JGRP-986
unblock
in interface MembershipListener
public CommandAwareRpcDispatcher getCommandAwareRpcDispatcher()
public Channel getChannel()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.