Update of /cvsroot/ejtools/libraries/common/src/main/org/ejtools/jmx
In directory sc8-pr-cvs1:/tmp/cvs-serv7476/common/src/main/org/ejtools/jmx
Added Files:
MBeanSorter.java
Log Message:
Address Todo #800900 : PNG Export
Address Bug #808973 : Sort MBean informations
Address RFE #848285 : CSV Export
Remove @created tags
--- NEW FILE: MBeanSorter.java ---
/*
* EJTools, the Enterprise Java Tools
*
* Distributable under LGPL license.
* See terms of license at www.gnu.org.
*/
package org.ejtools.jmx;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import javax.management.MBeanFeatureInfo;
/**
* A utility class for sorting attributes of MBean
*
* @author Laurent Etiemble
* @version $Revision: 1.1 $
*/
public class MBeanSorter
{
/**
* Sort features info by their name
*
* @param infos Features to sort
*/
public static void sortByName(List infos)
{
Collections.sort(infos,
new Comparator()
{
public int compare(Object o1, Object o2)
{
MBeanFeatureInfo mbfi1 = (MBeanFeatureInfo) o1;
MBeanFeatureInfo mbfi2 = (MBeanFeatureInfo) o2;
return mbfi1.getName().compareTo(mbfi2.getName());
}
public boolean equals(Object obj)
{
// Never called ?
return false;
}
});
}
}
|