1 23 24 29 30 package com.sun.appserv.management.base; 31 32 import com.sun.appserv.management.j2ee.J2EETypesMapper; 33 34 35 41 public final class AllTypesMapper extends TypesMapper 42 { 43 private static AllTypesMapper INSTANCE = null; 44 45 46 49 public static synchronized AllTypesMapper 50 getInstance() 51 { 52 if ( INSTANCE == null ) 53 { 54 INSTANCE = new AllTypesMapper(); 55 } 56 57 return( INSTANCE ); 58 } 59 60 private 61 AllTypesMapper() 62 { 63 super( new Class [ 0 ] ); 64 } 65 66 67 71 public Class <?> 72 getInterfaceForType( final String type ) 73 { 74 Class <?> theClass = XTypesMapper.getInstance().getInterfaceForType( type ); 75 76 if ( theClass == null ) 77 { 78 theClass = J2EETypesMapper.getInstance().getInterfaceForType( type ); 79 } 80 81 if ( theClass == null ) 82 { 83 throw new IllegalArgumentException ( "Can't find interface for: " + type ); 84 } 85 86 assert( AMX.class.isAssignableFrom( theClass ) ): 87 "WARNING: mbean does not implement AMX: " + theClass.getName(); 88 89 return( theClass ); 90 } 91 92 93 } 94 | Popular Tags |