after config add, delete, set, update or flush. type is in ccce
boolean bAdded;
//set bAdded (shows whether bean added or removed)
if((event.getType()).equals(event.POST_DELETE_CHANGE))
bAdded = false;
else if((event.getType()).equals(event.POST_ADD_CHANGE))
bAdded = true;
else if((event.getType()).equals(event.POST_SET_CHANGE))
bAdded = true;
else
return;
//here we are only for add/set/delete operations
//we are interesting only in bean operations:
Object bean = event.getObject();
if(bean instanceof ConfigBean)
{
String domainName = MBeanRegistryFactory.getAdminContext().getDomainName();
if(bAdded)
MBeanRegistryFactory.getAdminMBeanRegistry().adoptConfigBeanAdd((ConfigBean)bean, domainName);
else
MBeanRegistryFactory.getAdminMBeanRegistry().adoptConfigBeanDelete((ConfigBean)bean, domainName);
}