public class

Repository

extends Object
java.lang.Object
   ↳ com.sun.jmx.mbeanserver.Repository

Class Overview

The RepositorySupport implements the Repository interface. This repository does not support persistency.

Summary

Public Constructors
Repository(String domain)
Construct a new repository with the given default domain.
Repository(String domain, boolean fairLock)
Construct a new repository with the given default domain.
Public Methods
void addMBean(DynamicMBean object, ObjectName name)
Stores an MBean associated with its object name in the repository.
boolean contains(ObjectName name)
Checks whether an MBean of the name specified is already stored in the repository.
Integer getCount()
Gets the number of MBeans stored in the repository.
String getDefaultDomain()
Gets the name of the domain currently used by default in the repository.
String[] getDomains()
Returns the list of domains in which any MBean is currently registered.
Set<NamedObject> query(ObjectName pattern, QueryExp query)
Selects and retrieves the list of MBeans whose names match the specified object name pattern and which match the specified query expression (optionally).
void remove(ObjectName name)
Removes an MBean from the repository.
DynamicMBean retrieve(ObjectName name)
Retrieves the MBean of the name specified from the repository.
static boolean wildmatch(char[] str, char[] pat)
Match a string against a shell-style pattern.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Repository (String domain)

Construct a new repository with the given default domain.

public Repository (String domain, boolean fairLock)

Construct a new repository with the given default domain.

Public Methods

public void addMBean (DynamicMBean object, ObjectName name)

Stores an MBean associated with its object name in the repository.

Parameters
object MBean to be stored in the repository.
name MBean object name.

public boolean contains (ObjectName name)

Checks whether an MBean of the name specified is already stored in the repository.

Parameters
name name of the MBean to find.
Returns
  • true if the MBean is stored in the repository, false otherwise.

public Integer getCount ()

Gets the number of MBeans stored in the repository.

Returns
  • Number of MBeans.

public String getDefaultDomain ()

Gets the name of the domain currently used by default in the repository.

Returns
  • A string giving the name of the default domain name.

public String[] getDomains ()

Returns the list of domains in which any MBean is currently registered.

public Set<NamedObject> query (ObjectName pattern, QueryExp query)

Selects and retrieves the list of MBeans whose names match the specified object name pattern and which match the specified query expression (optionally).

Parameters
pattern The name of the MBean(s) to retrieve - may be a specific object or a name pattern allowing multiple MBeans to be selected.
query query expression to apply when selecting objects - this parameter will be ignored when the Repository Service does not support filtering.
Returns
  • The list of MBeans selected. There may be zero, one or many MBeans returned in the set.

public void remove (ObjectName name)

Removes an MBean from the repository.

Parameters
name name of the MBean to remove.
Throws
InstanceNotFoundException The MBean does not exist in the repository.

public DynamicMBean retrieve (ObjectName name)

Retrieves the MBean of the name specified from the repository. The object name must match exactly.

Parameters
name name of the MBean to retrieve.
Returns
  • The retrieved MBean if it is contained in the repository, null otherwise.

public static boolean wildmatch (char[] str, char[] pat)

Match a string against a shell-style pattern. The only pattern characters recognised are ?, standing for any one character, and *, standing for any string of characters, including the empty string.

Parameters
str the string to match, as a character array.
pat the pattern to match the string against, as a character array.
Returns
  • true if and only if the string matches the pattern.