/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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 General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import javax.management.*;
@SuppressWarnings("serial")
static {
if (keyPropertyList == null) {
} else {
while (st.hasMoreTokens()) {
}
}
}
}
super(root, true);
setRootVisible(false);
setShowsRootHandles(true);
}
/**
* This method removes the node from its parent
*/
// Call on EDT
}
/**
* This method adds the child to the specified parent node
* at specific index.
*/
// Call on EDT
private synchronized void addChildNode(
int index) {
}
/**
* This method adds the child to the specified parent node.
* The index where the child is to be added depends on the
* child node being Comparable or not. If the child node is
* not Comparable then it is added at the end, i.e. right
* after the current parent's children.
*/
// Call on EDT
private synchronized void addChildNode(
if (childCount == 0) {
return;
}
if (child instanceof ComparableDefaultMutableTreeNode) {
// expr1: child node must be inserted after metadata nodes
// - OR -
// expr2: "child >= brother"
return;
}
}
// "child < all brothers", add at the beginning
return;
}
// "child not comparable", add at the end
}
/**
* This method removes all the displayed nodes from the tree,
* but does not affect actual MBeanServer contents.
*/
// Call on EDT
public synchronized void removeAll() {
}
// Call on EDT
// We assume here that MBeans are removed one by one (on MBean
// unregistered notification). Deletes the tree node associated
// with the given MBean and recursively all the node parents
// which are leaves and non XMBean.
//
if (hasNonMetadataNodes(node)) {
} else {
}
}
}
}
/**
* Returns true if any of the children nodes is a non MBean metadata node.
*/
case ATTRIBUTES:
case NOTIFICATIONS:
case OPERATIONS:
break;
default:
return true;
}
} else {
return true;
}
}
return false;
}
/**
* Returns true if any of the children nodes is an MBean metadata node.
*/
case ATTRIBUTES:
case NOTIFICATIONS:
case OPERATIONS:
return true;
default:
break;
}
} else {
return false;
}
}
return false;
}
/**
* Returns true if the given node is an MBean metadata node.
*/
case ATTRIBUTES:
case NOTIFICATIONS:
case OPERATIONS:
return true;
default:
return false;
}
} else {
return false;
}
}
/**
* Remove the metadata nodes associated with a given MBean node.
*/
// Call on EDT
new HashSet<DefaultMutableTreeNode>();
case ATTRIBUTES:
case NOTIFICATIONS:
case OPERATIONS:
metadataNodes.add(n);
break;
default:
break;
}
}
}
for (DefaultMutableTreeNode n : metadataNodes) {
}
}
/**
* Removes only the parent nodes which are non MBean and leaf.
* This method assumes the child nodes have been removed before.
*/
// Call on EDT
}
return node;
}
// Call on EDT
}
}
}
// Call on EDT
// Build XMBean for the given MBean
//
// Build Dn for the given MBean
//
// Add the new nodes to the MBean tree from leaf to root
//
}
// Call on EDT
private synchronized void addMBeanToView(
// Add the node or replace its user object if already added
//
// Found existing node previously created when adding another node
//
// Replace user object to reflect that this node is an MBean
//
return;
}
// Create new leaf node
//
// Add intermediate non MBean nodes
//
// Intermediate node already present, add new node as child
//
return;
} else {
// Create new intermediate node
//
} else {
}
}
}
}
// Call on EDT
private synchronized void changeNodeValue(
if (node instanceof ComparableDefaultMutableTreeNode) {
// should it stay at the same place?
// the order in the tree didn't change
} else {
// delete the node and re-order it in case the
// node value modifies the order in the tree
}
} else {
// not comparable stays at the same place
}
// Load the MBean metadata if type is MBEAN
if (isExpanded(path)) {
}
}
// Clear the current selection and set it
// again so valueChanged() gets called
if (node == getLastSelectedPathComponent()) {
}
}
/**
* Creates the domain node.
*/
return node;
}
/**
* Creates the node corresponding to the whole Dn, i.e. an MBean.
*/
return node;
}
/**
* Creates the node corresponding to a subDn, i.e. a non-MBean
* intermediate node.
*/
return node;
}
return xmbean;
}
/**
* Parses the MBean ObjectName comma-separated properties string and puts
* string is preserved by the map.
*/
while (eq != -1) {
}
}
return map;
}
/**
* Returns the ordered key property list that will be used to build the
* MBean tree. If the "com.sun.tools.jconsole.mbeans.keyPropertyList" system
* property is not specified, then the ordered key property list used
* to build the MBean tree will be the one returned by the method
* ObjectName.getKeyPropertyListString() with "type" as first key,
* and "j2eeType" as second key, if present. If any of the keys specified
* in the comma-separated key property list does not apply to the given
* MBean then it will be discarded.
*/
// key order defined by the "orderedKeyPropertyList"
}
}
}
return orderedKeyPropertyListString;
}
// Call on EDT
}
}
private static class MBeanInfoNodesSwingWorker
public MBeanInfoNodesSwingWorker(
}
// Retrieve MBeanInfo for this MBean
// Check if this MBean is a notification emitter
return result;
}
protected void done() {
try {
}
} catch (Exception e) {
t.printStackTrace();
}
}
}
// Call on EDT
private void addMBeanInfoNodes(
// Insert the Attributes/Operations/Notifications metadata nodes as
// the three first children of this MBean node. This is only useful
// when this MBean node denotes an MBean but it's not a leaf in the
// MBean tree
//
int childIndex = 0;
// MBeanAttributeInfo node
//
attribute.setAllowsChildren(false);
}
}
// MBeanOperationInfo node
//
// Compute the operation's tool tip text:
// "operationname(param1type,param2type,...)"
//
}
// Remove the trailing ','
//
}
// Create operation node
//
operation.setAllowsChildren(false);
}
}
// MBeanNotificationInfo node
//
new DefaultMutableTreeNode();
notification.setAllowsChildren(false);
}
}
}
// Update tree model
//
}
}
//
// Tree preferences
//
private static boolean treeView;
private static boolean treeViewInit = false;
private static boolean isTreeView() {
if (!treeViewInit) {
treeView = getTreeViewValue();
treeViewInit = true;
}
return treeView;
}
private static boolean getTreeViewValue() {
}
//
// MBean key-value preferences
//
private boolean isKeyValueView() {
return keyValueView;
}
//
// Utility classes
//
private static class ComparableDefaultMutableTreeNode
extends DefaultMutableTreeNode
implements Comparable<DefaultMutableTreeNode> {
}
}
if (isTreeView()) {
// Tree view
}
} else {
// Flat view
}
// Add the domain as the first token in the Dn
// Reverse the Dn (from leaf to root)
// Compute hash for Dn
}
return mbean;
}
return domain;
}
return keyPropertyList;
}
}
public int getTokenCount() {
}
return hashDn;
}
}
private void computeHashDn() {
return;
}
}
}
}
}
}
private static class Token {
this.tokenValue = tokenValue;
}
return tokenType;
}
return tokenValue;
}
return key;
}
return value;
}
private void buildKeyValue() {
if (index < 0) {
key = tokenValue;
value = tokenValue;
} else {
}
}
}
}