01: /**
02: * Sequoia: Database clustering technology.
03: * Copyright (C) 2006 Emic Networks.
04: * Contact: sequoia@continuent.org
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
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: */package org.continuent.sequoia.controller.loadbalancer;
21:
22: import javax.management.NotCompliantMBeanException;
23:
24: import org.continuent.sequoia.common.jmx.mbeans.LoadBalancerControlMBean;
25: import org.continuent.sequoia.controller.jmx.AbstractStandardMBean;
26:
27: /**
28: * LoadBalancerControlMBean implemementation.<br />
29: * Used to manage a AbstractLoadBalancer.
30: *
31: * @see org.continuent.sequoia.controller.loadbalancer.AbstractLoadBalancer
32: */
33: public class LoadBalancerControl extends AbstractStandardMBean
34: implements LoadBalancerControlMBean {
35:
36: private AbstractLoadBalancer managedLoadBalancer;
37:
38: /**
39: * Creates a new <code>LoadBalancerControl</code> object
40: *
41: * @param managedLoadBalancer the managed load balancer
42: * @throws NotCompliantMBeanException if this mbean is not compliant
43: */
44: public LoadBalancerControl(AbstractLoadBalancer managedLoadBalancer)
45: throws NotCompliantMBeanException {
46: super (LoadBalancerControlMBean.class);
47: this .managedLoadBalancer = managedLoadBalancer;
48: }
49:
50: /**
51: * @see org.continuent.sequoia.common.jmx.mbeans.LoadBalancerControlMBean#getRAIDbLevel()
52: */
53: public int getRAIDbLevel() {
54: return managedLoadBalancer.getRAIDbLevel();
55: }
56:
57: /**
58: * @see org.continuent.sequoia.common.jmx.mbeans.LoadBalancerControlMBean#getParsingGranularity()
59: */
60: public int getParsingGranularity() {
61: return managedLoadBalancer.getParsingGranularity();
62: }
63:
64: /**
65: * @see org.continuent.sequoia.common.jmx.mbeans.LoadBalancerControlMBean#getInformation()
66: */
67: public String getInformation() {
68: return managedLoadBalancer.getInformation();
69: }
70:
71: /**
72: * @see org.continuent.sequoia.controller.jmx.AbstractStandardMBean#getAssociatedString()
73: */
74: public String getAssociatedString() {
75: return "loadbalancer"; //$NON-NLS-1$
76: }
77: }
|