KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ha > framework > server > ClusterPartitionMBean


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.ha.framework.server;
23
24 import java.net.InetAddress JavaDoc;
25 import java.util.Vector JavaDoc;
26
27 import javax.management.ObjectName JavaDoc;
28
29 import org.jboss.cache.Cache;
30 import org.jboss.ha.framework.interfaces.DistributedState;
31 import org.jboss.ha.framework.interfaces.HAPartition;
32 import org.jboss.mx.util.ObjectNameFactory;
33 import org.jgroups.jmx.JChannelFactoryMBean;
34
35 /**
36  * Management Bean for Cluster HAPartitions. It will start a JGroups
37  * channel and initialize the ReplicantManager and DistributedStateService.
38  *
39  * @author <a HREF="mailto:bill@burkecentral.com">Bill Burke</a>.
40  * @author <a HREF="mailto:sacha.labourey@cogito-info.ch">Sacha Labourey</a>.
41  * @version $Revision: 58566 $
42  *
43  * <p><b>Revisions:</b><br>
44  */

45
46 public interface ClusterPartitionMBean
47    extends org.jboss.system.ServiceMBean
48 {
49    ObjectName JavaDoc OBJECT_NAME = ObjectNameFactory.create("jboss:service=ClusterPartition");
50
51    /**
52     * Name of the partition being built. All nodes/services belonging to
53     * a partition with the same name are clustered together.
54     */

55    String JavaDoc getPartitionName();
56
57    /**
58     * Uniquely identifies this node. MUST be unique accros the whole cluster!
59     * Cannot be changed once the partition has been started (otherwise an exception is thrown)
60     */

61    String JavaDoc getNodeUniqueId();
62    
63    /**
64     * The node address used to generate the node name
65     */

66    InetAddress JavaDoc getNodeAddress();
67    
68    /** The version of JGroups this is running on */
69    String JavaDoc getJGroupsVersion();
70
71    /* Number of milliseconds to wait until state has been transferred. Increase this value for large states
72       0 = wait forever */

73    long getStateTransferTimeout();
74
75    void setStateTransferTimeout(long timeout);
76
77    /** Max time (in ms) to wait for <em>synchronous</em> group method calls
78     * ({@link HAPartition#callMethodOnCluster(String, String, Object[], Class[], boolean)}) */

79    long getMethodCallTimeout();
80
81    void setMethodCallTimeout(long timeout);
82
83
84 // boolean getChannelDebugger();
85
// void setChannelDebugger(boolean flag);
86

87
88    /**
89     * Determine if deadlock detection is enabled
90     */

91    boolean getDeadlockDetection();
92    
93    /**
94     * Returns whether this partition will synchronously notify any
95     * HAPartition.HAMembershipListener of membership changes using the
96     * calling thread from the underlying group communications layer
97     * (e.g. JGroups).
98     *
99     * @return <code>true</code> if registered listeners that don't implement
100     * <code>AsynchHAMembershipExtendedListener</code> or
101     * <code>AsynchHAMembershipListener</code> will be notified
102     * synchronously of membership changes; <code>false</code> if
103     * those listeners will be notified asynchronously. Default
104     * is <code>false</code>.
105     */

106    public boolean getAllowSynchronousMembershipNotifications();
107    /**
108     * Sets whether this partition will synchronously notify any
109     * HAPartition.HAMembershipListener of membership changes using the
110     * calling thread from the underlying group communications layer
111     * (e.g. JGroups).
112     *
113     * @param allowSync <code>true</code> if registered listeners that don't
114     * implement <code>AsynchHAMembershipExtendedListener</code> or
115     * <code>AsynchHAMembershipListener</code> should be notified
116     * synchronously of membership changes; <code>false</code> if
117     * those listeners can be notified asynchronously. Default
118     * is <code>false</code>.
119     */

120    public void setAllowSynchronousMembershipNotifications(boolean allowSync);
121
122    /** Access to the underlying HAPartition without going through JNDI
123     *
124     * @return the HAPartition for the cluster service
125     */

126    HAPartition getHAPartition ();
127    
128    /**
129     * Access to the DistributedState implementation
130     */

131    DistributedState getDistributedStateService();
132    
133    /**
134     * Gets the TreeCache used by this partition for state management.
135     */

136    Cache getClusteredCache();
137    
138    /**
139     * Gets the JGroups multiplexer channel factory used by ClusterPartition.
140     */

141    JChannelFactoryMBean getMultiplexer();
142    
143    /**
144     * Used with multiplexer injection, specifies stack to be used (e.g., fc-fast-minimalthreads)
145     * This attribute is optional; if not provided, a default multiplexer stack will be used.
146     */

147    String JavaDoc getMultiplexerStack();
148
149    /** Return the list of member nodes that built from the current view
150     * @return A Vector Strings representing the host:port values of the nodes
151     */

152    Vector JavaDoc getCurrentView();
153
154    String JavaDoc showHistory ();
155
156    String JavaDoc showHistoryAsXML ();
157
158    void startChannelDebugger();
159    void startChannelDebugger(boolean accumulative);
160    void stopChannelDebugger();
161
162 }
163
Popular Tags