|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jac.core.AspectComponent
org.objectweb.jac.aspects.distribution.LoadBalancingAC
This Aspect Component allows the programmer to easily implement load-balancing features for its application when JAC is running in distributed mode.
LoadBalancingConf
,
Serialized FormNested Class Summary | |
class |
LoadBalancingAC.LoadBalancingWrapper
This inner-wrapper handles the load-balancing wrapping methods that actually implement the load-balancing algorithms. |
Field Summary |
Fields inherited from class org.objectweb.jac.core.AspectComponent |
application, blockKeywords, cr, currentConfigMethod, currentImports, firstCall, NOT_SHARED, SHARED, startWeavingCCount, startWeavingCount, startWeavingMethod, startWeavingType, systemListener, wrappers |
Fields inherited from interface org.objectweb.jac.core.BaseProgramListener |
FOUND_OBJECT |
Constructor Summary | |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LoadBalancingAC()
Method Detail |
public void addRoundTripLoadBalancer(String wrappeeName, String methods, String hostName, String replicaExpr)
LoadBalancingConf
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.
addRoundTripLoadBalancer
in interface LoadBalancingConf
wrappeeName
- the name of the object that is replicated and
that will act as a load-balancer proxymethods
- a pointcut expression for the method that perform
the load-balancing (others perform local calls)hostName
- the host where the proxy load-balancesreplicaExpr
- a regular expression that matches all the
hosts of the topology where the replicas are locatedLoadBalancingConf.addRandomLoadBalancer(String,String,String,String)
public void addRandomLoadBalancer(String wrappeeName, String methods, String hostName, String replicaExpr)
LoadBalancingConf
It follows the same principles as a round-trip balancer but picks up the next replica to use randomly.
addRandomLoadBalancer
in interface LoadBalancingConf
LoadBalancingConf.addRoundTripLoadBalancer(String,String,String,String)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |