|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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
Field Summary | |
protected MBeanServerDelegate |
delegate
Direct reference to the mandatory MBean server delegate MBean. |
protected Vector |
fMbInfosToStore
|
protected static org.jboss.logging.Logger |
log
The logger |
protected EDU.oswego.cs.dl.util.concurrent.SynchronizedLong |
registrationNotificationSequence
Sequence number for the MBean server registration notifications. |
protected EDU.oswego.cs.dl.util.concurrent.SynchronizedLong |
unregistrationNotificationSequence
Sequence number for the MBean server unregistration notifications. |
Constructor Summary | |
BasicMBeanRegistry(MBeanServer server,
String defaultDomain,
ClassLoaderRepository clr)
Constructs a new BasicMBeanRegistry. |
Method Summary | |
protected void |
add(MBeanEntry entry)
Adds an MBean entry |
boolean |
contains(ObjectName name)
Test whether an object name is registered. |
List |
findEntries(ObjectName pattern)
Return a List of MBeanEntry objects with ObjectNames that match the specified pattern. |
MBeanEntry |
get(ObjectName name)
Retrieve the registration for an object name. |
String |
getDefaultDomain()
Retrieve the default domain for this registry. |
String[] |
getDomains()
Retrieve the domains for this registry. |
ObjectInstance |
getObjectInstance(ObjectName name)
Retrieve the object instance for an object name. |
int |
getSize()
Retrieve the number of mbeans registered. |
Object |
getValue(ObjectName name,
String key)
Retrieve a value from the registration. |
protected void |
handlePreDeregister(MBeanRegistration registrationInterface)
subclasses can override to provide any custom preDeregister logic and must call preDregister on the MBeanRegistration instance |
protected ObjectName |
handlePreRegistration(MBeanRegistration registrationInterface,
ObjectName 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 |
invokePreRegister(MBeanInvoker invoker,
ObjectName regName,
String magicToken)
|
protected Vector |
mbInfosToStore()
ObjectName objects bound to MBean Info objects that are waiting to be stored in the persistence store. |
protected void |
persistIfRequired(MBeanInfo info,
ObjectName name)
Adds the given MBean Info object to the persistence queue if it explicity denotes (via metadata) that it should be stored. |
protected ObjectName |
qualifyName(ObjectName name)
Qualify an object name with the default domain |
protected void |
registerClassLoader(ClassLoader cl)
Subclasses can override if they wish to control the classloader registration to loader repository. |
ObjectInstance |
registerMBean(Object object,
ObjectName name,
Map valueMap)
Register an mbean. |
void |
releaseRegistry()
Cleans up the registry before the MBean server is released. |
protected void |
remove(ObjectName name)
Removes an MBean entry WARNING: The object name should be fully qualified. |
protected void |
sendRegistrationNotification(ObjectName regName)
send a MBeanServerNotification.REGISTRATION_NOTIFICATION notification to regName |
protected void |
sendUnRegistrationNotification(ObjectName name)
send MBeanServerNotification.UNREGISTRATION_NOTIFICATION notification to name |
void |
unregisterMBean(ObjectName name)
Unregister an mbean. |
protected ObjectName |
validateAndQualifyName(ObjectName name,
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 EDU.oswego.cs.dl.util.concurrent.SynchronizedLong registrationNotificationSequence
protected final EDU.oswego.cs.dl.util.concurrent.SynchronizedLong unregistrationNotificationSequence
protected MBeanServerDelegate delegate
protected Vector fMbInfosToStore
protected static org.jboss.logging.Logger log
Constructor Detail |
public BasicMBeanRegistry(MBeanServer server, String defaultDomain, ClassLoaderRepository clr)
Method Detail |
public ObjectInstance registerMBean(Object object, ObjectName name, Map valueMap) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException
MBeanRegistry
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
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
NotCompliantMBeanException
- when the passed object is
a valid mbean.
InstanceAlreadyExistsException
- when the object name
is already registered.
MBeanRegistrationException
- when an exception is raised
during preRegister for the mbean.protected void sendRegistrationNotification(ObjectName regName)
regName
- protected ObjectName handlePreRegistration(MBeanRegistration registrationInterface, ObjectName regName) throws Exception
registrationInterface
- regName
-
Exception
protected void handlePreDeregister(MBeanRegistration registrationInterface) throws Exception
registrationInterface
-
Exception
protected void registerClassLoader(ClassLoader cl)
cl
- classloaderpublic void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException
MBeanRegistry
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
name
- the mbean to unregister.
MBeanRegistrationException
- when an exception is raised
during preDeregister for the mbean.
InstanceNotFoundException
- when the object name is
not registered.protected void sendUnRegistrationNotification(ObjectName name)
name
- public MBeanEntry get(ObjectName name) throws InstanceNotFoundException
MBeanRegistry
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
name
- the object name to retrieve
InstanceNotFoundException
- when the object name is not
registered.public String getDefaultDomain()
MBeanRegistry
getDefaultDomain
in interface MBeanRegistry
public String[] getDomains()
MBeanRegistry
getDomains
in interface MBeanRegistry
public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException
MBeanRegistry
getObjectInstance
in interface MBeanRegistry
name
- the object name of the mbean
InstanceNotFoundException
- when the object name is not
registeredpublic Object getValue(ObjectName name, String key) throws InstanceNotFoundException
MBeanRegistry
getValue
in interface MBeanRegistry
name
- the object name of the mbeankey
- the key to the value
InstanceNotFoundException
- when the object name is not
registeredpublic boolean contains(ObjectName name)
MBeanRegistry
This method is invoked by the MBeanServer for isRegistered().
The object name passed maybe unqualified.
contains
in interface MBeanRegistry
name
- the object name
public int getSize()
MBeanRegistry
This method is invoked by the MBeanServer for getMBeanCount().
getSize
in interface MBeanRegistry
public List findEntries(ObjectName pattern)
MBeanRegistry
This method is invoked by the MBeanServer for queryMBeans() and queryNames().
findEntries
in interface MBeanRegistry
pattern
- the pattern to match
public void releaseRegistry()
releaseRegistry
in interface MBeanRegistry
protected ObjectName invokePreRegister(MBeanInvoker invoker, ObjectName regName, String magicToken) throws MBeanRegistrationException, NotCompliantMBeanException
protected void add(MBeanEntry entry) throws InstanceAlreadyExistsException
WARNING: The object name should be fully qualified.
entry
- the MBean entry to add
InstanceAlreadyExistsException
- when the MBean's object name
is already registeredprotected void remove(ObjectName name) throws InstanceNotFoundException
name
- the object name of the entry to remove
InstanceNotFoundException
- when the object name is not
registeredprotected ObjectName validateAndQualifyName(ObjectName name, 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
- containing an
IllegalArgumentException for a problem with the nameprotected ObjectName qualifyName(ObjectName name)
Adds the default domain if no domain is specified.
name
- the name to qualify
RuntimeOperationsException
- containing an
IllegalArgumentException when there is a problemprotected void persistIfRequired(MBeanInfo info, ObjectName name) throws MalformedObjectNameException, InstanceNotFoundException, MBeanException, ReflectionException
protected Vector mbInfosToStore()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |