1 23 24 package com.sun.enterprise.admin.servermgmt.pe; 25 26 import java.io.File ; 27 28 import com.sun.enterprise.admin.util.TokenValue; 29 import com.sun.enterprise.admin.util.TokenValueSet; 30 import com.sun.enterprise.admin.servermgmt.DomainConfig; 31 import com.sun.enterprise.admin.servermgmt.pe.PEFileLayout; 32 33 36 public final class PEScriptsTokens 37 { 38 public static final String CONFIG_HOME = "CONFIG_HOME"; 39 public static final String INSTANCE_ROOT = "INSTANCE_ROOT"; 40 public static final String SERVER_NAME = "SERVER_NAME"; 41 public static final String DOMAIN_NAME = "DOMAIN_NAME"; 42 43 48 public static TokenValueSet getTokenValueSet(DomainConfig domainConfig) 49 { 50 final PEFileLayout layout = new PEFileLayout(domainConfig); 51 52 final TokenValueSet tokens = new TokenValueSet(); 53 54 final String configRootDir = domainConfig.getConfigRoot(); 55 TokenValue tv = new TokenValue(CONFIG_HOME, configRootDir); 56 tokens.add(tv); 57 58 final String instanceRoot = 59 layout.getRepositoryDir().getAbsolutePath(); 60 tv = new TokenValue(INSTANCE_ROOT, instanceRoot); 61 tokens.add(tv); 62 63 final String instanceName = (String )domainConfig.get(DomainConfig.K_SERVERID); 64 if((instanceName == null) || (instanceName.equals(""))) 65 tv = new TokenValue(SERVER_NAME, PEFileLayout.DEFAULT_INSTANCE_NAME); 66 else 67 tv = new TokenValue(SERVER_NAME, instanceName); 68 tokens.add(tv); 69 70 tv = new TokenValue(DOMAIN_NAME, domainConfig.getDomainName()); 71 tokens.add(tv); 72 73 return ( tokens ); 74 } 75 } 76 | Popular Tags |