com.hazelcast.client.util
Class StaticLB

java.lang.Object
  extended by com.hazelcast.client.util.StaticLB
All Implemented Interfaces:
LoadBalancer

public class StaticLB
extends Object
implements LoadBalancer

The StaticLB is a LoadBalancer that always returns the same member. This can be useful for testing if you want to hit a specific member.


Constructor Summary
StaticLB(Member member)
           
 
Method Summary
 void init(Cluster cluster, ClientConfig config)
          Initializes the LoadBalancer.
 Member next()
          Returns the next member to route to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticLB

public StaticLB(Member member)
Method Detail

init

public void init(Cluster cluster,
                 ClientConfig config)
Description copied from interface: LoadBalancer
Initializes the LoadBalancer.

Specified by:
init in interface LoadBalancer
Parameters:
cluster - the Cluster this LoadBalancer uses to select members from.
config - the ClientConfig.

next

public Member next()
Description copied from interface: LoadBalancer
Returns the next member to route to.

Specified by:
next in interface LoadBalancer
Returns:
Returns the next member or null if no member is available


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.