1 23 package com.sun.enterprise.management.config; 24 25 26 import java.util.Map ; 27 28 import javax.management.AttributeList ; 29 import javax.management.ObjectName ; 30 31 import com.sun.appserv.management.base.Util; 32 33 import com.sun.enterprise.management.support.oldconfig.OldApplicationsConfigMBean; 34 35 36 public final class LifecycleModuleConfigFactory extends ConfigFactory 37 { 38 public 39 LifecycleModuleConfigFactory( final ConfigFactoryCallback callbacks ) 40 { 41 super( callbacks ); 42 } 43 44 private static final String CLASSNAME_KEY = "class-name"; 45 private static final String CLASSPATH_KEY = "classpath"; 46 private static final String ENABLED_KEY = "enabled"; 47 private static final String LOAD_ORDER_KEY = "load-order"; 48 private static final String IS_FAILURE_FATAL_KEY = "is-failure-fatal"; 49 private static final String DESCRIPTION_KEY = "description"; 50 51 52 private OldApplicationsConfigMBean 53 getOldApplicationsConfigMBean() 54 { 55 return getOldConfigProxies().getOldApplicationsConfigMBean(); 56 } 57 58 61 protected ObjectName createOldChildConfig( 62 final AttributeList translatedAttrs ) 63 { 64 65 trace( "LifecycleModuleConfigFactory.createOldChildConfig: creating using: " + 66 stringify( translatedAttrs ) ); 67 68 final ObjectName objectName = 69 getOldApplicationsConfigMBean().createLifecycleModule(translatedAttrs); 70 71 return( objectName ); 72 } 73 74 79 public ObjectName 80 create( 81 final String name, 82 final String description, 83 final String classname, 84 final String classpath, 85 final String loadOrder, 86 final boolean isFailureFatal, 87 final boolean enabled, 88 final Map <String ,String > reserved ) 89 { 90 final String [] requiredParams = 91 { 92 DESCRIPTION_KEY, (description == null ? "" : description), 93 CLASSNAME_KEY, classname, 94 CLASSPATH_KEY, (classpath == null ? "" : classpath), 95 LOAD_ORDER_KEY, loadOrder, 96 IS_FAILURE_FATAL_KEY, "" + isFailureFatal, 97 ENABLED_KEY, "" + enabled, 98 }; 99 100 final Map <String ,String > params = 101 initParams( name, requiredParams, reserved ); 102 103 final ObjectName amxName = createNamedChild( name, params ); 104 return( amxName ); 105 } 106 107 108 113 public void internalRemove( final ObjectName objectName ) 114 { 115 final String name = Util.getName( objectName ); 116 117 getOldApplicationsConfigMBean().removeLifecycleModuleByName( name ); 118 } 119 } 120 121 122 123 | Popular Tags |