1 23 24 29 30 31 package com.sun.appserv.management.util.jmx; 32 33 import javax.management.MBeanAttributeInfo ; 34 35 39 public class ReadWriteAttributeFilter implements AttributeFilter 40 { 41 protected ReadWriteAttributeFilter( ) {} 42 43 45 public boolean 46 filterAttribute( final MBeanAttributeInfo info ) 47 { 48 throw new RuntimeException ( "Can't get here" ); 49 } 50 51 public static final AttributeFilter READ_ONLY_FILTER = 52 new ReadWriteAttributeFilter( ) 53 { 54 public boolean filterAttribute( final MBeanAttributeInfo info ) 55 { 56 return( info.isReadable() && ! info.isWritable() ); 57 } 58 }; 59 60 public static final AttributeFilter READABLE_FILTER = 61 new ReadWriteAttributeFilter( ) 62 { 63 public boolean filterAttribute( final MBeanAttributeInfo info ) 64 { 65 return( info.isReadable() ); 66 } 67 }; 68 69 public static final AttributeFilter WRITE_ONLY_FILTER = 70 new ReadWriteAttributeFilter() 71 { 72 public boolean filterAttribute( final MBeanAttributeInfo info ) 73 { 74 return( info.isWritable() && ! info.isReadable() ); 75 } 76 }; 77 78 public static final AttributeFilter WRITEABLE_FILTER = 79 new ReadWriteAttributeFilter() 80 { 81 public boolean filterAttribute( final MBeanAttributeInfo info ) 82 { 83 return( info.isWritable() ); 84 } 85 }; 86 87 public static final AttributeFilter READ_WRITE_FILTER = 88 new ReadWriteAttributeFilter() 89 { 90 public boolean filterAttribute( final MBeanAttributeInfo info ) 91 { 92 return( info.isWritable() && info.isReadable() ); 93 } 94 }; 95 96 public static final AttributeFilter ALL_FILTER = 97 new ReadWriteAttributeFilter() 98 { 99 public boolean filterAttribute( final MBeanAttributeInfo info ) 100 { 101 return( true ); 102 } 103 }; 104 } 105 106 107 108 109 110 111 | Popular Tags |