org.exoplatform.ws.frameworks.cometd.loadbalancer
Class LoadBalancerImpl

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

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

Created by The eXo Platform SAS.

Version:
$Id: $
Author:
Vitaly Parfonov

Nested Class Summary
static class LoadBalancerImpl.LoadBalancerConf
           
 
Constructor Summary
LoadBalancerImpl(org.exoplatform.container.xml.InitParams params)
           
 
Method Summary
 void addNode(Node node)
          Add new node for cometd connection.
 void addPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
           
 String connection(String exoId)
          
 List<String> getAliveNodesURL()
          
 boolean release(String exoId)
          Release connection on the node there client connected.
 void removeNode(String id)
          Remove cometd node.
 void start()
          
 void stop()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoadBalancerImpl

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

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)


Copyright © 2013 eXo Platform SAS. All Rights Reserved.