KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > continuent > sequoia > controller > loadbalancer > LoadBalancerControl


1 /**
2  * Sequoia: Database clustering technology.
3  * Copyright (C) 2006 Emic Networks.
4  * Contact: sequoia@continuent.org
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * Initial developer(s): Jeff Mesnil.
19  * Contributor(s): ______________________.
20  */

21
22 package org.continuent.sequoia.controller.loadbalancer;
23
24 import javax.management.NotCompliantMBeanException JavaDoc;
25
26 import org.continuent.sequoia.common.jmx.mbeans.LoadBalancerControlMBean;
27 import org.continuent.sequoia.controller.jmx.AbstractStandardMBean;
28
29 /**
30  * LoadBalancerControlMBean implemementation.<br />
31  * Used to manage a AbstractLoadBalancer.
32  *
33  * @see org.continuent.sequoia.controller.loadbalancer.AbstractLoadBalancer
34  */

35 public class LoadBalancerControl extends AbstractStandardMBean
36     implements
37       LoadBalancerControlMBean
38 {
39
40   private AbstractLoadBalancer managedLoadBalancer;
41
42   /**
43    * Creates a new <code>LoadBalancerControl</code> object
44    *
45    * @param managedLoadBalancer the managed load balancer
46    * @throws NotCompliantMBeanException if this mbean is not compliant
47    */

48   public LoadBalancerControl(AbstractLoadBalancer managedLoadBalancer)
49       throws NotCompliantMBeanException JavaDoc
50   {
51     super(LoadBalancerControlMBean.class);
52     this.managedLoadBalancer = managedLoadBalancer;
53   }
54
55   /**
56    * @see org.continuent.sequoia.common.jmx.mbeans.LoadBalancerControlMBean#getRAIDbLevel()
57    */

58   public int getRAIDbLevel()
59   {
60     return managedLoadBalancer.getRAIDbLevel();
61   }
62
63   /**
64    * @see org.continuent.sequoia.common.jmx.mbeans.LoadBalancerControlMBean#getParsingGranularity()
65    */

66   public int getParsingGranularity()
67   {
68     return managedLoadBalancer.getParsingGranularity();
69   }
70
71   /**
72    * @see org.continuent.sequoia.common.jmx.mbeans.LoadBalancerControlMBean#getInformation()
73    */

74   public String JavaDoc getInformation()
75   {
76     return managedLoadBalancer.getInformation();
77   }
78
79   /**
80    * @see org.continuent.sequoia.controller.jmx.AbstractStandardMBean#getAssociatedString()
81    */

82   public String JavaDoc getAssociatedString()
83   {
84     return "loadbalancer"; //$NON-NLS-1$
85
}
86 }
87
Popular Tags