|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.infinispan.remoting.transport.jgroups.JGroupsTransport
public class JGroupsTransport
An encapsulation of a JGroups transport. JGroups transports can be configured using a variety of methods, usually by passing in one of the following properties:
JGroupsChannelLookup
instanceGlobalConfiguration.setTransportProperties(java.util.Properties)
or in the Infinispan XML configuration file.
Field Summary | |
---|---|
protected Address |
address
|
protected ExecutorService |
asyncExecutor
|
protected GlobalConfiguration |
c
|
protected org.jgroups.Channel |
channel
|
static String |
CHANNEL_LOOKUP
|
static String |
CONFIGURATION_FILE
|
static String |
CONFIGURATION_STRING
|
static String |
CONFIGURATION_XML
|
protected boolean |
coordinator
|
protected boolean |
createdChannel
|
protected static String |
DEFAULT_JGROUPS_CONFIGURATION_FILE
|
protected InboundInvocationHandler |
inboundInvocationHandler
|
protected Marshaller |
marshaller
|
protected List<Address> |
members
|
protected Object |
membersListLock
|
protected CacheManagerNotifier |
notifier
|
protected Address |
physicalAddress
|
protected TypedProperties |
props
|
protected boolean |
startChannel
|
protected boolean |
stopChannel
|
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
void |
block()
|
Address |
getAddress()
Retrieves the current cache instance's network address |
org.jgroups.Channel |
getChannel()
|
CommandAwareRpcDispatcher |
getCommandAwareRpcDispatcher()
|
Address |
getCoordinator()
|
DistributedSync |
getDistributedSync()
|
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. |
byte[] |
getState()
|
void |
getState(OutputStream ostream)
|
byte[] |
getState(String state_id)
|
void |
getState(String cacheName,
OutputStream ostream)
|
int |
getViewId()
|
protected void |
initChannel()
|
void |
initialize(GlobalConfiguration c,
Marshaller marshaller,
ExecutorService asyncExecutor,
InboundInvocationHandler inboundInvocationHandler,
CacheManagerNotifier notifier)
Initializes the transport with global cache configuration and transport-specific properties. |
List<Response> |
invokeRemotely(Collection<Address> recipients,
ReplicableCommand rpcCommand,
ResponseMode mode,
long timeout,
boolean usePriorityQueue,
ResponseFilter responseFilter,
boolean supportReplay)
Invokes an RPC call on other caches in the cluster. |
boolean |
isCoordinator()
|
boolean |
isSupportStateTransfer()
Tests whether the transport supports state transfer |
void |
receive(org.jgroups.Message msg)
|
boolean |
retrieveState(String cacheName,
Address address,
long timeout)
Initiates a state retrieval from a specific cache (by typically invoking InboundInvocationHandler.generateState(String, java.io.OutputStream) ), and applies this
state to the current cache via the InboundInvocationHandler.applyState(String, java.io.InputStream)
callback. |
void |
setState(byte[] state)
|
void |
setState(InputStream istream)
|
void |
setState(String state_id,
byte[] state)
|
void |
setState(String cacheName,
InputStream istream)
|
void |
start()
|
protected void |
startJGroupsChannelIfNeeded()
|
void |
stop()
|
void |
suspect(org.jgroups.Address suspected_mbr)
|
void |
unblock()
|
void |
viewAccepted(org.jgroups.View newView)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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 org.jgroups.Channel channel
protected boolean createdChannel
protected Address address
protected Address physicalAddress
protected volatile List<Address> members
protected volatile boolean coordinator
protected final Object membersListLock
protected GlobalConfiguration c
protected TypedProperties props
protected InboundInvocationHandler inboundInvocationHandler
protected Marshaller marshaller
protected ExecutorService asyncExecutor
protected CacheManagerNotifier notifier
Constructor Detail |
---|
public JGroupsTransport(org.jgroups.Channel channel)
channel
- created and running channel to usepublic JGroupsTransport()
Method Detail |
---|
public void initialize(GlobalConfiguration c, Marshaller marshaller, ExecutorService asyncExecutor, InboundInvocationHandler inboundInvocationHandler, CacheManagerNotifier notifier)
Transport
initialize
in interface Transport
c
- global cache-wide configurationmarshaller
- 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()
start
in interface Lifecycle
start
in interface Transport
protected void startJGroupsChannelIfNeeded()
public int getViewId()
getViewId
in interface Transport
public void stop()
stop
in interface Lifecycle
stop
in interface Transport
protected void initChannel()
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 retrieveState(String cacheName, Address address, long timeout) throws StateTransferException
Transport
InboundInvocationHandler.generateState(String, java.io.OutputStream)
), and applies this
state to the current cache via the InboundInvocationHandler.applyState(String, java.io.InputStream)
callback.
retrieveState
in interface Transport
cacheName
- name of cache for which to retrieve stateaddress
- address of remote cache from which to retrieve statetimeout
- state retrieval timeout in milliseconds
StateTransferException
- if state cannot be retrieved from the specific cachepublic DistributedSync getDistributedSync()
getDistributedSync
in interface Transport
public boolean isSupportStateTransfer()
Transport
isSupportStateTransfer
in interface Transport
public Address getAddress()
Transport
getAddress
in interface Transport
public List<Address> getPhysicalAddresses()
Transport
Transport.getAddress()
.
getPhysicalAddresses
in interface Transport
public List<Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, boolean usePriorityQueue, ResponseFilter responseFilter, boolean supportReplay) 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.supportReplay
- whether replays of missed messages is supported
Exception
- in the event of problems.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.ExtendedMembershipListener
public void receive(org.jgroups.Message msg)
receive
in interface org.jgroups.MessageListener
public byte[] getState()
getState
in interface org.jgroups.MessageListener
public void setState(byte[] state)
setState
in interface org.jgroups.MessageListener
public byte[] getState(String state_id)
getState
in interface org.jgroups.ExtendedMessageListener
public void setState(String state_id, byte[] state)
setState
in interface org.jgroups.ExtendedMessageListener
public void getState(OutputStream ostream)
getState
in interface org.jgroups.ExtendedMessageListener
public void getState(String cacheName, OutputStream ostream)
getState
in interface org.jgroups.ExtendedMessageListener
public void setState(InputStream istream)
setState
in interface org.jgroups.ExtendedMessageListener
public void setState(String cacheName, InputStream istream)
setState
in interface org.jgroups.ExtendedMessageListener
public CommandAwareRpcDispatcher getCommandAwareRpcDispatcher()
public org.jgroups.Channel getChannel()
|
Google Analytics | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |