1 23 package com.sun.enterprise.util; 24 25 import com.sun.enterprise.util.i18n.StringManager; 26 import com.sun.enterprise.util.OS; 27 28 public class SystemPropertyConstants 29 { 30 31 34 public static final String UNIX_ASENV_FILENAME = "asenv.conf"; 35 36 39 public static final String WINDOWS_ASENV_FILENAME = "asenv.bat"; 40 41 44 public static final String WEB_SERVICES_LIB_PROPERTY = 45 "com.sun.aas.webServicesLib"; 46 47 50 public static final String PERL_ROOT_PROPERTY = "com.sun.aas.perlRoot"; 51 52 55 public static final String IMQ_LIB_PROPERTY = "com.sun.aas.imqLib"; 56 57 60 public static final String IMQ_BIN_PROPERTY = "com.sun.aas.imqBin"; 61 62 65 public static final String CONFIG_ROOT_PROPERTY = "com.sun.aas.configRoot"; 66 67 70 public static final String INSTALL_ROOT_PROPERTY = 71 "com.sun.aas.installRoot"; 72 73 76 public static final String JAVA_ROOT_PROPERTY = "com.sun.aas.javaRoot"; 77 78 81 public static final String ICU_LIB_PROPERTY = "com.sun.aas.icuLib"; 82 83 86 public static final String DEFAULT_LOCALE_PROPERTY = 87 "com.sun.aas.defaultLocale"; 88 89 92 public static final String DOMAINS_ROOT_PROPERTY = 93 "com.sun.aas.domainsRoot"; 94 95 98 public static final String INSTANCE_ROOT_PROPERTY = 99 "com.sun.aas.instanceRoot"; 100 101 104 public static final String WEBCONSOLE_LIB_PROPERTY = 105 "com.sun.aas.webconsoleLib"; 106 public static final String WEBCONSOLE_APP_PROPERTY = 107 "com.sun.aas.webconsoleApp"; 108 109 public static final String JATO_ROOT_PROPERTY = 110 "com.sun.aas.jatoRoot"; 111 112 public static final String ANT_ROOT_PROPERTY = "com.sun.aas.antRoot"; 113 114 public static final String ANT_LIB_PROPERTY = "com.sun.aas.antLib"; 115 116 public static final String JHELP_ROOT_PROPERTY = "com.sun.aas.jhelpRoot"; 117 118 119 public static final String SERVER_NAME = "com.sun.aas.instanceName"; 120 121 122 public static final String CLUSTER_NAME = "com.sun.aas.clusterName"; 123 124 125 public static final String HADB_ROOT_PROPERTY = "com.sun.aas.hadbRoot"; 126 127 public static final String NSS_ROOT_PROPERTY = "com.sun.aas.nssRoot"; 128 129 public static final String NSS_BIN_PROPERTY = "com.sun.aas.nssBin"; 130 131 public static final String NATIVE_LAUNCHER = "com.sun.aas.nativeLauncher"; 132 public static final String NATIVE_LAUNCHER_LIB_PREFIX = "com.sun.aas.nativeLauncherLibPrefix"; 133 134 public static final String KEYSTORE_PROPERTY = "javax.net.ssl.keyStore"; 135 public static final String KEYSTORE_PASSWORD_PROPERTY = "javax.net.ssl.keyStorePassword"; 136 137 public static final String TRUSTSTORE_PROPERTY = "javax.net.ssl.trustStore"; 138 public static final String TRUSTSTORE_PASSWORD_PROPERTY = "javax.net.ssl.trustStorePassword"; 139 140 public static final String NSS_DB_PROPERTY = "com.sun.appserv.nss.db"; 141 142 public static final String NSS_DB_PASSWORD_PROPERTY = "com.sun.appserv.nss.db.password"; 143 144 public static final String CLIENT_TRUSTSTORE_PROPERTY = 145 TRUSTSTORE_PROPERTY; 146 148 public static final String CLIENT_TRUSTSTORE_PASSWORD_PROPERTY = 149 TRUSTSTORE_PASSWORD_PROPERTY; 150 152 public static final String DEFAULT_SERVER_INSTANCE_NAME = "server"; 153 154 public static final String JDMK_HOME_PROPERTY="com.sun.aas.jdmkHome"; 155 156 public static final String DERBY_ROOT_PROPERTY="com.sun.aas.derbyRoot"; 157 158 159 public static final String MFWK_HOME_PROPERTY="com.sun.aas.mfwkHome"; 160 161 165 166 public static final String DOMAIN_NAME = "domain.name"; 167 public static final String HOST_NAME_PROPERTY = "com.sun.aas.hostName"; 168 public static final String CONFIG_NAME_PROPERTY = "com.sun.aas.configName"; 169 public static final String DOCROOT_PROPERTY = "docroot"; 170 public static final String ACCESSLOG_PROPERTY = "accesslog"; 171 public static final String DEFAULT_SERVER_SOCKET_ADDRESS="0.0.0.0"; 172 173 private static final StringManager sm = StringManager.getManager(SystemPropertyConstants.class); 174 175 183 public static final String getPropertyAsValue(final String name) { 184 if (name == null) { 185 final String pn = "spc.null_name"; 186 final String pv = "property"; 187 throw new IllegalArgumentException (sm.getString(pn, pv)); 188 } 189 final StringBuffer sb = new StringBuffer (); 190 sb.append(OPEN).append(name).append(CLOSE); 191 return ( sb.toString() ); 192 } 193 194 private static final String OPEN = "${"; 195 private static final String CLOSE = "}"; 196 197 203 public static final String unSystemProperty(final String sp) { 204 if (sp == null) 205 throw new IllegalArgumentException ("null_arg"); 206 String ret = sp; 207 if (isSystemPropertySyntax(sp)) { 208 ret = sp.substring(2, sp.length() - 1); 209 } 210 return ( ret ); 211 } 212 213 public static final boolean isSystemPropertySyntax(final String s) { 214 if ( s == null) 215 throw new IllegalArgumentException ("null_arg"); 216 boolean sp = false; 217 if (s.startsWith(OPEN) && s.endsWith(CLOSE)) 218 sp = true; 219 return ( sp ); 220 } 221 222 227 public static final String getDocRootDefaultValue() { 228 final StringBuffer sb = new StringBuffer (getPropertyAsValue(INSTANCE_ROOT_PROPERTY)); 229 return ( sb.append("/docroot").toString() ); 230 } 231 232 237 public static final String getAccessLogDefaultValue() { 238 final StringBuffer sb = new StringBuffer (getPropertyAsValue(INSTANCE_ROOT_PROPERTY)); 239 return ( sb.append("/logs/access").toString() ); 240 } 241 242 252 public static final String getAsAdminScriptLocation() { 253 final StringBuilder sb = new StringBuilder (); 254 final String ext = OS.isWindows() ? OS.WINDOWS_BATCH_FILE_EXTENSION : ""; 255 final String ASADMIN = "asadmin"; 256 final String suffix = new StringBuilder ("bin").append(System.getProperty("file.separator")).append(ASADMIN).append(ext).toString(); 257 sb.append(System.getProperty(SystemPropertyConstants.INSTALL_ROOT_PROPERTY)); 258 final String fs = System.getProperty("file.separator"); 259 if (!sb.toString().endsWith(fs)) 260 sb.append(fs); 261 sb.append(suffix); 262 263 return ( sb.toString() ); 264 } 265 266 } 267 | Popular Tags |