FileDocCategorySizeDatePackage
AdminConfigEventListener.javaAPI DocGlassfish v2 API4982Fri May 04 22:25:36 BST 2007com.sun.enterprise.admin.meta

AdminConfigEventListener

public class AdminConfigEventListener extends Object implements com.sun.enterprise.config.ConfigContextEventListener

Fields Summary
Constructors Summary
public AdminConfigEventListener()
Creates new AdminConfigEventListener.

        super();
    
Methods Summary
public voidpostAccessNotification(com.sun.enterprise.config.ConfigContextEvent ccce)

public voidpostChangeNotification(com.sun.enterprise.config.ConfigContextEvent event)
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);
        }
    
public voidpreAccessNotification(com.sun.enterprise.config.ConfigContextEvent ccce)

public voidpreChangeNotification(com.sun.enterprise.config.ConfigContextEvent ccce)