Java EE 5 SDK

com.sun.appserv.management.helper
Class Helper

java.lang.Object
  extended by com.sun.appserv.management.helper.Helper
Direct Known Subclasses:
DeployedItemHelper, LoggingHelper, StatefulLoggingHelper

public class Helper
extends Object

Base class for Helpers, useable alone as well.


Field Summary
protected  BulkAccess mBulkAccess
           
protected  DomainRoot mDomainRoot
           
protected  QueryMgr mQueryMgr
           
 
Constructor Summary
Helper(AMX proxy)
           
 
Method Summary
 Set<ObjectName> filterByAttributeValue(Set<ObjectName> objectNameSet, String attributeName, Object valueToMatch)
          Filter ObjectNames based on the value of a particular Attribute.
 DomainRoot getDomainRoot()
           
protected
<T extends AMX>
Set<T>
propsQuery(String props)
           
protected
<T extends AMX>
Set<T>
propsQuery(String props1, String props2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mDomainRoot

protected final DomainRoot mDomainRoot

mQueryMgr

protected final QueryMgr mQueryMgr

mBulkAccess

protected final BulkAccess mBulkAccess
Constructor Detail

Helper

public Helper(AMX proxy)
Method Detail

getDomainRoot

public DomainRoot getDomainRoot()

propsQuery

protected <T extends AMX> Set<T> propsQuery(String props)

propsQuery

protected <T extends AMX> Set<T> propsQuery(String props1,
                                            String props2)

filterByAttributeValue

public Set<ObjectName> filterByAttributeValue(Set<ObjectName> objectNameSet,
                                              String attributeName,
                                              Object valueToMatch)
Filter ObjectNames based on the value of a particular Attribute. The value may be null or anything else. This is essentially a crude form of using the QueryMgr. A value which is a Class object succeeds if the result is an object whose class is assignable to the specfied class. Typically this is used to detect a thrown Exception.

For example, to select all MBeans which have a [bB]oolean Attribute named "Enabled", which is set to true, call:

filterByAttributeValue( objectNameSet, "Enabled", Boolean.TRUE)

The query for the Attribute value is performed as a bulk operation; thus this routine may be used with confidence that it is fast.

Parameters:
objectNameSet - Set of ObjectName
attributeName -
valueToMatch - an Object whose value must be null, or equals() to the result
Returns:
Set of ObjectName which have Enabled flag matching

Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.