KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > remoting > network > NetworkRegistryQuery


1 /***************************************
2  * *
3  * JBoss: The OpenSource J2EE WebOS *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  ***************************************/

9 package org.jboss.remoting.network;
10
11 import javax.management.BadAttributeValueExpException JavaDoc;
12 import javax.management.BadBinaryOpValueExpException JavaDoc;
13 import javax.management.BadStringOperationException JavaDoc;
14 import javax.management.InstanceNotFoundException JavaDoc;
15 import javax.management.InvalidApplicationException JavaDoc;
16 import javax.management.MBeanServer JavaDoc;
17 import javax.management.ObjectName JavaDoc;
18 import javax.management.QueryExp JavaDoc;
19
20 /**
21  * NetworkRegistryQuery is a QueryExp that will filter on NetworkRegistryMBean mbeans.
22  *
23  * @author <a HREF="mailto:jhaynie@vocalocity.net">Jeff Haynie</a>
24  * @version $Revision: 1.2 $
25  */

26 public class NetworkRegistryQuery implements QueryExp JavaDoc
27 {
28    private MBeanServer JavaDoc server;
29
30    public boolean apply(ObjectName JavaDoc objectName) throws BadStringOperationException JavaDoc, BadBinaryOpValueExpException JavaDoc, BadAttributeValueExpException JavaDoc, InvalidApplicationException JavaDoc
31    {
32       try
33       {
34          return server.isInstanceOf(objectName, NetworkRegistryMBean.class.getName());
35       }
36       catch(InstanceNotFoundException JavaDoc e)
37       {
38       }
39       return false;
40    }
41
42    public void setMBeanServer(MBeanServer JavaDoc mBeanServer)
43    {
44       this.server = mBeanServer;
45    }
46 }
47
Popular Tags