Modifier and Type | Class and Description |
---|---|
public static interface | Repository.
An interface that allows the caller to get some control over the registration. |
Modifier and Type | Field and Description |
---|---|
private final String | domain
Domain name of the server the repository is attached to. |
private final Map | domainTb
The structure for storing the objects is very basic. |
private final ReentrantReadWriteLock | lock
We use a global reentrant read write lock to protect the repository. |
private volatile int | nbElements
Number of elements contained in the Repository |
Access | Constructor and Description |
---|---|
public | |
public | Repository(String domain, boolean fairLock)
Construct a new repository with the given default domain. |
Modifier and Type | Method and Description |
---|---|
private void | addAllMatching(final Map<String, NamedObject> moiTb, final Set<NamedObject> result, final ObjectName pattern)
Add all the matching objects from the given hashtable in the result set for the given pattern |
public void | addMBean(final DynamicMBean
MBean to be stored in the repository. object, ObjectName MBean object name. name, final Repository.A registration context. If non null, the repository
will call contextcontext. from within the repository
lock, when it has determined that the object
can be stored in the repository with that name .
If context. throws an exception, the
operation is abandoned, the MBean is not added to the
repository, and a RuntimeOperationsException
is thrown.Stores an MBean associated with its object name in the repository. |
private void | addMoiToTb(final DynamicMBean object, final ObjectName name, final String key, final Map<String, NamedObject> moiTb, final Repository.
|
private void | addNewDomMoi(final DynamicMBean object, final String dom, final ObjectName name, final Repository.
|
public boolean | Returns: true if the MBean is stored in the repository, false otherwise.name of the MBean to find. name)Checks whether an MBean of the name specified is already stored in the repository. |
public Integer | |
public String | Returns: A string giving the name of the default domain name.Gets the name of the domain currently used by default in the repository. |
public String[] | |
public Set | Returns: The list of MBeans selected. There may be zero, one or many MBeans returned in the set.The name of the MBean(s) to retrieve - may be a specific
object or a name pattern allowing multiple MBeans to be selected. pattern, QueryExp query expression to apply when selecting objects - this
parameter will be ignored when the Repository Service does not
support filtering. query)Selects and retrieves the list of MBeans whose names match the specified object name pattern and which match the specified query expression (optionally). |
private void | |
public void | remove(final ObjectName
name of the MBean to remove. name, final Repository.A registration context. If non null, the repository
will call contextcontext. from within the repository
lock, just after the mbean associated with
name is removed from the repository.
If context. is not expected to throw any
exception. If it does, the exception is logged
and swallowed.Removes an MBean from the repository. |
public DynamicMBean | Returns: The retrieved MBean if it is contained in the repository, null otherwise.name of the MBean to retrieve. name)Retrieves the MBean of the name specified from the repository. |
private NamedObject | retrieveNamedObject(ObjectName name)
Retrieves the named object contained in repository from the given objectname. |
private void |
domain | back to summary |
---|---|
private final String domain Domain name of the server the repository is attached to. It is quicker to store the information in the repository rather than querying the framework each time the info is required. |
domainTb | back to summary |
---|---|
private final Map<String, Map<String, NamedObject>> domainTb The structure for storing the objects is very basic. A Hashtable is used for storing the different domains For each domain, a hashtable contains the instances with canonical key property list string as key and named object aggregated from given object name and mbean instance as value. |
lock | back to summary |
---|---|
private final ReentrantReadWriteLock lock We use a global reentrant read write lock to protect the repository. This seems safer and more efficient: we are using Maps of Maps, Guaranteing consistency while using Concurrent objects at each level may be more difficult. |
nbElements | back to summary |
---|---|
private volatile int nbElements Number of elements contained in the Repository |
Repository | back to summary |
---|---|
public Repository(String domain) Construct a new repository with the given default domain. |
Repository | back to summary |
---|---|
public Repository(String domain, boolean fairLock) Construct a new repository with the given default domain. |
addAllMatching | back to summary |
---|---|
private void addAllMatching(final Map<String, NamedObject> moiTb, final Set<NamedObject> result, final ObjectName pattern) Add all the matching objects from the given hashtable in the result set for the given pattern |
addMBean | back to summary |
---|---|
public void addMBean(final DynamicMBean object, ObjectName name, final Repository. Stores an MBean associated with its object name in the repository.
|
addMoiToTb | back to summary |
---|---|
private void addMoiToTb(final DynamicMBean object, final ObjectName name, final String key, final Map<String, NamedObject> moiTb, final Repository. |
addNewDomMoi | back to summary |
---|---|
private void addNewDomMoi(final DynamicMBean object, final String dom, final ObjectName name, final Repository. |
contains | back to summary |
---|---|
public boolean contains(ObjectName name) Checks whether an MBean of the name specified is already stored in the repository.
|
getCount | back to summary |
---|---|
public Integer getCount() Gets the number of MBeans stored in the repository.
|
getDefaultDomain | back to summary |
---|---|
public String getDefaultDomain() Gets the name of the domain currently used by default in the repository.
|
getDomains | back to summary |
---|---|
public String[] getDomains() Returns the list of domains in which any MBean is currently registered. |
query | back to summary |
---|---|
public Set Selects and retrieves the list of MBeans whose names match the specified object name pattern and which match the specified query expression (optionally).
|
registering | back to summary |
---|---|
private void registering(Repository. |
remove | back to summary |
---|---|
public void remove(final ObjectName name, final Repository. Removes an MBean from the repository.
|
retrieve | back to summary |
---|---|
public DynamicMBean retrieve(ObjectName name) Retrieves the MBean of the name specified from the repository. The object name must match exactly.
|
retrieveNamedObject | back to summary |
---|---|
private NamedObject retrieveNamedObject(ObjectName name) Retrieves the named object contained in repository from the given objectname. |
unregistering | back to summary |
---|---|
private void unregistering(Repository. |
Modifier and Type | Method and Description |
---|---|
public void | |
public void |
registering | back to summary |
---|---|
public void registering() Called by |
unregistered | back to summary |
---|---|
public void unregistered() Called by |