FileDocCategorySizeDatePackage
PEScriptsTokens.javaAPI DocGlassfish v2 API3787Fri May 04 22:24:32 BST 2007com.sun.enterprise.admin.servermgmt.pe

PEScriptsTokens

public final class PEScriptsTokens extends Object
This class defines the tokens required by the startserv & stopserv scripts.

Fields Summary
public static final String
CONFIG_HOME
public static final String
INSTANCE_ROOT
public static final String
SERVER_NAME
public static final String
DOMAIN_NAME
Constructors Summary
Methods Summary
public static com.sun.enterprise.admin.util.TokenValueSetgetTokenValueSet(com.sun.enterprise.admin.servermgmt.DomainConfig domainConfig)

return
Returns the TokenValueSet that has the (token, value) pairs for startserv & stopserv scripts.
param
domainConfig


                               
        
    
        final PEFileLayout layout = new PEFileLayout(domainConfig);

        final TokenValueSet tokens = new TokenValueSet();

        final String configRootDir = domainConfig.getConfigRoot();            
        TokenValue tv = new TokenValue(CONFIG_HOME, configRootDir);
        tokens.add(tv);

        final String instanceRoot = 
            layout.getRepositoryDir().getAbsolutePath();
        tv = new TokenValue(INSTANCE_ROOT, instanceRoot);
        tokens.add(tv);

        final String instanceName = (String)domainConfig.get(DomainConfig.K_SERVERID);
        if((instanceName == null) || (instanceName.equals("")))
            tv = new TokenValue(SERVER_NAME, PEFileLayout.DEFAULT_INSTANCE_NAME);
        else
            tv = new TokenValue(SERVER_NAME, instanceName);
        tokens.add(tv);

        tv = new TokenValue(DOMAIN_NAME, domainConfig.getDomainName());
        tokens.add(tv);

        return ( tokens );