1 23 package com.sun.enterprise.management.config; 24 25 import java.util.Map ; 26 27 import javax.management.ObjectName ; 28 import javax.management.AttributeList ; 29 30 import com.sun.appserv.management.base.XTypes; 31 import com.sun.appserv.management.base.AMX; 32 import com.sun.appserv.management.base.Util; 33 34 import com.sun.appserv.management.config.ManagementRuleConfig; 35 import com.sun.appserv.management.config.ActionConfig; 36 37 import com.sun.enterprise.management.support.oldconfig.OldManagementRules; 38 39 40 42 public final class ActionConfigFactory extends ConfigFactory 43 { 44 public 45 ActionConfigFactory( final ConfigFactoryCallback callbacks ) 46 { 47 super( callbacks ); 48 } 49 50 private OldManagementRules 51 getOldManagementRules() 52 { 53 return getOldConfigProxies().getOldManagementRules( getConfigName() ); 54 } 55 56 public ObjectName 57 create( final String mbeanName ) 58 { 59 final ManagementRuleConfig ruleConfig = 60 (ManagementRuleConfig)getFactoryContainer(); 61 62 final String ruleName = ruleConfig.getName(); 63 64 getOldManagementRules().addActionToManagementRule( ruleName, mbeanName ); 65 66 ActionConfig actionConfig = null; 68 while ( (actionConfig = ruleConfig.getActionConfig()) == null ) 69 { 70 sleepMillis( 10 ); 71 } 72 73 final ObjectName amxObjectName = Util.getObjectName( actionConfig ); 74 getCallbacks().sendConfigCreatedNotification( amxObjectName ); 75 76 return amxObjectName; 77 } 78 79 protected void 80 internalRemove(final ObjectName objectName) 81 { 82 throw new RuntimeException ( "not supported" ); 83 } 84 } 85 86 87 88 89 | Popular Tags |