FileDocCategorySizeDatePackage
MailResourceConfigFactory.javaAPI DocGlassfish v2 API5437Fri May 04 22:23:20 BST 2007com.sun.enterprise.management.config

MailResourceConfigFactory

public final class MailResourceConfigFactory extends ResourceFactoryImplBase

Fields Summary
private final Set
LEGAL_OPTIONAL_KEYS
public static final String
HOST_KEY
public static final String
USER_KEY
public static final String
FROM_KEY
Constructors Summary
public MailResourceConfigFactory(ConfigFactoryCallback callbacks)

		super( callbacks );
	
Methods Summary
public javax.management.ObjectNamecreate(java.lang.String jndiName, java.lang.String host, java.lang.String user, java.lang.String from, java.util.Map optional)
Create a new <mail-resource>

param
jndiName
param
host
param
user
param
from
param
optional

		final String[] requiredParams = new String[]
		{
		HOST_KEY,       host,
		USER_KEY,       user,
		FROM_KEY,       from,
		};
		    
		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( "MailResourceConfigFactory.createOldChildConfig: creating using: " +
			stringify( translatedAttrs ) );
			
		final ObjectName	objectName	=
				getOldResourcesMBean().createMailResource( translatedAttrs );
		
		return( objectName );
	
protected java.util.SetgetLegalOptionalCreateKeys()

	
	     
	
	
		return( LEGAL_OPTIONAL_KEYS );
	
protected java.util.MapgetParamNameOverrides()

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

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