1 23 package com.sun.enterprise.management.config; 24 25 import java.util.Map ; 26 import java.util.HashMap ; 27 import java.util.Set ; 28 29 import javax.management.ObjectName ; 30 import javax.management.AttributeList ; 31 32 33 import com.sun.appserv.management.config.WebServiceEndpointConfig; 34 import com.sun.appserv.management.config.WebServiceEndpointConfigKeys; 35 import com.sun.appserv.management.util.misc.GSetUtil; 36 import com.sun.appserv.management.base.Util; 37 38 import com.sun.appserv.management.util.misc.TypeCast; 39 40 41 final class WebServiceEndpointConfigFactory extends ConfigFactory 42 { 43 public 44 WebServiceEndpointConfigFactory( 45 final ConfigFactoryCallback callbacks ) 46 { 47 super( callbacks ); 48 } 49 50 private final Set <String > LEGAL_OPTIONAL_KEYS = 51 GSetUtil.newUnmodifiableStringSet( 52 WebServiceEndpointConfigKeys.MONITORING_LEVEL_KEY, 53 WebServiceEndpointConfigKeys.JBI_ENABLED_KEY, 54 WebServiceEndpointConfigKeys.MAX_HISTORY_SIZE_KEY 55 ); 56 57 58 protected Set <String > 59 getLegalOptionalCreateKeys() 60 { 61 return( LEGAL_OPTIONAL_KEYS ); 62 } 63 64 protected Map <String ,String > 65 getParamNameOverrides() 66 { 67 Map <String ,String > m = new HashMap <String ,String >(); 68 m.put(WebServiceEndpointConfigKeys.MONITORING_LEVEL_KEY, "Monitoring"); 69 m.put(WebServiceEndpointConfigKeys.JBI_ENABLED_KEY, "JbiEnabled"); 70 71 return( m ); 72 } 73 74 77 protected ObjectName 78 createOldChildConfig( 79 final AttributeList translatedAttrs ) 80 { 81 final ObjectName oldObjectName = (ObjectName ) 82 getCallbacks().getDelegate().invoke( 83 CREATE_WEB_SERVICE_ENDPOINT, new Object [] { translatedAttrs }, 84 CREATE_WEB_SERVICE_ENDPOINT_SIG ); 85 86 return oldObjectName; 87 88 } 89 90 public ObjectName 91 create( 92 final String name, 93 final Map <String ,String > optional ) 94 { 95 final Map <String ,String > params = initParams(name, null, optional); 96 97 trace( "params as processed: " + stringify( params ) ); 98 99 final ObjectName amxName = createChild( params ); 100 101 return( amxName ); 102 } 103 104 105 public void 106 internalRemove( final ObjectName wseConfigObjectName ) 107 { 108 final String name = Util.getName( wseConfigObjectName ); 109 110 getCallbacks().getDelegate().invoke( REMOVE_WEB_SERVICE_ENDPOINT, new 111 Object [] { name }, REMOVE_WEB_SERVICE_ENDPOINT_SIG ); 112 getCallbacks().sendConfigRemovedNotification( wseConfigObjectName ); 113 } 114 115 116 private static final String CREATE_WEB_SERVICE_ENDPOINT = 117 "createWebServiceEndpoint"; 118 private static final String [] CREATE_WEB_SERVICE_ENDPOINT_SIG = new String [] { AttributeList .class.getName() }; 119 private static final String REMOVE_WEB_SERVICE_ENDPOINT = 120 "removeWebServiceEndpointByName"; 121 private static final String [] REMOVE_WEB_SERVICE_ENDPOINT_SIG = 122 new String [] { String .class.getName() }; 123 124 125 } 126 127 128 129 130 131 | Popular Tags |