1 23 package com.sun.enterprise.management.config; 24 25 import java.util.Set ; 26 import java.util.Collections ; 27 28 import javax.management.ObjectName ; 29 30 import com.sun.appserv.management.base.Util; 31 import com.sun.appserv.management.config.Description; 32 33 import com.sun.appserv.management.util.misc.GSetUtil; 34 35 import com.sun.appserv.management.config.ResourceConfigKeys; 36 import com.sun.appserv.management.config.ResourceRefConfig; 37 import com.sun.appserv.management.config.ResourceRefConfigReferent; 38 39 import com.sun.appserv.management.helper.RefHelper; 40 41 42 44 45 abstract class ResourceFactoryImplBase extends ConfigFactory 46 { 47 public 48 ResourceFactoryImplBase( final ConfigFactoryCallback callbacks ) 49 { 50 super( callbacks ); 51 } 52 53 54 public static final String RESOURCE_TYPE_KEY = "ResType"; 55 public static final String RESOURCE_ADAPTER_KEY = "ResAdapter"; 56 57 58 public final void 59 internalRemove( final ObjectName objectName ) 60 { 61 final String name = Util.getName( objectName ); 62 removeByName( name ); 63 } 64 65 protected abstract void removeByName( final String name ); 66 67 68 private final Set <String > RESOURCE_DEFAULT_LEGAL_OPTIONAL_KEYS = 69 GSetUtil.newUnmodifiableStringSet( 70 Description.DESCRIPTION_KEY, 71 ResourceConfigKeys.ENABLED_KEY 72 ); 73 74 75 78 protected Set <String > 79 getLegalOptionalCreateKeys() 80 { 81 return( RESOURCE_DEFAULT_LEGAL_OPTIONAL_KEYS ); 82 } 83 84 protected Set <ResourceRefConfig> 85 findAllRefConfigs( 86 final String j2eeType, 87 final String name ) 88 { 89 final ResourceRefConfigReferent item = (ResourceRefConfigReferent) 90 requireItem( j2eeType, name ); 91 92 return RefHelper.findAllRefConfigs( item ); 93 } 94 } 95 96 | Popular Tags |