01: package org.jgroups.jmx;
02:
03: import org.jgroups.stack.ProtocolObserver;
04:
05: import java.util.Properties;
06: import java.util.Map;
07:
08: /**
09: * @author Bela Ban
10: * @version $Id: Protocol.java,v 1.8.10.1 2007/04/27 08:03:50 belaban Exp $
11: */
12: public class Protocol implements ProtocolMBean {
13: org.jgroups.stack.Protocol prot;
14:
15: public Protocol() {
16:
17: }
18:
19: public Protocol(org.jgroups.stack.Protocol p) {
20: this .prot = p;
21: }
22:
23: public String getName() {
24: return prot.getName();
25: }
26:
27: public void attachProtocol(org.jgroups.stack.Protocol p) {
28: this .prot = p;
29: }
30:
31: public String getPropertiesAsString() {
32: return prot.getProperties().toString();
33: }
34:
35: public void setProperties(Properties p) {
36: prot.setProperties(p);
37: }
38:
39: public boolean getStatsEnabled() {
40: return prot.statsEnabled();
41: }
42:
43: public void setStatsEnabled(boolean flag) {
44: prot.enableStats(flag);
45: }
46:
47: public void resetStats() {
48: prot.resetStats();
49: }
50:
51: public String printStats() {
52: return prot.printStats();
53: }
54:
55: public Map dumpStats() {
56: return prot.dumpStats();
57: }
58:
59: public boolean getUpThread() {
60: return prot.upThreadEnabled();
61: }
62:
63: public boolean getDownThread() {
64: return prot.downThreadEnabled();
65: }
66:
67: public void setObserver(ProtocolObserver observer) {
68: prot.setObserver(observer);
69: }
70:
71: public void create() throws Exception {
72: prot.init();
73: }
74:
75: public void start() throws Exception {
76: prot.start();
77: }
78:
79: public void stop() {
80: prot.stop();
81: }
82:
83: public void destroy() {
84: prot.destroy();
85: }
86: }
|