1 23 24 29 package com.sun.cli.jmx.util; 30 31 import java.util.Set ; 32 33 import javax.management.StandardMBean ; 34 import javax.management.ObjectName ; 35 import javax.management.MBeanServer ; 36 import javax.management.MBeanServerConnection ; 37 import javax.management.NotCompliantMBeanException ; 38 import javax.management.MalformedObjectNameException ; 39 import javax.management.MBeanRegistration ; 40 41 public class ObjectNameQueryMBeanImpl 42 extends StandardMBean 43 implements ObjectNameQueryMBean, MBeanRegistration 44 { 45 private MBeanServerConnection mConn; 46 private ObjectNameQueryImpl mImpl; 47 48 public 49 ObjectNameQueryMBeanImpl() 50 throws NotCompliantMBeanException 51 { 52 super( ObjectNameQueryMBean.class ); 53 } 54 55 public Set 56 matchAll( ObjectName startingSetPattern, String [] regexNames, String [] regexValues ) 57 throws MalformedObjectNameException , java.io.IOException 58 { 59 final Set candidates = mConn.queryNames( startingSetPattern, null ); 60 61 return( mImpl.matchAll( candidates, regexNames, regexValues ) ); 62 } 63 64 public Set 65 matchAll( Set startingSet, String [] regexNames, String [] regexValues ) 66 { 67 return( mImpl.matchAll( startingSet, regexNames, regexValues ) ); 68 } 69 70 public Set 71 matchAny( ObjectName startingSetPattern, String [] regexNames, String [] regexValues ) 72 throws MalformedObjectNameException , java.io.IOException 73 { 74 final Set candidates = mConn.queryNames( startingSetPattern, null ); 75 76 return( mImpl.matchAny( candidates, regexNames, regexValues ) ); 77 } 78 79 public Set 80 matchAny( Set startingSet, String [] regexNames, String [] regexValues ) 81 { 82 return( mImpl.matchAny( startingSet, regexNames, regexValues ) ); 83 } 84 85 86 87 public ObjectName 88 preRegister(MBeanServer server, ObjectName name) 89 { 90 mConn = server; 91 92 mImpl = new ObjectNameQueryImpl( ); 93 return( name ); 94 } 95 96 public void 97 postRegister( Boolean registrationDone ) 98 { 99 } 100 101 public void 102 preDeregister() 103 { 104 } 106 public void 107 postDeregister( ) 108 { 109 } 111 112 } 113 114 115 116 117 118 119 | Popular Tags |