code: public Set<ObjectName> queryNames(ObjectName name, QueryExp query) throws RemoteException {
  
          Set<ObjectName> s = getMBeanServer().queryNames(name, query);
  
          return s;
      }
docs: /*
  Gets the names of managed objects controlled by the MEJB. This
  method enables any of the following to be obtained: The names of all
  managed objects, the names of a set of managed objects specified by
  pattern matching on the ObjectName and/or a query expression, a
  specific managed object name (equivalent to testing whether a managed
  object is registered). When the object name is null or no domain and key
  properties are specified, all objects are selected. It returns the set of
  ObjectNames for the managed objects selected.
  Parameters:
  name - The object name pattern identifying the managed objects to be
  retrieved. If null or no domain and key properties are specified, all the
  managed objects registered will be retrieved.
  query - The query expression to be applied for selecting managed
  objects. If null no query expression will be applied for selecting
  managed objects.
  Returns:
  A set containing the ObjectNames for the managed objects selected. If
  no managed object satisfies the query, an empty set is returned.