Class LoadBalancerImpl

java.lang.Object
org.exoplatform.ws.frameworks.cometd.loadbalancer.LoadBalancerImpl
All Implemented Interfaces:
LoadBalancer, org.picocontainer.Startable

public class LoadBalancerImpl extends Object implements LoadBalancer, org.picocontainer.Startable
  • Constructor Details

    • LoadBalancerImpl

      public LoadBalancerImpl(org.exoplatform.container.xml.InitParams params)
      Parameters:
      params - the initial parameters.
  • Method Details

    • addNode

      public void addNode(Node node)
      Add new node for cometd connection.
      Specified by:
      addNode in interface LoadBalancer
      Parameters:
      node - the new node in cluster.
    • connection

      public String connection(String exoId)
      Specified by:
      connection in interface LoadBalancer
      Parameters:
      exoId - the id of client.
      Returns:
      URL of cometd node.
    • getAliveNodesURL

      public List<String> getAliveNodesURL()
      Specified by:
      getAliveNodesURL in interface LoadBalancer
      Returns:
      URLs of all cometd nodes.
    • release

      public boolean release(String exoId)
      Release connection on the node there client connected.
      Specified by:
      release in interface LoadBalancer
      Parameters:
      exoId - client id.
      Returns:
      true if release successful
    • removeNode

      public void removeNode(String id)
      Remove cometd node.
      Specified by:
      removeNode in interface LoadBalancer
      Parameters:
      id - the ID of cometd node.
    • start

      public void start()
      Specified by:
      start in interface org.picocontainer.Startable
    • stop

      public void stop()
      Specified by:
      stop in interface org.picocontainer.Startable
    • addPlugin

      public void addPlugin(org.exoplatform.container.component.ComponentPlugin plugin)