|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.server.registry.BasicMBeanRegistry
The registry for object name - object reference mapping in the MBean server.
The implementation of this class affects the invocation speed directly, please check any changes for performance.
MBeanRegistry
(src) Field Summary | |
protected MBeanServerDelegate (src) |
delegate
Direct reference to the mandatory MBean server delegate MBean. |
protected java.util.Vector |
fMbInfosToStore
|
protected static Logger (src) |
log
The logger |
protected SynchronizedLong |
registrationNotificationSequence
Sequence number for the MBean server registration notifications. |
protected SynchronizedLong |
unregistrationNotificationSequence
Sequence number for the MBean server unregistration notifications. |
Constructor Summary | |
BasicMBeanRegistry(MBeanServer (src) server,
java.lang.String defaultDomain,
ClassLoaderRepository (src) clr)
Constructs a new BasicMBeanRegistry. |
Method Summary | |
protected void |
add(MBeanEntry (src) entry)
Adds an MBean entry |
boolean |
contains(ObjectName (src) name)
Test whether an object name is registered. |
java.util.List |
findEntries(ObjectName (src) pattern)
Return a List of MBeanEntry objects with ObjectNames that match the specified pattern. |
MBeanEntry (src) |
get(ObjectName (src) name)
Retrieve the registration for an object name. |
java.lang.String |
getDefaultDomain()
Retrieve the default domain for this registry. |
java.lang.String[] |
getDomains()
Retrieve the domains for this registry. |
ObjectInstance (src) |
getObjectInstance(ObjectName (src) name)
Retrieve the object instance for an object name. |
int |
getSize()
Retrieve the number of mbeans registered. |
java.lang.Object |
getValue(ObjectName (src) name,
java.lang.String key)
Retrieve a value from the registration. |
protected void |
handlePreDeregister(MBeanRegistration (src) registrationInterface)
subclasses can override to provide any custom preDeregister logic and must call preDregister on the MBeanRegistration instance |
protected ObjectName (src) |
handlePreRegistration(MBeanRegistration (src) registrationInterface,
ObjectName (src) regName)
subclasses can override to provide their own pre-registration pre- and post- logic for preRegister and must call preRegister on the MBeanRegistration instance |
protected ObjectName (src) |
invokePreRegister(MBeanInvoker (src) invoker,
ObjectName (src) regName,
java.lang.String magicToken)
|
protected java.util.Vector |
mbInfosToStore()
ObjectName objects bound to MBean Info objects that are waiting to be stored in the persistence store. |
protected void |
persistIfRequired(MBeanInfo (src) info,
ObjectName (src) name)
Adds the given MBean Info object to the persistence queue if it explicity denotes (via metadata) that it should be stored. |
protected ObjectName (src) |
qualifyName(ObjectName (src) name)
Qualify an object name with the default domain |
protected void |
registerClassLoader(java.lang.ClassLoader cl)
Subclasses can override if they wish to control the classloader registration to loader repository. |
ObjectInstance (src) |
registerMBean(java.lang.Object object,
ObjectName (src) name,
java.util.Map valueMap)
Register an mbean. |
void |
releaseRegistry()
Cleans up the registry before the MBean server is released. |
protected void |
remove(ObjectName (src) name)
Removes an MBean entry WARNING: The object name should be fully qualified. |
protected void |
sendRegistrationNotification(ObjectName (src) regName)
send a MBeanServerNotification.REGISTRATION_NOTIFICATION notification to regName |
protected void |
sendUnRegistrationNotification(ObjectName (src) name)
send MBeanServerNotification.UNREGISTRATION_NOTIFICATION notification to name |
void |
unregisterMBean(ObjectName (src) name)
Unregister an mbean. |
protected ObjectName (src) |
validateAndQualifyName(ObjectName (src) name,
java.lang.String magicToken)
Validates and qualifies an MBean |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final SynchronizedLong registrationNotificationSequence
protected final SynchronizedLong unregistrationNotificationSequence
protected MBeanServerDelegate (src) delegate
protected java.util.Vector fMbInfosToStore
protected static Logger (src) log
Constructor Detail |
public BasicMBeanRegistry(MBeanServer (src) server, java.lang.String defaultDomain, ClassLoaderRepository (src) clr)
Method Detail |
public ObjectInstance (src) registerMBean(java.lang.Object object, ObjectName (src) name, java.util.Map valueMap) throws InstanceAlreadyExistsException (src) , MBeanRegistrationException (src) , NotCompliantMBeanException (src)
MBeanRegistry (src)
This method is invoked by the MBeanServer for createMBean() and registerMBean().
The object name passed maybe unqualified.
The map is a user definable string to value object map for holding information against a registered object. This map may contain metadata related to the registration, such as registration date/time, classloader references, etc.
Pass JMI_DOMAIN
in
both the key and values of the values map to get access to the reserved
domain. It is removed from the map during registration to save memory.
Pass CLASSLOADER
in the values map to
set the context classloader
Other values are user definable and can be retrieved using the getValue(ObjectName,String) method.
registerMBean
in interface MBeanRegistry (src)
object
- the mbean to register.name
- the object name to assign to the mbean.valueMap
- a map of other information to include in the
registry
InstanceAlreadyExistsException (src)
- when the object name
is already registered.
NotCompliantMBeanException (src)
- when the passed object is
a valid mbean.
MBeanRegistrationException (src)
- when an exception is raised
during preRegister for the mbean.protected void sendRegistrationNotification(ObjectName (src) regName)
regName
- protected ObjectName (src) handlePreRegistration(MBeanRegistration (src) registrationInterface, ObjectName (src) regName) throws java.lang.Exception
registrationInterface
- regName
-
java.lang.Exception
protected void handlePreDeregister(MBeanRegistration (src) registrationInterface) throws java.lang.Exception
registrationInterface
-
java.lang.Exception
protected void registerClassLoader(java.lang.ClassLoader cl)
cl
- classloaderpublic void unregisterMBean(ObjectName (src) name) throws InstanceNotFoundException (src) , MBeanRegistrationException (src)
MBeanRegistry (src)
This method is invoked by the MBeanServer for unregisterMBean().
The object name passed maybe unqualified.
MBeans in JMImplementation cannot be unregistered
unregisterMBean
in interface MBeanRegistry (src)
name
- the mbean to unregister.
InstanceNotFoundException (src)
- when the object name is
not registered.
MBeanRegistrationException (src)
- when an exception is raised
during preDeregister for the mbean.protected void sendUnRegistrationNotification(ObjectName (src) name)
name
- public MBeanEntry (src) get(ObjectName (src) name) throws InstanceNotFoundException (src)
MBeanRegistry (src)
This method is invoked by the MBeanServer for methods passing an ObjectName that are not covered in other methods.
The object name passed maybe unqualified.
get
in interface MBeanRegistry (src)
name
- the object name to retrieve
InstanceNotFoundException (src)
- when the object name is not
registered.public java.lang.String getDefaultDomain()
MBeanRegistry (src)
getDefaultDomain
in interface MBeanRegistry (src)
public java.lang.String[] getDomains()
MBeanRegistry (src)
getDomains
in interface MBeanRegistry (src)
public ObjectInstance (src) getObjectInstance(ObjectName (src) name) throws InstanceNotFoundException (src)
MBeanRegistry (src)
getObjectInstance
in interface MBeanRegistry (src)
name
- the object name of the mbean
InstanceNotFoundException (src)
- when the object name is not
registeredpublic java.lang.Object getValue(ObjectName (src) name, java.lang.String key) throws InstanceNotFoundException (src)
MBeanRegistry (src)
getValue
in interface MBeanRegistry (src)
name
- the object name of the mbeankey
- the key to the value
InstanceNotFoundException (src)
- when the object name is not
registeredpublic boolean contains(ObjectName (src) name)
MBeanRegistry (src)
This method is invoked by the MBeanServer for isRegistered().
The object name passed maybe unqualified.
contains
in interface MBeanRegistry (src)
name
- the object name
public int getSize()
MBeanRegistry (src)
This method is invoked by the MBeanServer for getMBeanCount().
getSize
in interface MBeanRegistry (src)
public java.util.List findEntries(ObjectName (src) pattern)
MBeanRegistry (src)
This method is invoked by the MBeanServer for queryMBeans() and queryNames().
findEntries
in interface MBeanRegistry (src)
pattern
- the pattern to match
public void releaseRegistry()
releaseRegistry
in interface MBeanRegistry (src)
protected ObjectName (src) invokePreRegister(MBeanInvoker (src) invoker, ObjectName (src) regName, java.lang.String magicToken) throws MBeanRegistrationException (src) , NotCompliantMBeanException (src)
MBeanRegistrationException (src)
NotCompliantMBeanException (src)
protected void add(MBeanEntry (src) entry) throws InstanceAlreadyExistsException (src)
WARNING: The object name should be fully qualified.
entry
- the MBean entry to add
InstanceAlreadyExistsException (src)
- when the MBean's object name
is already registeredprotected void remove(ObjectName (src) name) throws InstanceNotFoundException (src)
name
- the object name of the entry to remove
InstanceNotFoundException (src)
- when the object name is not
registeredprotected ObjectName (src) validateAndQualifyName(ObjectName (src) name, java.lang.String magicToken)
Validates the name is not a pattern.
Adds the default domain if no domain is specified.
Checks the name is not in the reserved domain JMImplementation when
the magicToken is not JMI_DOMAIN
name
- the name to validatemagicToken
- used to get access to the reserved domain
RuntimeOperationsException (src)
- containing an
IllegalArgumentException for a problem with the nameprotected ObjectName (src) qualifyName(ObjectName (src) name)
Adds the default domain if no domain is specified.
name
- the name to qualify
RuntimeOperationsException (src)
- containing an
IllegalArgumentException when there is a problemprotected void persistIfRequired(MBeanInfo (src) info, ObjectName (src) name) throws MalformedObjectNameException (src) , InstanceNotFoundException (src) , MBeanException (src) , ReflectionException (src)
MalformedObjectNameException (src)
InstanceNotFoundException (src)
MBeanException (src)
ReflectionException (src)
protected java.util.Vector mbInfosToStore()
|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |