KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.jgroups.jmx;
2
3 import org.jgroups.Channel;
4
5 import javax.management.MBeanServer JavaDoc;
6
7 /**
8  * @author Bela Ban
9  * @version $Id: JChannelFactory.java,v 1.5 2007/05/09 23:50:19 belaban Exp $
10  */

11 public class JChannelFactory implements JChannelFactoryMBean {
12     org.jgroups.JChannelFactory factory=new org.jgroups.JChannelFactory();
13
14
15     public JChannelFactory(org.jgroups.JChannelFactory factory) {
16         this.factory=factory;
17     }
18
19     public JChannelFactory() {
20     }
21
22     public void setMultiplexerConfig(String JavaDoc properties) throws Exception JavaDoc {
23         factory.setMultiplexerConfig(properties);
24     }
25
26     public String JavaDoc getMultiplexerConfig() {
27         return factory.getMultiplexerConfig();
28     }
29
30     public String JavaDoc getDomain() {
31         return factory.getDomain();
32     }
33
34     public void setDomain(String JavaDoc name) {
35         factory.setDomain(name);
36     }
37
38     public boolean isExposeChannels() {
39         return factory.isExposeChannels();
40     }
41
42     public void setExposeChannels(boolean flag) {
43         factory.setExposeChannels(flag);
44     }
45
46     public boolean isExposeProtocols() {
47         return factory.isExposeProtocols();
48     }
49
50     public void setExposeProtocols(boolean f) {
51         factory.setExposeProtocols(f);
52     }
53
54
55     public Channel createMultiplexerChannel(String JavaDoc stack_name, String JavaDoc id) throws Exception JavaDoc {
56         return factory.createMultiplexerChannel(stack_name, id);
57     }
58
59     public Channel createMultiplexerChannel(String JavaDoc stack_name, String JavaDoc id, boolean register_for_state_transfer, String JavaDoc substate_id) throws Exception JavaDoc {
60         return factory.createMultiplexerChannel(stack_name, id, register_for_state_transfer, substate_id);
61     }
62
63     public void create() throws Exception JavaDoc {
64         if(factory == null)
65             factory=new org.jgroups.JChannelFactory();
66         factory.create();
67     }
68
69     public void start() throws Exception JavaDoc {
70         factory.start();
71     }
72
73     public void stop() {
74         factory.stop();
75     }
76
77     public void destroy() {
78         factory.destroy();
79         factory=null;
80     }
81
82     public String JavaDoc dumpConfiguration() {
83         return factory.dumpConfiguration();
84     }
85
86     public String JavaDoc dumpChannels() {
87         return factory.dumpChannels();
88     }
89 }
90
Popular Tags