eXo Kernel :: Component :: Common Service 2.4.11-UXP01

org.exoplatform.services.rpc.impl
Class RPCServiceImpl

java.lang.Object
  extended by org.exoplatform.services.rpc.impl.AbstractRPCService
      extended by org.exoplatform.services.rpc.impl.RPCServiceImpl
All Implemented Interfaces:
RPCService, org.jgroups.blocks.RequestHandler, org.jgroups.MembershipListener, org.picocontainer.Startable

public class RPCServiceImpl
extends AbstractRPCService

This class is the implementation of the AbstractRPCService for JGroups 2.

Version:
$Id$
Author:
Nicolas Filotto

Nested Class Summary
 
Nested classes/interfaces inherited from class org.exoplatform.services.rpc.impl.AbstractRPCService
AbstractRPCService.MemberHasLeftException, AbstractRPCService.MessageBody, AbstractRPCService.State
 
Field Summary
 
Fields inherited from class org.exoplatform.services.rpc.impl.AbstractRPCService
channel, CLUSTER_NAME, configurator, coordinator, DEFAULT_RETRY_TIMEOUT, DEFAULT_TIMEOUT, dispatcher, isCoordinator, members, PARAM_ALLOW_FAILOVER, PARAM_CLUSTER_NAME, PARAM_DEFAULT_TIMEOUT, PARAM_JGROUPS_CONFIG, PARAM_RETRY_TIMEOUT
 
Fields inherited from interface org.exoplatform.services.rpc.RPCService
ACCESS_RPC_SERVICE_PERMISSION
 
Constructor Summary
RPCServiceImpl(ExoContainerContext ctx, InitParams params, ConfigurationManager configManager)
          
 
Method Summary
protected  org.jgroups.util.RspList castMessage(List<org.jgroups.Address> dests, org.jgroups.Message msg, boolean synchronous, long timeout)
          Cast a message to all the given members
protected  org.jgroups.Channel createChannel()
          Create a channel
protected  org.jgroups.Address getLocalAddress()
          Returns the channel's own address.
protected  List<org.jgroups.Address> getMembers(org.jgroups.View view)
          Returns a reference to the List of members (ordered) Do NOT change this list, hence your will invalidate the view Make a copy if you have to modify it.
protected  void setObject(org.jgroups.Message m, Object o)
          Takes an object and uses Java serialization to generate the byte[] buffer which is set in the message.
 
Methods inherited from class org.exoplatform.services.rpc.impl.AbstractRPCService
block, excecuteCommand, executeCommandOnAllNodes, executeCommandOnAllNodes, executeCommandOnAllNodesMain, executeCommandOnCoordinator, executeCommandOnCoordinator, executeCommandOnCoordinatorMain, getClusterName, getCommand, getDefaultTimeout, getRetryTimeout, handle, isAllowFailover, isCoordinator, registerCommand, registerTopologyChangeListener, start, stop, suspect, unregisterCommand, unregisterTopologyChangeListener, viewAccepted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RPCServiceImpl

public RPCServiceImpl(ExoContainerContext ctx,
                      InitParams params,
                      ConfigurationManager configManager)

Method Detail

getLocalAddress

protected org.jgroups.Address getLocalAddress()
Returns the channel's own address. The result of calling this method on an unconnected channel is implementation defined (may return null). Calling this method on a closed channel returns null. Successor to #getAddress(). Addresses can be used as destination in the send() operation.

Specified by:
getLocalAddress in class AbstractRPCService
Returns:
The channel's address (opaque) or null if it cannot be found

castMessage

protected org.jgroups.util.RspList castMessage(List<org.jgroups.Address> dests,
                                               org.jgroups.Message msg,
                                               boolean synchronous,
                                               long timeout)
Cast a message to all the given members

Specified by:
castMessage in class AbstractRPCService
Parameters:
dests - The members to which the message is to be sent.
msg - The message to be sent to the members.
synchronous - Indicates whether the message must be sent in synchronous or asynchronous mode.
timeout - If 0: wait forever. Otherwise, wait for responses or timeout time.
Returns:
A list of responses. Each response is an Object and associated to its sender.

createChannel

protected org.jgroups.Channel createChannel()
                                     throws Exception
Create a channel

Specified by:
createChannel in class AbstractRPCService
Returns:
An initialized channel
Throws:
Exception - if any error occur while creating the channel

getMembers

protected List<org.jgroups.Address> getMembers(org.jgroups.View view)
Returns a reference to the List of members (ordered) Do NOT change this list, hence your will invalidate the view Make a copy if you have to modify it.

Specified by:
getMembers in class AbstractRPCService
Returns:
a reference to the ordered list of members in this view

setObject

protected void setObject(org.jgroups.Message m,
                         Object o)
Takes an object and uses Java serialization to generate the byte[] buffer which is set in the message.

Specified by:
setObject in class AbstractRPCService

eXo Kernel :: Component :: Common Service 2.4.11-UXP01

Copyright © 2014 eXo Platform SAS. All Rights Reserved.