FileDocCategorySizeDatePackage
JavaConfigConfigBeanHelper.javaAPI DocGlassfish v2 API5082Fri May 04 22:23:40 BST 2007com.sun.enterprise.management.offline

JavaConfigConfigBeanHelper

public final class JavaConfigConfigBeanHelper extends StdConfigBeanHelper

Fields Summary
private static final String
JVM_OPTIONS_ATTR
Constructors Summary
public JavaConfigConfigBeanHelper(com.sun.enterprise.config.ConfigContext configContext, com.sun.enterprise.config.ConfigBean configBean)

    
        
    
          
              
    
        super( configContext, configBean );
        
    
Methods Summary
protected java.util.Set_getAttributeNames()

        final Set<String>   attrNames = super._getAttributeNames();
        
        if ( hasJVMOptions() )
        {
            attrNames.add( JVM_OPTIONS_ATTR );
        }
        
        return attrNames;
    
public java.lang.ObjectgetAttribute(java.lang.String attrName)

        Object  result  = null;
        
        if ( JVM_OPTIONS_ATTR.equals( attrName ) )
        {
            result  = getJVMOptions();
        }
        else
        {
            result  = super.getAttribute( attrName );
	    }
	    return result;
    
protected java.lang.ClassgetAttributeClass(java.lang.String attrName)

        Class  result  = null;
        
        if ( JVM_OPTIONS_ATTR.equals( attrName ) )
        {
            result  = String[].class;
        }
        else
        {
            result  = super.getAttributeClass( attrName );
	    }
	    return result;
    
public java.lang.String[]getJVMOptions()

        // presumably spaces are not allowed in a JVM option
        final String[]  result  = getJavaConfigConfigBean().getJvmOptions();
        
        return result;
    
private com.sun.enterprise.config.serverbeans.JavaConfiggetJavaConfigConfigBean()

        return (com.sun.enterprise.config.serverbeans.JavaConfig)
            getConfigBean();
    
private booleanhasJVMOptions()

        return hasValue( JVM_OPTIONS_ATTR );
    
public voidsetAttribute(java.lang.String name, java.lang.Object value)

        if ( JVM_OPTIONS_ATTR.equals( name ) )
        {
            setJVMOptions( (String[])value );
        }
        else
        {
    	    super.setAttribute( name, value );
    	}
    
public voidsetJVMOptions(java.lang.String[] optionsIn)

        // ensure no duplicates
        final Set<String>   optionsSet    = GSetUtil.newUnmodifiableStringSet( optionsIn );
        final String[]  options = GSetUtil.toStringArray( optionsSet );
        Arrays.sort( options );
        
        getJavaConfigConfigBean().setJvmOptions( options );