org.jboss.mx.remoting.event
Class ClassQueryExp

java.lang.Object
  extended byorg.jboss.mx.remoting.event.ClassQueryExp
All Implemented Interfaces:
QueryExp (src) , java.io.Serializable

public class ClassQueryExp
extends java.lang.Object
implements QueryExp (src) , java.io.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.

See Also:
Serialized Form

Field Summary
static int AND
           
static int OR
           
 
Constructor Summary
ClassQueryExp(java.lang.Class cl)
          default will create using a AND operator
ClassQueryExp(java.lang.Class[] cl)
          default will create using a AND operator
ClassQueryExp(java.lang.Class[] cl, int operator)
           
ClassQueryExp(java.lang.Class cl, int operator)
           
 
Method Summary
 boolean apply(ObjectName (src)  objectName)
          Apply this query expression to an MBean.
 void setMBeanServer(MBeanServer (src)  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 (src)

OR

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

ClassQueryExp

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

Parameters:
cl -

ClassQueryExp

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

Parameters:
cl -

ClassQueryExp

public ClassQueryExp(java.lang.Class cl,
                     int operator)

ClassQueryExp

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

apply

public boolean apply(ObjectName (src)  objectName)
              throws BadStringOperationException (src) ,
                     BadBinaryOpValueExpException (src) ,
                     BadAttributeValueExpException (src) ,
                     InvalidApplicationException (src) 
Description copied from interface: QueryExp (src)
Apply this query expression to an MBean.

Specified by:
apply in interface QueryExp (src)
Parameters:
objectName - the object name of the mbean
Returns:
true or false as the result of the query expression.
Throws:
InvalidApplicationException (src) - when trying to apply a subquery expression to an MBean or an attribute expression to an MBean of the wrong class.
BadStringOperationException (src) - when an invalid string operation is used during query construction
BadAttributeValueExpException (src) - when an invalid MBean attribute is used during query construction
BadBinaryOpValueExpException (src) - when an invalid binary operation is used during query construction

setMBeanServer

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

Specified by:
setMBeanServer in interface QueryExp (src)
Parameters:
mBeanServer -