org.infinispan.remoting.transport
Interface Transport

All Superinterfaces:
Lifecycle
All Known Implementing Classes:
AbstractTransport, JGroupsTransport

public interface Transport
extends Lifecycle

An interface that provides a communication link with remote caches. Also allows remote caches to invoke commands on this cache instance.

Since:
4.0
Author:
Manik Surtani, Galder ZamarreƱo

Method Summary
 Address getAddress()
          Retrieves the current cache instance's network address
 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()
           
 void initialize(StreamingMarshaller marshaller, ExecutorService asyncExecutor, InboundInvocationHandler handler, 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 setConfiguration(GlobalConfiguration gc)
           
 void start()
           
 void stop()
           
 

Method Detail

setConfiguration

void setConfiguration(GlobalConfiguration gc)

initialize

void initialize(StreamingMarshaller marshaller,
                ExecutorService asyncExecutor,
                InboundInvocationHandler handler,
                CacheManagerNotifier notifier)
Initializes the transport with global cache configuration and transport-specific properties.

Parameters:
marshaller - marshaller to use for marshalling and unmarshalling
asyncExecutor - executor to use for asynchronous calls
handler - handler for invoking remotely originating calls on the local cache
notifier - notifier to use

invokeRemotely

Map<Address,Response> invokeRemotely(Collection<Address> recipients,
                                     ReplicableCommand rpcCommand,
                                     ResponseMode mode,
                                     long timeout,
                                     boolean usePriorityQueue,
                                     ResponseFilter responseFilter)
                                     throws Exception
Invokes an RPC call on other caches in the cluster.

Parameters:
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 invoke
mode - the response mode to use
timeout - 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.
Returns:
a map of responses from each member contacted.
Throws:
Exception - in the event of problems.

isCoordinator

boolean isCoordinator()
Returns:
true if the current Channel is the coordinator of the cluster.

getCoordinator

Address getCoordinator()
Returns:
the Address of the current coordinator.

getAddress

Address getAddress()
Retrieves the current cache instance's network address

Returns:
an Address

getPhysicalAddresses

List<Address> getPhysicalAddresses()
Retrieves the current cache instance's physical network addresses. Some implementations might differentiate between logical and physical addresses in which case, this method allows clients to query the physical ones associated with the logical address. Implementations where logical and physical address are the same will simply return a single entry List that contains the same Address as getAddress().

Returns:
an List of Address

getMembers

List<Address> getMembers()
Returns a list of members in the current cluster view.

Returns:
a list of members. Typically, this would be defensively copied.

isMulticastCapable

boolean isMulticastCapable()
Tests whether the transport supports true multicast

Returns:
true if the transport supports true multicast

start

void start()
Specified by:
start in interface Lifecycle

stop

void stop()
Specified by:
stop in interface Lifecycle

getViewId

int getViewId()
Throws:
CacheException - if the transport has been stopped.

getLog

Log getLog()

-->

Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.