org.jboss.mx.remoting.event
Class ClassQueryExp

java.lang.Object
  extended by org.jboss.mx.remoting.event.ClassQueryExp
All Implemented Interfaces:
Serializable, QueryExp

public class ClassQueryExp
extends Object
implements QueryExp, Serializable

ClassQueryExp is a QueryExp implementation that allows you to check the ObjectName on a query against one or more class names to make sure that they are the instanceof one or more classes.

Example code:

   ClassQueryExp query=new ClassQueryExp(MyMBean.class);
   Set beans=mbeanserver.queryMBeans(new ObjectName("*:*"),query);
 

The query in the above example will only return MBean ObjectInstances that are an instanceof MyMBean class.

Version:
$Revision: 81023 $
Author:
Jeff Haynie
See Also:
Serialized Form

Field Summary
static int AND
           
static int OR
           
 
Constructor Summary
ClassQueryExp(Class cl)
          default will create using a AND operator
ClassQueryExp(Class[] cl)
          default will create using a AND operator
ClassQueryExp(Class[] cl, int operator)
           
ClassQueryExp(Class cl, int operator)
           
 
Method Summary
 boolean apply(ObjectName objectName)
           
 void setMBeanServer(MBeanServer mBeanServer)
          called by MBeanServer prior to apply
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AND

public static final int AND
See Also:
Constant Field Values

OR

public static final int OR
See Also:
Constant Field Values
Constructor Detail

ClassQueryExp

public ClassQueryExp(Class[] cl)
default will create using a AND operator

Parameters:
cl -

ClassQueryExp

public ClassQueryExp(Class cl)
default will create using a AND operator

Parameters:
cl -

ClassQueryExp

public ClassQueryExp(Class cl,
                     int operator)

ClassQueryExp

public ClassQueryExp(Class[] cl,
                     int operator)
Method Detail

apply

public boolean apply(ObjectName objectName)
              throws BadStringOperationException,
                     BadBinaryOpValueExpException,
                     BadAttributeValueExpException,
                     InvalidApplicationException
Specified by:
apply in interface QueryExp
Throws:
BadStringOperationException
BadBinaryOpValueExpException
BadAttributeValueExpException
InvalidApplicationException

setMBeanServer

public void setMBeanServer(MBeanServer mBeanServer)
called by MBeanServer prior to apply

Specified by:
setMBeanServer in interface QueryExp
Parameters:
mBeanServer -


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.