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