1 23 24 54 55 package com.sun.enterprise.admin.meta; 56 57 import com.sun.enterprise.config.ConfigBean; 58 import com.sun.enterprise.config.ConfigContextEvent; 59 import com.sun.enterprise.config.ConfigContextEventListener; 60 61 62 public class AdminConfigEventListener implements ConfigContextEventListener 63 { 64 67 public AdminConfigEventListener() 68 { 69 super(); 70 } 71 72 public void preAccessNotification(ConfigContextEvent ccce) {} 74 public void postAccessNotification(ConfigContextEvent ccce) {} 75 public void preChangeNotification(ConfigContextEvent ccce) {} 76 77 80 public void postChangeNotification(ConfigContextEvent event) 81 { 82 boolean bAdded; 83 if((event.getType()).equals(event.POST_DELETE_CHANGE)) 85 bAdded = false; 86 else if((event.getType()).equals(event.POST_ADD_CHANGE)) 87 bAdded = true; 88 else if((event.getType()).equals(event.POST_SET_CHANGE)) 89 bAdded = true; 90 else 91 return; 92 Object bean = event.getObject(); 95 if(bean instanceof ConfigBean) 96 { 97 String domainName = MBeanRegistryFactory.getAdminContext().getDomainName(); 98 if(bAdded) 99 MBeanRegistryFactory.getAdminMBeanRegistry().adoptConfigBeanAdd((ConfigBean)bean, domainName); 100 else 101 MBeanRegistryFactory.getAdminMBeanRegistry().adoptConfigBeanDelete((ConfigBean)bean, domainName); 102 } 103 } 104 } 105 | Popular Tags |