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
Created by The eXo Platform SAS.- Version:
- $Id: $
- Author:
- Vitaly Parfonov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLoadBalancerImpl.LoadBalancerConf
-
Constructor Summary
Constructors Constructor Description LoadBalancerImpl(org.exoplatform.container.xml.InitParams params)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNode(Node node)Add new node for cometd connection.voidaddPlugin(org.exoplatform.container.component.ComponentPlugin plugin)Stringconnection(String exoId)List<String>getAliveNodesURL()booleanrelease(String exoId)Release connection on the node there client connected.voidremoveNode(String id)Remove cometd node.voidstart()voidstop()
-
-
-
Method Detail
-
addNode
public void addNode(Node node)
Add new node for cometd connection.- Specified by:
addNodein interfaceLoadBalancer- Parameters:
node- the new node in cluster.
-
connection
public String connection(String exoId)
- Specified by:
connectionin interfaceLoadBalancer- Parameters:
exoId- the id of client.- Returns:
- URL of cometd node.
-
getAliveNodesURL
public List<String> getAliveNodesURL()
- Specified by:
getAliveNodesURLin interfaceLoadBalancer- Returns:
- URLs of all cometd nodes.
-
release
public boolean release(String exoId)
Release connection on the node there client connected.- Specified by:
releasein interfaceLoadBalancer- Parameters:
exoId- client id.- Returns:
- true if release successful
-
removeNode
public void removeNode(String id)
Remove cometd node.- Specified by:
removeNodein interfaceLoadBalancer- Parameters:
id- the ID of cometd node.
-
start
public void start()
- Specified by:
startin interfaceorg.picocontainer.Startable
-
stop
public void stop()
- Specified by:
stopin interfaceorg.picocontainer.Startable
-
addPlugin
public void addPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
-
-