/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.ha.framework.server; import java.net.InetAddress; import java.util.Vector; import javax.management.ObjectName; import org.jboss.ha.framework.interfaces.HAPartition; import org.jboss.mx.util.ObjectNameFactory; import org.jgroups.jmx.JChannelFactoryMBean; import org.w3c.dom.Element; /** * Management Bean for Cluster HAPartitions. It will start a JGroups * channel and initialize the ReplicantManager and DistributedStateService. * * @author Bill Burke. * @author Sacha Labourey. * @version $Revision: 60110 $ * *
Revisions:
*/
public interface ClusterPartitionMBean
extends org.jboss.system.ServiceMBean
{
ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss:service=ClusterPartition");
/**
* Name of the partition being built. All nodes/services belonging to
* a partition with the same name are clustered together.
*/
String getPartitionName();
void setPartitionName(String newName);
/**
* Get JGroups property string a la JDBC
* see JGroups web site for more information
*
* @return the protocol stack used by this ClusterPartition, or null
* if the {@link #setMultiplexer(JChannelFactoryMBean) multiplexer} is
* configured but the channel has not been created yet.
*/
String getPartitionProperties(); // i.e. JGroups properties
void setPartitionProperties(String newProps);
/** A write-only attribute that allows for an xml specification of the
*PartitionProperties string. For example, a string like:
UDP(mcast_addr=228.1.2.3):PING(timeout=2000):MERGE2(min_interval=5000;max_interval=10000):FD"
* would be specified in xml as:
null
if
* one isn't configured
*/
JChannelFactoryMBean getMultiplexer();
/**
* Sets the multiplexer channel factory that should be used to
* create the JGroups channel. If this and a
* {@link #setMultiplexerStack() multiplexer stack name} are set,
* the channel will come from the multiplexer and properties
* {@link #setPartitionConfig(Element) partitionConfig} and
* {@link #setPartitionProperties(String) partitionProperties} will be
* ingored.
*/
void setMultiplexer(JChannelFactoryMBean muxFactory);
/**
* Gets the name of the protocol stack the multiplexer channel factory
* should use to create the JGroups channel.
*
* @return the stack name, or null
*/
String getMultiplexerStack();
/**
* Sets the name of the protocol stack the multiplexer channel factory
* should use to create the JGroups channel. If this and a
* {@link #setMultiplexer() multiplexed channel factory} are set,
* the channel will come from the multiplexer and properties
* {@link #setPartitionConfig(Element) partitionConfig} and
* {@link #setPartitionProperties(String) partitionProperties} will be
* ingored.
*
* @param stackName the name of one of the protocols stacks included
* in the multiplexed channel factor's configuration
*/
void setMultiplexerStack(String stackName);
// boolean getChannelDebugger();
// void setChannelDebugger(boolean flag);
/**
* Determine if deadlock detection is enabled
*/
boolean getDeadlockDetection();
void setDeadlockDetection(boolean doit);
/**
* Returns whether this partition will synchronously notify any
* HAPartition.HAMembershipListener of membership changes using the
* calling thread from the underlying group communications layer
* (e.g. JGroups).
*
* @return true
if registered listeners that don't implement
* AsynchHAMembershipExtendedListener
or
* AsynchHAMembershipListener
will be notified
* synchronously of membership changes; false
if
* those listeners will be notified asynchronously. Default
* is false
.
*/
public boolean getAllowSynchronousMembershipNotifications();
/**
* Sets whether this partition will synchronously notify any
* HAPartition.HAMembershipListener of membership changes using the
* calling thread from the underlying group communications layer
* (e.g. JGroups).
*
* @param allowSync true
if registered listeners that don't
* implement AsynchHAMembershipExtendedListener
or
* AsynchHAMembershipListener
should be notified
* synchronously of membership changes; false
if
* those listeners can be notified asynchronously. Default
* is false
.
*/
public void setAllowSynchronousMembershipNotifications(boolean allowSync);
/** Access to the underlying HAPartition without going through JNDI
*
* @return the HAPartition for the cluster service
*/
HAPartition getHAPartition ();
/** Return the list of member nodes that built from the current view
* @return A Vector Strings representing the host:port values of the nodes
*/
Vector getCurrentView();
String showHistory ();
String showHistoryAsXML ();
void startChannelDebugger();
void startChannelDebugger(boolean accumulative);
void stopChannelDebugger();
}