001: package org.jgroups.jmx;
002:
003: import org.jgroups.*;
004: import org.w3c.dom.Element;
005:
006: import java.io.Serializable;
007: import java.util.Map;
008:
009: /**
010: * @author Bela Ban
011: * @version $Id: JChannelMBean.java,v 1.10 2006/04/28 15:39:41 belaban Exp $
012: */
013: public interface JChannelMBean {
014: void create() throws Exception;
015:
016: void start() throws Exception;
017:
018: void stop();
019:
020: void destroy();
021:
022: //void jbossInternalLifecycle(String method) throws Exception;
023: org.jgroups.JChannel getChannel();
024:
025: String getProperties();
026:
027: void setProperties(String props);
028:
029: String getVersion();
030:
031: String getObjectName();
032:
033: void setObjectName(String name);
034:
035: int getNumberOfTasksInTimer();
036:
037: String dumpTimerQueue();
038:
039: /** To configure via XML file */
040: void setClusterConfig(Element el);
041:
042: String getGroupName();
043:
044: void setGroupName(String group_name);
045:
046: String getClusterName();
047:
048: void setClusterName(String cluster_name);
049:
050: boolean getReceiveBlockEvents();
051:
052: void setReceiveBlockEvents(boolean flag);
053:
054: boolean getReceiveLocalMessages();
055:
056: void setReceiveLocalMessages(boolean flag);
057:
058: boolean getAutoReconnect();
059:
060: void setAutoReconnect(boolean flag);
061:
062: boolean getAutoGetState();
063:
064: void setAutoGetState(boolean flag);
065:
066: Map dumpStats();
067:
068: View getView();
069:
070: String getViewAsString();
071:
072: Address getLocalAddress();
073:
074: String getLocalAddressAsString();
075:
076: void setChannelListener(ChannelListener channel_listener);
077:
078: boolean getStatsEnabled();
079:
080: void setStatsEnabled(boolean flag);
081:
082: void resetStats();
083:
084: long getSentMessages();
085:
086: long getSentBytes();
087:
088: long getReceivedMessages();
089:
090: long getReceivedBytes();
091:
092: boolean isOpen();
093:
094: boolean isConnected();
095:
096: int getNumMessages();
097:
098: String dumpQueue();
099:
100: String printProtocolSpec(boolean include_properties);
101:
102: String toString(boolean print_details);
103:
104: void connect(String channel_name) throws ChannelException,
105: ChannelClosedException;
106:
107: void disconnect();
108:
109: void close();
110:
111: void shutdown();
112:
113: void send(Message msg) throws ChannelNotConnectedException,
114: ChannelClosedException;
115:
116: void send(Address dst, Address src, Serializable obj)
117: throws ChannelNotConnectedException, ChannelClosedException;
118:
119: void sendToAll(String msg) throws ChannelNotConnectedException,
120: ChannelClosedException;
121:
122: /** @param evt
123: * @deprecated */
124: void down(Event evt);
125:
126: Object receive(long timeout) throws ChannelNotConnectedException,
127: ChannelClosedException, TimeoutException;
128:
129: Object peek(long timeout) throws ChannelNotConnectedException,
130: ChannelClosedException, TimeoutException;
131:
132: void blockOk();
133:
134: boolean getState(Address target, long timeout)
135: throws ChannelNotConnectedException, ChannelClosedException;
136:
137: void returnState(byte[] state);
138:
139: void returnState(byte[] state, String state_id);
140: }
|