FileDocCategorySizeDatePackage
CustomResourceConfigFactory.javaAPI DocGlassfish v2 API4533Fri May 04 22:23:18 BST 2007com.sun.enterprise.management.config

CustomResourceConfigFactory

public final class CustomResourceConfigFactory extends ResourceFactoryImplBase

Fields Summary
public static final String
RES_TYPE_KEY
public static final String
FACTORY_CLASS_KEY
Constructors Summary
public CustomResourceConfigFactory(ConfigFactoryCallback callbacks)

		super( callbacks );
	
Methods Summary
public javax.management.ObjectNamecreate(java.lang.String jndiName, java.lang.String resType, java.lang.String factoryClass, java.util.Map optional)
Creates a new custom resource.

param
jndiName
param
resType
param
factoryClass
param
optional

	
	 	     		  	  	  	   	 
	  
		 
		 
		 
		 
	
		final String[] requiredParams = new String[]
		{
			RES_TYPE_KEY,       resType,
			FACTORY_CLASS_KEY,  factoryClass,
		};
                
		final Map<String,String> params	= initParams( jndiName, requiredParams, optional );
		
		final ObjectName	amxName = createNamedChild( jndiName, params );
		
		return( amxName );	
	
protected javax.management.ObjectNamecreateOldChildConfig(javax.management.AttributeList translatedAttrs)
The caller is responsible for dealing with any Properties.

		trace( "CustomResourceConfigFactory.createOldChildConfig: creating using: " +
			stringify( translatedAttrs ) );
			
		final ObjectName	objectName	=
				getOldResourcesMBean().createCustomResource( translatedAttrs );

		return objectName;
	
protected java.util.MapgetParamNameOverrides()

		return( MapUtil.newMap( CONFIG_NAME_KEY, "jndi-name" ) );
	
protected voidremoveByName(java.lang.String name)

	    final Set<ResourceRefConfig> refs   =
	        findAllRefConfigs( XTypes.CUSTOM_RESOURCE_CONFIG, name );
	    
	    if ( refs.size() == 0 )
	    {
		    getOldResourcesMBean().removeCustomResourceByJndiName( name );
	    }
	    else
	    {
    	    for( final ResourceRefConfig ref : refs )
    	    {
    	        final String target = ref.getContainer().getName();
		        getOldResourcesMBean().deleteCustomResource( name, target );
    	    }
		}