public class EasyBeansRegistery
extends java.lang.Object
ManagementFactory.getPlatformMBeanServer()
.Constructor and Description |
---|
EasyBeansRegistery() |
EasyBeansRegistery(javax.management.MBeanServer mBeanServer) |
Modifier and Type | Method and Description |
---|---|
void |
register(java.util.List beans)
Registers each of the given beans.
|
void |
register(java.lang.Object bean)
If the given bean is already an instanceof of
EasyBeanWrapper then the given bean
will be registered directly with the MBean server. |
void |
setBeans(java.util.List beans)
Registers each of the given beans.
|
void |
unregister(java.lang.Object bean)
Unregisters the given bean from the MBean server.
|
void |
unregisterAll()
Unregisters all previously registered beans.
|
public EasyBeansRegistery()
public EasyBeansRegistery(javax.management.MBeanServer mBeanServer)
public void register(java.lang.Object bean) throws InvalidEasyBeanNameException, InvalidEasyBeanAnnotation, InvalidEasyBeanOpenType, ObjectNameAlreadyRegistered, UnexpectedEasyBeanException
EasyBeanWrapper
then the given bean
will be registered directly with the MBean server. Otherwise the object will be wrapped with either EasyBeanNotificationWrapper
(if the bean implements EasyBeansNotifierUser
or NotificationBroadcaster
) or a EasyBeanWrapper
.bean
- The bean to register.InvalidEasyBeanNameException
- If the ObjectName used for this bean in invalid.InvalidEasyBeanAnnotation
- If an EasyBean annotation is used incorrectly.InvalidEasyBeanOpenType
- If the given object (or a descendant of this object) cannot be mapped to an OpenType.ObjectNameAlreadyRegistered
- If the object name used for this bean is already registered.UnexpectedEasyBeanException
- If something unexpected occurred.public void setBeans(java.util.List beans) throws InvalidEasyBeanNameException, InvalidEasyBeanAnnotation, InvalidEasyBeanOpenType, ObjectNameAlreadyRegistered, UnexpectedEasyBeanException
beans
- InvalidEasyBeanNameException
- If the ObjectName used for this bean in invalid.InvalidEasyBeanAnnotation
- If an EasyBean annotation is used incorrectly.InvalidEasyBeanOpenType
- If the given object (or a descendant of this object) cannot be mapped to an OpenType.ObjectNameAlreadyRegistered
- If the object name used for this bean is already registered.UnexpectedEasyBeanException
- If something unexpected occurred.register(Object)
public void register(java.util.List beans) throws InvalidEasyBeanNameException, InvalidEasyBeanAnnotation, InvalidEasyBeanOpenType, ObjectNameAlreadyRegistered, UnexpectedEasyBeanException
beans
- InvalidEasyBeanNameException
- If the ObjectName used for this bean in invalid.InvalidEasyBeanAnnotation
- If an EasyBean annotation is used incorrectly.InvalidEasyBeanOpenType
- If the given object (or a descendant of this object) cannot be mapped to an OpenType.ObjectNameAlreadyRegistered
- If the object name used for this bean is already registered.UnexpectedEasyBeanException
- If something unexpected occurred.register(Object)
public void unregister(java.lang.Object bean) throws UnexpectedEasyBeanException
bean
- UnexpectedEasyBeanException
- If something unexpected occurred.public void unregisterAll()