org.objectweb.jac.aspects.distribution
Interface LoadBalancingConf

All Known Implementing Classes:
LoadBalancingAC

public interface LoadBalancingConf

This is the configuration interface of the load-balancing aspect

Author:
Renaud Pawlak
See Also:
LoadBalancingAC

Method Summary
 void addRandomLoadBalancer(String wrappeeName, String methods, String hostName, String replicaExpr)
          This configuration method allows the user to define a random load-balancer on a replication group.
 void addRoundTripLoadBalancer(String wrappeeName, String methods, String hostName, String replicaExpr)
          This configuration method allows the user to define a round-trip load-balancer on a replication group.
 

Method Detail

addRoundTripLoadBalancer

public void addRoundTripLoadBalancer(String wrappeeName,
                                     String methods,
                                     String hostName,
                                     String replicaExpr)
This configuration method allows the user to define a round-trip load-balancer on a replication group.

It assumes that a replication group exists on a set of host denoted by replicaExpr. It also assumes that an uncorrelated replica called wrappeeName exists on hostName. Note that this distributed scheme can be easilly obtained by configuring the deployment aspect for an object myObject like this:

 replicated "myObject" ".*[1-6]"
 

This means that myObject is replicated on all the hosts one to six and that the replicas are strongly consistent. Then, you can configure the load-balancing:

 addRoundTripLoadBalancer "photorepository0" ".*" "s0" ".*[1-6]"
 

Note that the round-trip balancer (located on s0) changes the replica it uses for each invocation. The followed sequence is 1,2,3,4,5,6,1,2,3,4,5,6,1,...

An alternative to the round-trip load-balancer is the random load-balancer that randomly picks out the next replica to use. This can be useful when a total decoralation is needed for all clients.

Parameters:
wrappeeName - the name of the object that is replicated and that will act as a load-balancer proxy
methods - a pointcut expression for the method that perform the load-balancing (others perform local calls)
hostName - the host where the proxy load-balances
replicaExpr - a regular expression that matches all the hosts of the topology where the replicas are located
See Also:
addRandomLoadBalancer(String,String,String,String)

addRandomLoadBalancer

public void addRandomLoadBalancer(String wrappeeName,
                                  String methods,
                                  String hostName,
                                  String replicaExpr)
This configuration method allows the user to define a random load-balancer on a replication group.

It follows the same principles as a round-trip balancer but picks up the next replica to use randomly.

See Also:
addRoundTripLoadBalancer(String,String,String,String)