|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| MBeanSorter.java | - | 0% | 0% | 0% |
|
||||||||||||||
| 1 |
/*
|
|
| 2 |
* EJTools, the Enterprise Java Tools
|
|
| 3 |
*
|
|
| 4 |
* Distributable under LGPL license.
|
|
| 5 |
* See terms of license at www.gnu.org.
|
|
| 6 |
*/
|
|
| 7 |
package org.ejtools.jmx;
|
|
| 8 |
|
|
| 9 |
import java.util.Collections;
|
|
| 10 |
import java.util.Comparator;
|
|
| 11 |
import java.util.List;
|
|
| 12 |
|
|
| 13 |
import javax.management.MBeanFeatureInfo;
|
|
| 14 |
|
|
| 15 |
/**
|
|
| 16 |
* A utility class for sorting attributes of MBean
|
|
| 17 |
*
|
|
| 18 |
* @author Laurent Etiemble
|
|
| 19 |
* @version $Revision: 1.1 $
|
|
| 20 |
*/
|
|
| 21 |
public class MBeanSorter |
|
| 22 |
{
|
|
| 23 |
/**
|
|
| 24 |
* Sort features info by their name
|
|
| 25 |
*
|
|
| 26 |
* @param infos Features to sort
|
|
| 27 |
*/
|
|
| 28 | 0 |
public static void sortByName(List infos) |
| 29 |
{
|
|
| 30 | 0 |
Collections.sort(infos, |
| 31 |
new Comparator()
|
|
| 32 |
{
|
|
| 33 | 0 |
public int compare(Object o1, Object o2) |
| 34 |
{
|
|
| 35 | 0 |
MBeanFeatureInfo mbfi1 = (MBeanFeatureInfo) o1; |
| 36 | 0 |
MBeanFeatureInfo mbfi2 = (MBeanFeatureInfo) o2; |
| 37 |
|
|
| 38 | 0 |
return mbfi1.getName().compareTo(mbfi2.getName());
|
| 39 |
} |
|
| 40 |
|
|
| 41 |
|
|
| 42 | 0 |
public boolean equals(Object obj) |
| 43 |
{
|
|
| 44 |
// Never called ?
|
|
| 45 | 0 |
return false; |
| 46 |
} |
|
| 47 |
}); |
|
| 48 |
} |
|
| 49 |
} |
|
| 50 |
|
|
||||||||||