Class RPCServiceImpl

java.lang.Object
org.exoplatform.services.rpc.impl.AbstractRPCService
org.exoplatform.services.rpc.jgv3.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 3.
Version:
$Id$
Author:
Nicolas Filotto
  • Constructor Details

    • RPCServiceImpl

      public RPCServiceImpl(org.exoplatform.container.ExoContainerContext ctx, org.exoplatform.container.xml.InitParams params, org.exoplatform.container.configuration.ConfigurationManager configManager)
  • Method Details

    • 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
    • getHostAddress

      public String getHostAddress()
      Returns the IP address of current channel.
      Specified by:
      getHostAddress in class AbstractRPCService
      Returns:
      The Host's address or null if it cannot be found
    • castMessage

      protected org.jgroups.util.RspList<Object> castMessage(List<org.jgroups.Address> dests, org.jgroups.Message msg, boolean synchronous, long timeout) throws Exception
      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.
      Throws:
      Exception - if any error occur while casting the message
    • 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
    • unblock

      public void unblock()
    • 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