KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgroups > jmx > Protocol


1 package org.jgroups.jmx;
2
3
4 import java.util.Properties JavaDoc;
5 import java.util.Map JavaDoc;
6
7 /**
8  * @author Bela Ban
9  * @version $Id: Protocol.java,v 1.12 2007/04/27 07:59:24 belaban Exp $
10  */

11 public class Protocol implements ProtocolMBean {
12     org.jgroups.stack.Protocol prot;
13
14     public Protocol() {
15
16     }
17
18     public Protocol(org.jgroups.stack.Protocol p) {
19         this.prot=p;
20     }
21
22     public String JavaDoc getName() {
23         return prot.getName();
24     }
25
26     public void attachProtocol(org.jgroups.stack.Protocol p) {
27         this.prot=p;
28     }
29
30     public String JavaDoc getPropertiesAsString() {
31         return prot.getProperties().toString();
32     }
33
34     public void setProperties(Properties JavaDoc p) {
35         prot.setProperties(p);
36     }
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 JavaDoc printStats() {
52         return prot.printStats();
53     }
54
55     public Map JavaDoc dumpStats() {
56         return prot.dumpStats();
57     }
58
59     public void create() throws Exception JavaDoc {
60         prot.init();
61     }
62
63     public void start() throws Exception JavaDoc {
64         prot.start();
65     }
66
67     public void stop() {
68         prot.stop();
69     }
70
71     public void destroy() {
72         prot.destroy();
73     }
74 }
75
Popular Tags