01: package org.jgroups.jmx;
02:
03: import org.jgroups.Channel;
04:
05: import javax.management.MBeanServer;
06:
07: /**
08: * @author Bela Ban
09: * @version $Id: JChannelFactory.java,v 1.4 2006/05/02 11:06:00 belaban Exp $
10: */
11: public class JChannelFactory implements JChannelFactoryMBean {
12: org.jgroups.JChannelFactory factory = new org.jgroups.JChannelFactory();
13: MBeanServer server = null;
14:
15: public JChannelFactory(org.jgroups.JChannelFactory factory) {
16: this .factory = factory;
17: }
18:
19: public JChannelFactory() {
20: }
21:
22: public void setMultiplexerConfig(String properties)
23: throws Exception {
24: factory.setMultiplexerConfig(properties);
25: }
26:
27: public String getMultiplexerConfig() {
28: return factory.getMultiplexerConfig();
29: }
30:
31: public String getDomain() {
32: return factory.getDomain();
33: }
34:
35: public void setDomain(String name) {
36: factory.setDomain(name);
37: }
38:
39: public boolean isExposeChannels() {
40: return factory.isExposeChannels();
41: }
42:
43: public void setExposeChannels(boolean flag) {
44: factory.setExposeChannels(flag);
45: }
46:
47: public boolean isExposeProtocols() {
48: return factory.isExposeProtocols();
49: }
50:
51: public void setExposeProtocols(boolean f) {
52: factory.setExposeProtocols(f);
53: }
54:
55: public Channel createMultiplexerChannel(String stack_name, String id)
56: throws Exception {
57: return factory.createMultiplexerChannel(stack_name, id);
58: }
59:
60: public Channel createMultiplexerChannel(String stack_name,
61: String id, boolean register_for_state_transfer,
62: String substate_id) throws Exception {
63: return factory.createMultiplexerChannel(stack_name, id,
64: register_for_state_transfer, substate_id);
65: }
66:
67: public void create() throws Exception {
68: if (factory == null)
69: factory = new org.jgroups.JChannelFactory();
70: factory.create();
71: }
72:
73: public void start() throws Exception {
74: factory.start();
75: }
76:
77: public void stop() {
78: factory.stop();
79: }
80:
81: public void destroy() {
82: factory.destroy();
83: factory = null;
84: }
85:
86: public String dumpConfiguration() {
87: return factory.dumpConfiguration();
88: }
89:
90: public String dumpChannels() {
91: return factory.dumpChannels();
92: }
93: }
|