1 28 29 package com.caucho.jmx; 30 31 import javax.management.Descriptor ; 32 import javax.management.RuntimeOperationsException ; 33 34 public class EmptyDescriptor 35 implements Descriptor 36 { 37 public static final Descriptor EMPTY_DESCRIPTOR = new EmptyDescriptor(); 38 39 private static final Object [] EMPTY_OBJECT_ARRAY = new Object [0]; 40 private static final String [] EMPTY_STRING_ARRAY = new String [0]; 41 42 private EmptyDescriptor() 43 { 44 } 45 46 public Object getFieldValue(String fieldName) 47 throws RuntimeOperationsException 48 { 49 return null; 50 } 51 52 public void setField(String fieldName, Object fieldValue) 53 throws RuntimeOperationsException 54 { 55 throw new RuntimeOperationsException (new UnsupportedOperationException ()); 56 } 57 58 public String [] getFields() 59 { 60 return EMPTY_STRING_ARRAY; 61 } 62 63 public String [] getFieldNames() 64 { 65 return EMPTY_STRING_ARRAY; 66 } 67 68 public Object [] getFieldValues(String [] fieldNames) 69 { 70 return EMPTY_OBJECT_ARRAY; 71 } 72 73 public void removeField(String fieldName) 74 { 75 throw new RuntimeOperationsException (new UnsupportedOperationException ()); 76 } 77 78 public void setFields(String [] fieldNames, Object [] fieldValues) 79 throws RuntimeOperationsException 80 { 81 throw new RuntimeOperationsException (new UnsupportedOperationException ()); 82 } 83 84 public Object clone() 85 throws RuntimeOperationsException 86 { 87 return this; 88 } 89 90 public boolean isValid() 91 throws RuntimeOperationsException 92 { 93 return true; 94 } 95 } 96 | Popular Tags |