KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jac > aspects > distribution > LoadBalancingConf


1 /*
2   Copyright (C) 2001 Renaud Pawlak
3
4   This program is free software; you can redistribute it and/or modify
5   it under the terms of the GNU Lesser General Public License as
6   published by the Free Software Foundation; either version 2 of the
7   License, or (at your option) any later version.
8
9   This program is distributed in the hope that it will be useful,
10   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12   GNU Lesser General Public License for more details.
13
14   You should have received a copy of the GNU Lesser General Public License
15   along with this program; if not, write to the Free Software
16   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */

17
18 package org.objectweb.jac.aspects.distribution;
19
20 /**
21  * This is the configuration interface of the load-balancing aspect
22  *
23  * @see LoadBalancingAC
24  * @author Renaud Pawlak
25  */

26
27 public interface LoadBalancingConf {
28
29    /**
30     * This configuration method allows the user to define a round-trip
31     * load-balancer on a replication group.
32     *
33     * <p>It assumes that a replication group exists on a set of host
34     * denoted by <code>replicaExpr</code>. It also assumes that an
35     * uncorrelated replica called <code>wrappeeName</code> exists on
36     * <code>hostName</code>. Note that this distributed scheme can be
37     * easilly obtained by configuring the deployment aspect for an
38     * object <code>myObject</code> like this:
39     *
40     * <pre>
41     * replicated "myObject" ".*[1-6]"
42     * </pre>
43     *
44     * <p>This means that <code>myObject</code> is replicated on all
45     * the hosts one to six and that the replicas are strongly
46     * consistent. Then, you can configure the load-balancing:
47     *
48     * <pre>
49     * addRoundTripLoadBalancer "photorepository0" ".*" "s0" ".*[1-6]"
50     * </pre>
51     *
52     * <p>Note that the round-trip balancer (located on s0) changes the
53     * replica it uses for each invocation. The followed sequence is
54     * 1,2,3,4,5,6,1,2,3,4,5,6,1,...
55     *
56     * <p>An alternative to the round-trip load-balancer is the random
57     * load-balancer that randomly picks out the next replica to
58     * use. This can be useful when a total decoralation is needed for
59     * all clients.
60     *
61     * @param wrappeeName the name of the object that is replicated and
62     * that will act as a load-balancer proxy
63     * @param methods a pointcut expression for the method that perform
64     * the load-balancing (others perform local calls)
65     * @param hostName the host where the proxy load-balances
66     * @param replicaExpr a regular expression that matches all the
67     * hosts of the topology where the replicas are located
68     *
69     * @see #addRandomLoadBalancer(String,String,String,String) */

70     
71
72    void addRoundTripLoadBalancer( String JavaDoc wrappeeName,
73                                   String JavaDoc methods,
74                                   String JavaDoc hostName,
75                                   String JavaDoc replicaExpr );
76    
77    /**
78     * This configuration method allows the user to define a random
79     * load-balancer on a replication group.
80     *
81     * <p>It follows the same principles as a round-trip balancer but
82     * picks up the next replica to use randomly.
83     *
84     * @see #addRoundTripLoadBalancer(String,String,String,String) */

85
86    void addRandomLoadBalancer( String JavaDoc wrappeeName,
87                                String JavaDoc methods,
88                                String JavaDoc hostName,
89                                String JavaDoc replicaExpr );
90
91 }
92
93
94
95
96
97
98
Popular Tags