1 22 package org.jboss.test.mx.mxbean.support; 23 24 import java.util.Collection ; 25 import java.util.List ; 26 import java.util.Map ; 27 import java.util.Set ; 28 29 import javax.management.openmbean.ArrayType ; 30 import javax.management.openmbean.OpenType ; 31 import javax.management.openmbean.SimpleType ; 32 33 import org.jboss.mx.mxbean.MXBeanUtils; 34 35 41 public interface CollectionsInterface 42 { 43 String ARRAY = "array"; 44 String COLLECTION = "collection"; 45 String SET = "set"; 46 String LIST = "list"; 47 String MAP = "map"; 48 String ENUM = "enum"; 49 50 String [] KEYS = 51 { 52 ARRAY, 53 COLLECTION, 54 SET, 55 LIST, 56 MAP, 57 ENUM 58 }; 59 60 OpenType [] TYPES = Initializer._TYPES; 61 62 String [] getArray(); 63 64 Collection <String > getCollection(); 65 66 Set <String > getSet(); 67 68 List <String > getList(); 69 70 Map <String , Integer > getMap(); 71 72 TestEnum getEnum(); 73 74 public static class Initializer 75 { 76 static OpenType [] _TYPES; 77 78 static 79 { 80 try 81 { 82 _TYPES = new OpenType [] 83 { 84 new ArrayType (1, SimpleType.STRING), 85 new ArrayType (1, SimpleType.STRING), 86 new ArrayType (1, SimpleType.STRING), 87 new ArrayType (1, SimpleType.STRING), 88 MXBeanUtils.createMapType(String .class, Integer .class), 89 SimpleType.STRING 90 }; 91 } 92 catch (Exception e) 93 { 94 throw new RuntimeException (e); 95 } 96 } 97 } 98 } 99 | Popular Tags |