Fields Summary |
---|
protected static final String | HADB_CONNECTION_URL_PREFIXThe prefix for the HADB connection url |
protected static final String | CLUSTER_ID_PROPERTY_NAMEThe property name into domain.xml to obtain
the cluster-id string
Note: all instances in a cluster must have the same
cluster-id defined at this location in server.xml
7.0 xpath was "/server/availability-service/persistence-store/property[@name='cluster-id']"; |
protected static final String | STALE_SESSION_CHECKING_ENABLED_PROPERTY_NAMEThe property name into domain.xml to obtain
the stale-session-checking-enabled string |
protected static final String | DEFAULT_CLUSTER_IDThe default cluster-id if none is defined in domain.xml
Note: the default is ok if only one cluster is being serviced
by an instance of HADB; if not then each cluster needs its
own unique cluster-id and each instance must have it correctly
defined in its server.xml |
protected static final String | HADB_STORE_POOL_JNDI_NAME_PROPERTY_NAMEThe xpath expression into domain.xml to obtain
the hadb-store-pool-jndi-name string
7.0 xpath was "/server/availability-service/persistence-store/property[@name='store-pool-jndi-name']"; |
protected static final String | DEFAULT_STORE_POOL_JNDI_NAMEThe default store-pool-jndi-name (used by Web Container for
HTTP Persistence to HADB |
protected static final String | HADB_MGMT_ENV_PATH_PROPERTY_NAMEThe xpath expression into server.xml to obtain
the hadb-mgmt-env-path string
7.0 xpath was "/server/availability-service/persistence-store/property[@name='hadb-mgmt-env-path']" |
protected static final String | HADB_DATABASE_NAME_PROPERTY_NAMEThe property name in domain.xml to obtain
the hadb-database-name string
7.0 xpath was "/server/availability-service/persistence-store/property[@name='hadb-database-name']"; |
protected static final String | UUID_GENERATOR_CLASS_PROPERTY_NAMEThe property name into domain.xml to obtain
the UuidGenerator impl class name |
protected static final String | DEFAULT_UUID_GENERATOR_CLASSThe default UuidGenerator class (fully qualified name) |
protected static final String | EE_BUILDER_PATH_PROPERTY_NAMEThe property name in domain.xml to obtain
the EE builder path - this property is not expected
now to change and if it ever did, then the directory
and package structure for the builder classes would
have to change also
7.0 xpath was "/server/availability-service/persistence-store/property[@name='ee-builder-path']" |
protected static final String | DEFAULT_EE_BUILDER_PATHThe default path to the EE persistence strategy builders |
protected static final String | HADB_HEALTH_CHECK_ENABLED_PROPERTY_NAMEThe property name in domain.xml to obtain
the hadb-health-check string
7.0 xpath was "/server/availability-service/persistence-store/property[@name='hadb-health-check-enabled']"; |
protected static final int | DEFAULT_HA_STORE_HEALTHCHECK_INTERVAL_IN_SECONDSThe default value of hadb-healthcheck-interval-in-seconds |
protected static final String | USER_NAMEThe property name in domain.xml to obtain
the user name string in hadb jdbc-connection pool (for http session
persistence) |
protected static final String | PASSWORDThe property name in domain.xml to obtain
the password string in hadb jdbc-connection pool (for http session
persistence) |
protected static final String | HADB_AGENT_PASSWORDThe property name in domain.xml to obtain
the HADB agent password (used for connecting to HADB agent) |
private static final String | NATIVE_REPLICATION_ENABLED |
private static final String | CLUSTER_MEMBERS |
private static final String | NUMBER_OF_PIPES |
private static final String | LATENCY_COUNT |
private static final String | MAX_SESSION_UNLOAD_TIME_IN_SECONDS |
private static final String | REPLICATION_MEASUREMENT_ENABLED |
private static final String | REPLICATION_MEASUREMENT_INTERVAL |
private static final String | WAIT_FOR_ACK_PROPERTY |
private static final String | WAIT_FOR_FAST_ACK_PROPERTY |
protected static final int | DEFAULT_REQUEST_PROCESSING_THREAD_COUNTThe default value of thread-count |
protected com.sun.enterprise.config.ConfigContext | _configContextThe config context passed in via constructor
used when a dynamic config context is needed
rather than usual run-time config context e.g. deployment |
private static final Logger | _loggerThe logger to use for logging ALL web container related messages. |
Methods Summary |
---|
public boolean | calculateWebAvailabilityEnabledFromConfig(java.lang.String contextRoot, java.lang.String j2eeAppName)Get the availability-enabled from domain.xml.
This takes into account:
global
web-container-availability
web-module (if stand-alone)
return false if not found
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("in ServerConfigLookup>>calculateWebAvailabilityEnabledFromConfig");
}
//global availability from <availability-service> element
boolean globalAvailability =
this.getAvailabilityEnabledFromConfig();
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("globalAvailability = " + globalAvailability);
}
//System.out.println("globalAvailability = " + globalAvailability);
//web container availability from <web-container-availability> sub-element
boolean webContainerAvailability =
this.getWebContainerAvailabilityEnabledFromConfig(globalAvailability);
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("webContainerAvailability = " + webContainerAvailability);
}
//System.out.println("webContainerAvailability = " + webContainerAvailability);
//System.out.println("j2eeAppName=" + j2eeAppName);
if(j2eeAppName == null || "null".equals(j2eeAppName)) {
//the stand-alone web module case
boolean webModuleAvailability =
this.getWebModuleAvailability(contextRoot, webContainerAvailability);
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("webModuleAvailability = " + webModuleAvailability);
}
//System.out.println("webModuleAvailability = " + webModuleAvailability);
return globalAvailability
&& webContainerAvailability
&& webModuleAvailability;
} else {
//the j2ee application case
boolean j2eeApplicationAvailability =
this.getJ2eeApplicationAvailability(j2eeAppName, webContainerAvailability);
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("j2eeApplicationAvailability = " + j2eeApplicationAvailability);
}
//System.out.println("j2eeApplicationAvailability = " + j2eeApplicationAvailability);
return globalAvailability
&& webContainerAvailability
&& j2eeApplicationAvailability;
}
|
private void | displayArrayList(java.util.ArrayList list)
System.out.println("DISPLAY CLUSTER MEMBERS");
for(int i=0; i<list.size(); i++) {
System.out.println("clusterMember[" + i + "] = " + list.get(i));
}
|
private com.sun.enterprise.config.serverbeans.Applications | getApplicationsBean()Get the applications element from domain.xml.
return null if not found
Applications applicationsBean = null;
Domain domainBean = null;
/*
ServerContext serverCtx = ApplicationServer.getServerContext();
ConfigContext configCtx = serverCtx.getConfigContext();
*/
ConfigContext configCtx = this.getConfigContext();
try {
domainBean = ServerBeansFactory.getDomainBean(configCtx);
if(domainBean != null) {
applicationsBean = domainBean.getApplications();
}
} catch (ConfigException ex) {}
return applicationsBean;
|
private com.sun.enterprise.config.serverbeans.Applications | getApplicationsBeanDynamic()Get the applications element from domain.xml.
return null if not found
Applications applicationsBean = null;
Domain domainBean = null;
/*
ServerContext serverCtx = ApplicationServer.getServerContext();
ConfigContext configCtx = serverCtx.getConfigContext();
*/
ConfigContext configCtx = this.getConfigContextDynamic();
try {
domainBean = ServerBeansFactory.getDomainBean(configCtx);
if(domainBean != null) {
applicationsBean = domainBean.getApplications();
}
} catch (ConfigException ex) {}
return applicationsBean;
|
public boolean | getAvailabilityEnabledFromConfig()Get the availability-enabled from domain.xml.
return false if not found
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("in ServerConfigLookup>>getAvailabilityEnabledFromConfig");
}
AvailabilityService as = this.getAvailabilityService();
if(as == null) {
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("AvailabilityService was not defined - check domain.xml");
}
return false;
}
return as.isAvailabilityEnabled();
|
protected com.sun.enterprise.config.serverbeans.AvailabilityService | getAvailabilityService()Get the availability-service element from domain.xml.
return null if not found
Config configBean = this.getConfigBean();
if(configBean == null) {
return null;
}
return configBean.getAvailabilityService();
|
protected com.sun.enterprise.config.serverbeans.AvailabilityService | getAvailabilityServiceDynamic()Get the availability-service element from domain.xml.
return null if not found
Config configBean = this.getConfigBeanDynamic();
if(configBean == null) {
return null;
}
return configBean.getAvailabilityService();
|
public java.lang.String | getAvailabilityServicePropertyString(java.lang.String propName)Get the String value of the property under availability-service
element from domain.xml whose name matches propName
return null if not found
String result = null;
AvailabilityService availabilityServiceBean = this.getAvailabilityService();
if( (availabilityServiceBean != null) && (availabilityServiceBean.sizeElementProperty() > 0) ) {
ElementProperty[] props = availabilityServiceBean.getElementProperty();
for (int i = 0; i < props.length; i++) {
String name = props[i].getAttributeValue("name");
String value = props[i].getAttributeValue("value");
if (name.equalsIgnoreCase(propName)) {
result = value;
}
}
}
return result;
|
public com.sun.enterprise.config.serverbeans.Cluster | getCluster()Get the cluster if the server is in a cluster
return null if not
ConfigContext configCtx = this.getConfigContext();
String serverName = this.getServerName();
boolean isClustered = false;
try {
isClustered = ServerHelper.isServerClustered(configCtx, serverName);
} catch (ConfigException ex) {}
if(!isClustered) {
return null;
}
Cluster cluster = null;
try {
cluster = ClusterHelper.getClusterForInstance(configCtx, serverName);
} catch (ConfigException ex) {}
return cluster;
|
public java.lang.String | getClusterIdFromConfig()Get the cluster-id from domain.xml.
return "cluster1" if not found
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("in ServerConfigLookup>>getClusterIdFromConfig");
}
return this.getWebContainerAvailabilityPropertyString(CLUSTER_ID_PROPERTY_NAME, DEFAULT_CLUSTER_ID);
//return this.getAvailServicePersistenceStorePropertyString(CLUSTER_ID_PROPERTY_NAME, DEFAULT_CLUSTER_ID);
|
java.util.ArrayList | getClusterInstanceNamesList()
ArrayList instanceNames = new ArrayList();
ServerConfigLookup lookup = new ServerConfigLookup();
String instanceNamesString =
lookup.getAvailabilityServicePropertyString(CLUSTER_MEMBERS);
if(instanceNamesString == null) {
return instanceNames;
}
String[] instancesArray = instanceNamesString.split(",");
List instancesList = Arrays.asList(instancesArray);
for(int i=0; i<instancesList.size(); i++) {
//System.out.println("getClusterInstanceNamesList:elem" + i + " = " + ((String)instancesList.get(i)).trim() );
instanceNames.add( ((String)instancesList.get(i)).trim() );
}
return instanceNames;
|
public java.lang.String | getClusterName()Get the cluster name from domain.xml for this server.
return null if not found
String result = null;
/*
ServerContext serverCtx = ApplicationServer.getServerContext();
ConfigContext configCtx = serverCtx.getConfigContext();
*/
ConfigContext configCtx = this.getConfigContext();
String serverName = this.getServerName();
if(serverName == null) {
return result;
}
boolean isClustered = false;
try {
isClustered = ServerHelper.isServerClustered(configCtx, serverName);
} catch (ConfigException ex) {}
if(!isClustered) {
result = serverName + "_nc"; //non-clustered example: server1_nc
return result;
}
Cluster cluster = null;
try {
cluster = ClusterHelper.getClusterForInstance(configCtx, serverName);
} catch (ConfigException ex) {}
if(cluster != null) {
result = cluster.getName();
}
return result;
|
private com.sun.enterprise.config.serverbeans.Config | getConfigBean()Get the config element from domain.xml.
return null if not found
Config configBean = null;
/*
ServerContext serverCtx = ApplicationServer.getServerContext();
ConfigContext configCtx = serverCtx.getConfigContext();
*/
ConfigContext configCtx = this.getConfigContext();
try {
configBean = ServerBeansFactory.getConfigBean(configCtx);
} catch (ConfigException ex) {}
return configBean;
|
private com.sun.enterprise.config.serverbeans.Config | getConfigBeanDynamic()Get the config element from domain.xml.
return null if not found
Config configBean = null;
ConfigContext configCtx = this.getConfigContextDynamic();
try {
configBean = ServerBeansFactory.getConfigBean(configCtx);
} catch (ConfigException ex) {}
return configBean;
|
protected com.sun.enterprise.config.ConfigContext | getConfigContext()Get the ConfigContext for this server
return null if not found
ServerContext serverCtx = this.getServerContext();
if(serverCtx == null) {
return null;
}
return serverCtx.getConfigContext();
|
protected com.sun.enterprise.config.ConfigContext | getConfigContextDynamic()Get the ConfigContext for this server
return null if not found
if (_configContext != null) {
return _configContext;
} else {
return getConfigContext();
}
|
public java.lang.String | getConnectionPasswordFromConfig()Get the connectionPassword from domain.xml.
String password = null;
JdbcConnectionPool pool = this.getHadbJdbcConnectionPoolFromConfig();
if(pool == null)
return null;
if (pool.sizeElementProperty() > 0) {
ElementProperty[] props = pool.getElementProperty();
for (int i = 0; i < props.length; i++) {
String name = props[i].getAttributeValue("name");
String value = props[i].getAttributeValue("value");
if (name.equalsIgnoreCase(PASSWORD)) {
//if (name.equalsIgnoreCase("password")) {
password = value;
}
}
}
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("IN NEW getConnectionPasswordFromConfig: password=" + password);
}
return password;
|
public java.lang.String | getConnectionURLFromConfig()Get the connectionURL from domain.xml.
String url = null;
StringBuffer sb = new StringBuffer();
JdbcConnectionPool pool = this.getHadbJdbcConnectionPoolFromConfig();
if(pool == null)
return null;
if (pool.sizeElementProperty() > 0) {
ElementProperty[] props = pool.getElementProperty();
for (int i = 0; i < props.length; i++) {
String name = props[i].getAttributeValue("name");
String value = props[i].getAttributeValue("value");
if (name.equalsIgnoreCase("serverList")) {
sb.append(HADB_CONNECTION_URL_PREFIX);
sb.append(value);
url = sb.toString();
}
}
}
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("IN NEW getConnectionURLFromConfig: url=" + url);
}
return url;
|
public java.lang.String | getConnectionUserFromConfig()Get the connectionUser from domain.xml.
String user = null;
JdbcConnectionPool pool = this.getHadbJdbcConnectionPoolFromConfig();
if(pool == null) {
return null;
}
if (pool.sizeElementProperty() > 0) {
ElementProperty[] props = pool.getElementProperty();
for (int i = 0; i < props.length; i++) {
String name = props[i].getAttributeValue("name");
String value = props[i].getAttributeValue("value");
if (name.equalsIgnoreCase(USER_NAME)) {
//if (name.equalsIgnoreCase("username")) {
user = value;
}
}
}
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("IN NEW getConnectionUserFromConfig: user=" + user);
}
return user;
|
public java.lang.String | getEEBuilderPathFromConfig()Get the EE_BUILDER_PATH from server.xml.
this defaults to EE_BUILDER_PATH but can be modified
this is the fully qualified path to the EE builders
7.0 xpath was "/server/availability-service/persistence-store/property[@name='ee-builder-path']"
return this.getWebContainerAvailabilityPropertyString(EE_BUILDER_PATH_PROPERTY_NAME, DEFAULT_EE_BUILDER_PATH);
//return this.getAvailServicePersistenceStorePropertyString(EE_BUILDER_PATH_PROPERTY_NAME, DEFAULT_EE_BUILDER_PATH);
|
public int | getHaStoreHealthcheckIntervalInSecondsFromConfig()Get the ha-store-healthcheck-interval-in-seconds from domain.xml.
returns the attribute ha-store-healthcheck-interval-in-seconds
in
if missing (or error) default to DEFAULT_HA_STORE_HEALTHCHECK_INTERVAL_IN_SECONDS
int candidateReturnValue = -1;
int returnValue
= DEFAULT_HA_STORE_HEALTHCHECK_INTERVAL_IN_SECONDS;
String returnValueString =
this.getHaStoreHealthcheckIntervalInSecondsStringFromConfig();
if(returnValueString != null) {
try
{
candidateReturnValue = (Integer.valueOf(returnValueString)).intValue();
} catch (NumberFormatException ex) {
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("Using Default Value = " + DEFAULT_HA_STORE_HEALTHCHECK_INTERVAL_IN_SECONDS);
}
}
}
//avoid returning negative or zero values
if(candidateReturnValue > 0) {
returnValue = candidateReturnValue;
}
return returnValue;
|
public int | getHaStoreHealthcheckIntervalInSecondsFromConfigDynamic()Get the ha-store-healthcheck-interval-in-seconds from domain.xml.
returns the attribute ha-store-healthcheck-interval-in-seconds
in
if missing (or error) default to DEFAULT_HA_STORE_HEALTHCHECK_INTERVAL_IN_SECONDS
int candidateReturnValue = -1;
int returnValue
= DEFAULT_HA_STORE_HEALTHCHECK_INTERVAL_IN_SECONDS;
String returnValueString =
this.getHaStoreHealthcheckIntervalInSecondsStringFromConfigDynamic();
if(returnValueString != null) {
try
{
candidateReturnValue = (Integer.valueOf(returnValueString)).intValue();
} catch (NumberFormatException ex) {
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("Using Default Value = " + DEFAULT_HA_STORE_HEALTHCHECK_INTERVAL_IN_SECONDS);
}
}
}
//avoid returning negative or zero values
if(candidateReturnValue > 0) {
returnValue = candidateReturnValue;
}
return returnValue;
|
public java.lang.String | getHaStoreHealthcheckIntervalInSecondsStringFromConfig()Get the String value of the ha-store-healthcheck-interval-in-seconds attribute under availability-service
element from domain.xml
return null if not found
AvailabilityService as = this.getAvailabilityService();
if(as == null) {
return null;
}
return as.getHaStoreHealthcheckIntervalInSeconds();
|
public java.lang.String | getHaStoreHealthcheckIntervalInSecondsStringFromConfigDynamic()Get the String value of the ha-store-healthcheck-interval-in-seconds attribute under availability-service
element from domain.xml
return null if not found
AvailabilityService as = this.getAvailabilityServiceDynamic();
if(as == null) {
return null;
}
return as.getHaStoreHealthcheckIntervalInSeconds();
|
public java.lang.String | getHaStorePoolJndiNameFromConfig()Get the store-pool-jndi-name from domain.xml.
return value returned from getStorePoolJndiNameFromConfig if not found
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("in ServerConfigLookup>>getHaStorePoolJndiNameFromConfig");
}
//String result = DEFAULT_STORE_POOL_JNDI_NAME;
String result = this.getStorePoolJndiNameFromConfig();
WebContainerAvailability webContainerAvailabilityBean =
this.getWebContainerAvailability();
if(webContainerAvailabilityBean == null) {
return result;
}
String result2 = webContainerAvailabilityBean.getHttpSessionStorePoolName();
if(result2 != null) {
result = result2;
}
return result;
|
public java.lang.String | getHadbAgentConnectionURLFromConfig()Get the connectionURL for hadb agent(s) from domain.xml.
String url = null;
StringBuffer sb = new StringBuffer();
String hostsString = this.getHadbAgentHostsFromConfig();
String portString = this.getHadbAgentPortFromConfig();
if(hostsString != null && portString != null) {
sb.append(hostsString);
sb.append(":");
sb.append(portString);
url = sb.toString();
} else {
url = null;
}
return url;
|
public java.lang.String | getHadbAgentConnectionURLFromConfigDynamic()Get the connectionURL for hadb agent(s) from domain.xml.
String url = null;
StringBuffer sb = new StringBuffer();
String hostsString = this.getHadbAgentHostsFromConfigDynamic();
String portString = this.getHadbAgentPortFromConfigDynamic();
if(hostsString != null && portString != null) {
sb.append(hostsString);
sb.append(":");
sb.append(portString);
url = sb.toString();
} else {
url = null;
}
return url;
|
public java.lang.String | getHadbAgentHostsFromConfig()Get the String value of the ha-agent-hosts attribute under availability-service
element from domain.xml
return null if not found
AvailabilityService as = this.getAvailabilityService();
if(as == null) {
return null;
}
return as.getHaAgentHosts();
|
public java.lang.String | getHadbAgentHostsFromConfigDynamic()Get the String value of the ha-agent-hosts attribute under availability-service
element from domain.xml
return null if not found
AvailabilityService as = this.getAvailabilityServiceDynamic();
if(as == null) {
return null;
}
return as.getHaAgentHosts();
|
public java.lang.String | getHadbAgentPasswordFromConfig()Get the String value of the ha-agent-password attribute under availability-service
element from domain.xml
return null if not found
AvailabilityService as = this.getAvailabilityService();
if(as == null) {
return null;
}
return as.getHaAgentPassword();
|
public java.lang.String | getHadbAgentPortFromConfig()Get the String value of the ha-agent-port attribute under availability-service
element from domain.xml
return null if not found
AvailabilityService as = this.getAvailabilityService();
if(as == null) {
return null;
}
return as.getHaAgentPort();
|
public java.lang.String | getHadbAgentPortFromConfigDynamic()Get the String value of the ha-agent-port attribute under availability-service
element from domain.xml
return null if not found
AvailabilityService as = this.getAvailabilityServiceDynamic();
if(as == null) {
return null;
}
return as.getHaAgentPort();
|
public java.lang.String | getHadbDatabaseNameFromConfig()Get the String value of the ha-store-name attribute under availability-service
element from domain.xml
return null if not found
AvailabilityService as = this.getAvailabilityService();
if(as == null) {
return null;
}
return as.getHaStoreName();
|
public java.lang.String | getHadbDatabaseNameFromConfigDynamic()Get the String value of the ha-store-name attribute under availability-service
element from domain.xml
return null if not found
AvailabilityService as = this.getAvailabilityServiceDynamic();
if(as == null) {
return null;
}
return as.getHaStoreName();
|
public boolean | getHadbHealthCheckFromConfig()Get the hadb health check string from domain.xml.
7.0 xpath was "/server/availability-service/persistence-store/property[@name='hadb-health-check-enabled']"
returns the attribute ha-store-healthcheck-enabled in
AvailabilityService as = this.getAvailabilityService();
if(as == null) {
return false;
}
return as.isHaStoreHealthcheckEnabled();
|
public boolean | getHadbHealthCheckFromConfigDynamic()Get the hadb health check string from domain.xml.
7.0 xpath was "/server/availability-service/persistence-store/property[@name='hadb-health-check-enabled']"
returns the attribute ha-store-healthcheck-enabled in
AvailabilityService as = this.getAvailabilityServiceDynamic();
if(as == null) {
return false;
}
return as.isHaStoreHealthcheckEnabled();
|
public com.sun.enterprise.config.serverbeans.JdbcConnectionPool | getHadbJdbcConnectionPoolFromConfig()Get the JdbcConnectionPool for HADB from domain.xml.
return null if not found
String storePoolJndiName = this.getHaStorePoolJndiNameFromConfig();
if(storePoolJndiName == null)
return null;
Resources resources = this.getResourcesBean();
JdbcResource jdbcResource =
resources.getJdbcResourceByJndiName(storePoolJndiName);
if(jdbcResource == null) {
return null;
}
String poolName = jdbcResource.getPoolName();
JdbcConnectionPool pool =
resources.getJdbcConnectionPoolByName(poolName);
return pool;
|
public java.lang.String | getHadbJdbcConnectionPoolNameFromConfig()Get the JdbcConnectionPool name for HADB from domain.xml.
String storePoolJndiName = this.getHaStorePoolJndiNameFromConfig();
if(storePoolJndiName == null)
return null;
Resources resources = this.getResourcesBean();
JdbcResource jdbcResource =
resources.getJdbcResourceByJndiName(storePoolJndiName);
if(jdbcResource == null)
return null;
String poolName = jdbcResource.getPoolName();
return poolName;
|
public java.lang.String | getHadbMgmtEnvPathFromConfig()Get the hadb management environment path from domain.xml.
this is the location of cladm
7.0 xpath was "/server/availability-service/persistence-store/property[@name='hadb-mgmt-env-path']"
return this.getWebContainerAvailabilityPropertyString(HADB_MGMT_ENV_PATH_PROPERTY_NAME, null);
//return this.getAvailServicePersistenceStorePropertyString(HADB_MGMT_ENV_PATH_PROPERTY_NAME, null);
|
protected com.sun.enterprise.config.serverbeans.HttpService | getHttpService()Get the http-service element from domain.xml.
return null if not found
Config configBean = this.getConfigBean();
if(configBean == null) {
return null;
}
return configBean.getHttpService();
|
public com.sun.enterprise.config.serverbeans.SessionManager | getInstanceSessionManager()Get the session manager bean from domain.xml
return null if not defined or other problem
7.0 xpath was "/server/web-container/session-config/session-manager";
Config configBean = this.getConfigBean();
if(configBean == null) {
return null;
}
com.sun.enterprise.config.serverbeans.WebContainer webContainerBean
= configBean.getWebContainer();
if(webContainerBean == null) {
return null;
}
SessionConfig sessionConfigBean = webContainerBean.getSessionConfig();
if(sessionConfigBean == null) {
return null;
}
com.sun.enterprise.config.serverbeans.SessionManager smBean =
sessionConfigBean.getSessionManager();
return smBean;
|
public com.sun.enterprise.config.serverbeans.ManagerProperties | getInstanceSessionManagerManagerProperties()Get the manager properties bean from domain.xml
return null if not defined or other problem
7.0 xpath was "/server/web-container/session-config/session-manager/manager-properties";
SessionManager smBean = this.getInstanceSessionManager();
if(smBean == null) {
return null;
}
return smBean.getManagerProperties();
|
public com.sun.enterprise.config.serverbeans.StoreProperties | getInstanceSessionManagerStoreProperties()Get the store properties bean from domain.xml
return null if not defined or other problem
7.0 xpath was "/server/web-container/session-config/session-manager/store-properties";
SessionManager smBean = this.getInstanceSessionManager();
if(smBean == null) {
return null;
}
return smBean.getStoreProperties();
|
public com.sun.enterprise.config.serverbeans.SessionProperties | getInstanceSessionProperties()Get the session properties bean from server.xml
return null if not defined or other problem
7.0 xpath was "/server/web-container/session-config/session-properties";
Config configBean = this.getConfigBean();
if(configBean == null) {
return null;
}
com.sun.enterprise.config.serverbeans.WebContainer webContainerBean
= configBean.getWebContainer();
if(webContainerBean == null) {
return null;
}
SessionConfig sessionConfigBean = webContainerBean.getSessionConfig();
if(sessionConfigBean == null) {
return null;
}
com.sun.enterprise.config.serverbeans.SessionProperties spBean =
sessionConfigBean.getSessionProperties();
return spBean;
|
private boolean | getJ2eeApplicationAvailability(java.lang.String appName, boolean inheritedValue)
J2eeApplication j2eeApp =
this.getJ2eeApplicationByName(appName);
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("ServerConfigLookup>>getJ2eeApplicationAvailability j2eeApp = " + j2eeApp);
}
//System.out.println("ServerConfigLookup>>getJ2eeApplicationAvailability j2eeApp = " + j2eeApp);
if(j2eeApp == null) {
//FIXME remove after testing - protection if called in web module case
//return inheritedValue;
return false;
}
/*
String appString = j2eeApp.getAvailabilityEnabled();
Boolean bool = this.toBoolean(appString);
if(bool == null) {
return inheritedValue;
} else {
return bool.booleanValue();
}
*/
return j2eeApp.isAvailabilityEnabled();
|
private com.sun.enterprise.config.serverbeans.J2eeApplication | getJ2eeApplicationByName(java.lang.String appName)
J2eeApplication result = null;
Applications applicationsBean = this.getApplicationsBeanDynamic();
if(applicationsBean == null) {
return null;
}
return applicationsBean.getJ2eeApplicationByName(appName);
|
public int | getLatencyCountPropertyFromConfig()returns the latency count value
in
if missing (or error) default to 0
int candidateReturnValue = 0;
int returnValue = 0;
String returnValueString =
this.getAvailabilityServicePropertyString(LATENCY_COUNT);
if(returnValueString != null) {
try
{
candidateReturnValue = (Integer.valueOf(returnValueString)).intValue();
} catch (NumberFormatException ex) {
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("Using Default Value = 0");
}
}
}
//for now only allow 1 or 0
if(candidateReturnValue == 1) {
returnValue = candidateReturnValue;
}
return returnValue;
|
public int | getMaxSessionUnloadTimeInSecondsPropertyFromConfig()returns the max_session_unload_time_in_seconds value
in
if missing (or error) default to 7 minutes (7*60 seconds)
int candidateReturnValue = 7 * 60;
int returnValue = 7 * 60;
String returnValueString =
this.getAvailabilityServicePropertyString(MAX_SESSION_UNLOAD_TIME_IN_SECONDS);
if(returnValueString != null) {
try
{
candidateReturnValue = (Integer.valueOf(returnValueString)).intValue();
} catch (NumberFormatException ex) {
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("Using Default Value = 7 * 60");
}
}
}
//only allow positive integers
if(candidateReturnValue >= 0) {
returnValue = candidateReturnValue;
}
return returnValue;
|
public int | getNumberOfReplicationPipesFromConfig()returns the number of steady-state pipes in pool
will set equal to number of request processing threads plus one
in the http-service
or if the NUMBER_OF_PIPES property is set that will take precedence
//if NUMBER_OF_PIPES property is set it will over-ride
//else it will track the number of request processing threads
//up to 40 - must be greater than 1
int numPipes = getNumberOfReplicationPipesPropertyFromConfig();
if(numPipes == -1) {
numPipes = this.getRequestProcessingThreadCountFromConfig();
}
numPipes++;
if(numPipes > 40) {
numPipes = 41;
}
if(numPipes < 2) {
numPipes = 2;
}
return numPipes;
|
public int | getNumberOfReplicationPipesPropertyFromConfig()returns the number of steady-state pipes in pool
in
if missing (or error) default to -1
int candidateReturnValue = -1;
int returnValue
= -1;
String returnValueString =
this.getAvailabilityServicePropertyString(NUMBER_OF_PIPES);
if(returnValueString != null) {
try
{
candidateReturnValue = (Integer.valueOf(returnValueString)).intValue();
} catch (NumberFormatException ex) {
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("Using Default Value = 5");
}
}
}
//may return negative or zero value
if(candidateReturnValue > 0) {
returnValue = candidateReturnValue;
}
return returnValue;
|
public java.lang.String | getPersistenceFrequencyFromConfig()Get the persistenceFrequency from domain.xml.
return null if not found
7.0 xpath was "/server/web-container/session-config/session-manager/manager-properties/property[@name='persistenceFrequency']";
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("in ServerConfigLookup>>getPersistenceFrequencyFromConfig");
}
WebContainerAvailability webContainerAvailabilityBean =
this.getWebContainerAvailability();
if(webContainerAvailabilityBean == null) {
return null;
}
return webContainerAvailabilityBean.getPersistenceFrequency();
|
public java.lang.String | getPersistenceScopeFromConfig()Get the persistenceScope from domain.xml.
return null if not found
7.0 xpath was "/server/web-container/session-config/session-manager/store-properties/property[@name='persistenceScope']";
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("in ServerConfigLookup>>getPersistenceScopeFromConfig");
}
WebContainerAvailability webContainerAvailabilityBean =
this.getWebContainerAvailability();
if(webContainerAvailabilityBean == null) {
return null;
}
return webContainerAvailabilityBean.getPersistenceScope();
|
public com.sun.enterprise.web.session.PersistenceType | getPersistenceTypeFromConfig()Get the persistenceType from domain.xml.
return null if not found
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("in ServerConfigLookup>>getPersistenceTypeFromConfig");
}
String persistenceTypeString = null;
PersistenceType persistenceType = null;
WebContainerAvailability webContainerAvailabilityBean =
this.getWebContainerAvailability();
if(webContainerAvailabilityBean == null) {
return null;
}
persistenceTypeString = webContainerAvailabilityBean.getPersistenceType();
//System.out.println("ServerConfigLookup>>getPersistenceTypeFromConfig:persistenceTypeString=" + persistenceTypeString);
if(persistenceTypeString != null) {
persistenceType = PersistenceType.parseType(persistenceTypeString);
}
if(persistenceType != null) {
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("SERVER.XML persistenceType= " + persistenceType.getType());
}
} else {
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("SERVER.XML persistenceType missing");
}
}
return persistenceType;
|
public boolean | getReplicationMeasurementEnabledFromConfig()returns the replication_measurement_enabled property
in
if missing (or error) default to false
boolean returnValue = false;
String returnValueString =
this.getAvailabilityServicePropertyString(REPLICATION_MEASUREMENT_ENABLED);
if(returnValueString != null) {
returnValue = (Boolean.valueOf(returnValueString));
}
return returnValue;
|
public int | getReplicationMeasurementIntervalFromConfig()returns the replication_measurement_interval property
used to control frequency of measurement output
in
if missing (or error) default to 1000
int candidateReturnValue = 1000;
int returnValue = 1000;
String returnValueString =
this.getAvailabilityServicePropertyString(REPLICATION_MEASUREMENT_INTERVAL);
if(returnValueString != null) {
try
{
candidateReturnValue = (Integer.valueOf(returnValueString)).intValue();
} catch (NumberFormatException ex) {
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("Using Default Value = 1000");
}
}
}
//may return negative value
if(candidateReturnValue > 0) {
returnValue = candidateReturnValue;
}
return returnValue;
|
private com.sun.enterprise.config.serverbeans.RequestProcessing | getRequestProcessing()Get the request-processing element from domain.xml.
return null if not found
HttpService httpServiceBean = this.getHttpService();
if(httpServiceBean == null) {
return null;
}
return httpServiceBean.getRequestProcessing();
|
public int | getRequestProcessingThreadCountFromConfig()Get the thread-count attribute in request-processing
element from domain.xml.
returns the attribute thread-count
in
if missing (or error) default to DEFAULT_REQUEST_PROCESSING_THREAD_COUNT
int candidateReturnValue = -1;
int returnValue
= DEFAULT_REQUEST_PROCESSING_THREAD_COUNT;
String returnValueString =
this.getRequestProcessingThreadCountStringFromConfig();
if(returnValueString != null) {
try
{
candidateReturnValue = (Integer.valueOf(returnValueString)).intValue();
} catch (NumberFormatException ex) {
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("Using Default Value = " + DEFAULT_REQUEST_PROCESSING_THREAD_COUNT);
}
}
}
//insure we have at least 5 pipes
if(candidateReturnValue > 4) {
returnValue = candidateReturnValue;
}
return returnValue;
|
private java.lang.String | getRequestProcessingThreadCountStringFromConfig()Get the request-processing thread-count attribute from domain.xml.
return null if not found
RequestProcessing requestProcessingBean = this.getRequestProcessing();
if(requestProcessingBean == null) {
return null;
}
return requestProcessingBean.getThreadCount();
|
private com.sun.enterprise.config.serverbeans.Resources | getResourcesBean()Get the resources element from domain.xml.
return null if not found
Resources resourcesBean = null;
Domain domainBean = null;
/*
ServerContext serverCtx = ApplicationServer.getServerContext();
ConfigContext configCtx = serverCtx.getConfigContext();
*/
ConfigContext configCtx = this.getConfigContext();
try {
domainBean = ServerBeansFactory.getDomainBean(configCtx);
if(domainBean != null) {
resourcesBean = domainBean.getResources();
}
} catch (ConfigException ex) {}
return resourcesBean;
|
private com.sun.enterprise.config.serverbeans.Server | getServerBean()Get the server element from domain.xml.
return null if not found
Server serverBean = null;
/*
ServerContext serverCtx = ApplicationServer.getServerContext();
ConfigContext configCtx = serverCtx.getConfigContext();
*/
ConfigContext configCtx = this.getConfigContext();
try {
serverBean = ServerBeansFactory.getServerBean(configCtx);
} catch (ConfigException ex) {}
return serverBean;
|
public java.lang.String | getServerConfigValue(java.lang.String xpath, java.lang.String defaultValue)Get the value from server.xml for xpath
return defaultValue if not defined or other problem
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("in ServerConfigLookup>>getServerConfigValue:xpath=" + xpath
+ " defaultValue= " + defaultValue);
}
ServerContext serverCtx = ApplicationServer.getServerContext();
//this condition occurs during some unit tests
if(serverCtx == null)
return defaultValue;
ConfigContext configCtx = serverCtx.getConfigContext();
ConfigBean configBean = null;
String returnValueString = null;
String returnValue = defaultValue;
try {
configBean =
configCtx.exactLookup(xpath);
} catch (ConfigException ex) {
}
if(configBean != null) {
returnValueString = configBean.getAttributeValue("value");
}
if(returnValueString != null) {
returnValue = returnValueString;
}
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("RETURNED CONFIG VALUE FOR XPATH:" + xpath +
" = " + returnValue);
}
return returnValue;
|
public int | getServerConfigValue(java.lang.String xpath, int defaultValue)Get the value from server.xml for xpath
return defaultValue if not defined or other problem
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("in getServerConfigValue:xpath=" + xpath
+ " defaultValue= " + defaultValue);
}
/*
ServerContext serverCtx = ApplicationServer.getServerContext();
ConfigContext configCtx = serverCtx.getConfigContext();
*/
ConfigContext configCtx = this.getConfigContext();
ConfigBean configBean = null;
String returnValueString = null;
int returnValue = defaultValue;
try {
configBean =
configCtx.exactLookup(xpath);
} catch (ConfigException ex) {
}
if(configBean != null) {
returnValueString = configBean.getAttributeValue("value");
}
if(returnValueString != null) {
try {
returnValue = (Integer.valueOf(returnValueString)).intValue();
} catch (NumberFormatException ex) {
_logger.finest("Using Default Value = "
+ defaultValue);
}
}
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("RETURNED CONFIG VALUE FOR XPATH:" + xpath +
" = " + returnValue);
}
return returnValue;
|
protected com.sun.enterprise.server.ServerContext | getServerContext()Get the ServerContext for this server
return null if not found
return ApplicationServer.getServerContext();
|
public java.lang.String | getServerName()Get the server name from domain.xml.
return null if not found
String result = null;
Server serverBean = this.getServerBean();
if(serverBean != null) {
result = serverBean.getName();
}
return result;
|
public java.util.ArrayList | getServerNamesInCluster()
ArrayList result = new ArrayList();
ConfigContext configCtx = this.getConfigContext();
String serverName = this.getServerName();
//this should not happen
if(serverName == null) {
//displayArrayList(result);
return result;
}
boolean isClustered = false;
try {
isClustered = ServerHelper.isServerClustered(configCtx, serverName);
} catch (ConfigException ex) {}
//if not clustered try to find the property else just return
//our own name alone
if(!isClustered) {
//from property under availability-service for stand-alones
ArrayList instanceNamesArray = this.getClusterInstanceNamesList();
if(!instanceNamesArray.isEmpty()) {
result = instanceNamesArray;
} else {
result.add(serverName);
}
//displayArrayList(result);
return result;
}
// if clustered instance then get list of cluster members names
String clusterName = this.getClusterName();
Server[] serversArray = null;
try {
serversArray = ServerHelper.getServersInCluster(configCtx, clusterName);
} catch (ConfigException ex) {}
for(int i=0; i<serversArray.length; i++) {
Server nextServer = serversArray[i];
/* FIXME this appears wrong
if(i > 0) {
result.add(nextServer.getName());
}
*/
result.add(nextServer.getName().trim());
}
//displayArrayList(result);
return result;
|
public boolean | getSsoFailoverEnabledFromConfig()Get the sso-failover-enabled boolean from domain.xml.
WebContainerAvailability webContainerAvailabilityBean =
this.getWebContainerAvailability();
if(webContainerAvailabilityBean == null) {
return false;
}
return webContainerAvailabilityBean.isSsoFailoverEnabled();
|
public boolean | getStaleSessionCheckingFromConfig()Get the stale-session-checking-enabled from domain.xml.
return false if not found
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("in ServerConfigLookup>>getStaleSessionCheckingFromConfig");
}
String staleSessionCheckingEnabledString =
this.getWebContainerAvailabilityPropertyString(STALE_SESSION_CHECKING_ENABLED_PROPERTY_NAME, "false");
Boolean bool = this.toBoolean(staleSessionCheckingEnabledString);
if(bool == null) {
return false;
} else {
return bool.booleanValue();
}
|
public java.lang.String | getStorePoolJndiNameFromConfig()Get the store-pool-jndi-name from domain.xml.
This is the store-pool-name in element
it represents the default for both web & ejb container
return DEFAULT_STORE_POOL_JNDI_NAME if not found
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("in ServerConfigLookup>>getStorePoolJndiNameFromConfig");
}
String result = DEFAULT_STORE_POOL_JNDI_NAME;
AvailabilityService as = this.getAvailabilityService();
if(as == null) {
return result;
}
String storePoolJndiName = as.getStorePoolName();
if(storePoolJndiName != null) {
result = storePoolJndiName;
}
return result;
|
public com.sun.enterprise.util.uuid.UuidGenerator | getUuidGeneratorFromConfig()Get the UuidGenerator implementation class from server.xml.
7.0 xpath was "/server/availability-service/persistence-store/property[@name='uuid-impl-class']";
UuidGenerator generator = new UuidGeneratorImpl();
String generatorImplClassName =
this.getUuidGeneratorImplClassFromConfig();
try {
generator =
(UuidGenerator) (Class.forName(generatorImplClassName)).newInstance();
} catch (Exception ex) {
}
return generator;
|
public java.lang.String | getUuidGeneratorImplClassFromConfig()Get the UuidGenerator implementation class name from domain.xml.
7.0 xpath was "/server/availability-service/persistence-store/property[@name='uuid-impl-class']", if specified.
Use value of session-id-generator-classname attribute of
"/server/web-container/session-config/session-manager/manager-properties"
as fallback, or DEFAULT_UUID_GENERATOR_CLASS if no fallback specified.
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest(
"in ServerConfigLookup>>getUuidGeneratorImplClassFromConfig");
}
String defaultUuidGeneratorClass = DEFAULT_UUID_GENERATOR_CLASS;
ManagerProperties mp = getInstanceSessionManagerManagerProperties();
if (mp != null) {
String cls = mp.getSessionIdGeneratorClassname();
if (cls != null) {
defaultUuidGeneratorClass = cls;
}
}
return this.getWebContainerAvailabilityPropertyString(UUID_GENERATOR_CLASS_PROPERTY_NAME, defaultUuidGeneratorClass);
|
public boolean | getWaitForAckPropertyFromConfig()returns the wait_for_ack_property
in
if missing (or error) default to false
boolean returnValue = false;
String returnValueString =
this.getAvailabilityServicePropertyString(WAIT_FOR_ACK_PROPERTY);
if(returnValueString != null) {
returnValue = (Boolean.valueOf(returnValueString));
}
return returnValue;
|
public boolean | getWaitForFastAckPropertyFromConfig()returns the wait_for_fast_ack_property
in
if missing (or error) default to true
boolean returnValue = true;
String returnValueString =
this.getAvailabilityServicePropertyString(WAIT_FOR_FAST_ACK_PROPERTY);
if(returnValueString != null) {
returnValue = (Boolean.valueOf(returnValueString));
}
return returnValue;
|
private com.sun.enterprise.config.serverbeans.WebContainerAvailability | getWebContainerAvailability()Get the web-container-availability element from domain.xml.
return null if not found
AvailabilityService availabilityServiceBean = this.getAvailabilityService();
if(availabilityServiceBean == null) {
return null;
}
return availabilityServiceBean.getWebContainerAvailability();
|
public boolean | getWebContainerAvailabilityEnabledFromConfig()Get the availability-enabled for the web container from domain.xml.
return inherited global availability-enabled if not found
boolean globalAvailabilityEnabled = this.getAvailabilityEnabledFromConfig();
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("in ServerConfigLookup>>getWebContainerAvailabilityEnabledFromConfig");
}
WebContainerAvailability was = this.getWebContainerAvailability();
if(was == null) {
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("WebContainerAvailability was not defined - check domain.xml");
}
return globalAvailabilityEnabled;
}
String wasString = was.getAvailabilityEnabled();
Boolean bool = this.toBoolean(wasString);
if(bool == null) {
return globalAvailabilityEnabled;
} else {
return bool.booleanValue();
}
|
public boolean | getWebContainerAvailabilityEnabledFromConfig(boolean inheritedValue)Get the availability-enabled for the web container from domain.xml.
return inherited global availability-enabled if not found
//boolean globalAvailabilityEnabled = this.getAvailabilityEnabledFromConfig();
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("in ServerConfigLookup>>getWebContainerAvailabilityEnabledFromConfig");
}
WebContainerAvailability was = this.getWebContainerAvailability();
if(was == null) {
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("WebContainerAvailability was not defined - check domain.xml");
}
return inheritedValue;
}
String wasString = was.getAvailabilityEnabled();
Boolean bool = this.toBoolean(wasString);
if(bool == null) {
return inheritedValue;
} else {
return bool.booleanValue();
}
|
private com.sun.enterprise.config.serverbeans.ElementProperty[] | getWebContainerAvailabilityProperties()Get the properties under the web-container-availability element
from domain.xml.
return array of single empty ElementProperty if not found
WebContainerAvailability webContainerAvailabilityBean =
this.getWebContainerAvailability();
if(webContainerAvailabilityBean == null) {
return new ElementProperty[0];
}
return webContainerAvailabilityBean.getElementProperty();
|
protected int | getWebContainerAvailabilityPropertyInt(java.lang.String propName, int defaultValue)Get the int value of the property under web-container-availability
element from domain.xml whose name matches propName
return defaultValue if not found
int returnValue = defaultValue;
String returnValueString = null;
WebContainerAvailability wcAvailabilityBean = this.getWebContainerAvailability();
if( (wcAvailabilityBean != null) && (wcAvailabilityBean.sizeElementProperty() > 0) ) {
ElementProperty[] props = wcAvailabilityBean.getElementProperty();
for (int i = 0; i < props.length; i++) {
String name = props[i].getAttributeValue("name");
String value = props[i].getAttributeValue("value");
if (name.equalsIgnoreCase(propName)) {
returnValueString = value;
}
}
}
if(returnValueString != null) {
try
{
returnValue = (Integer.valueOf(returnValueString)).intValue();
} catch (NumberFormatException ex) {
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("Using Default Value = "
+ defaultValue);
}
}
}
return returnValue;
|
protected java.lang.String | getWebContainerAvailabilityPropertyString(java.lang.String propName)Get the String value of the property under web-container-availability
element from domain.xml whose name matches propName
return null if not found
String result = null;
WebContainerAvailability wcAvailabilityBean = this.getWebContainerAvailability();
if( (wcAvailabilityBean != null) && (wcAvailabilityBean.sizeElementProperty() > 0) ) {
ElementProperty[] props = wcAvailabilityBean.getElementProperty();
for (int i = 0; i < props.length; i++) {
String name = props[i].getAttributeValue("name");
String value = props[i].getAttributeValue("value");
if (name.equalsIgnoreCase(propName)) {
result = value;
}
}
}
return result;
|
protected java.lang.String | getWebContainerAvailabilityPropertyString(java.lang.String propName, java.lang.String defaultValue)Get the String value of the property under web-container-availability
element from domain.xml whose name matches propName
return defaultValue if not found
String result = null;
WebContainerAvailability wcAvailabilityBean = this.getWebContainerAvailability();
if( (wcAvailabilityBean != null) && (wcAvailabilityBean.sizeElementProperty() > 0) ) {
ElementProperty[] props = wcAvailabilityBean.getElementProperty();
for (int i = 0; i < props.length; i++) {
String name = props[i].getAttributeValue("name");
String value = props[i].getAttributeValue("value");
if (name.equalsIgnoreCase(propName)) {
result = value;
}
}
}
if(result == null) {
result = defaultValue;
}
return result;
|
private boolean | getWebModuleAvailability(java.lang.String contextRoot, boolean inheritedValue)
com.sun.enterprise.config.serverbeans.WebModule webModule =
this.getWebModuleByContextRoot(contextRoot);
if(webModule == null) {
//FIXME remove after testing
return false;
//return inheritedValue;
}
/*
String wmsString = webModule.getAvailabilityEnabled();
Boolean bool = this.toBoolean(wmsString);
if(bool == null) {
return inheritedValue;
} else {
return bool.booleanValue();
}
*/
return webModule.isAvailabilityEnabled();
|
private com.sun.enterprise.config.serverbeans.WebModule | getWebModuleByContextRoot(java.lang.String contextRoot)
com.sun.enterprise.config.serverbeans.WebModule result = null;
Applications applicationsBean = this.getApplicationsBeanDynamic();
if(applicationsBean == null) {
return null;
}
com.sun.enterprise.config.serverbeans.WebModule[] webModules =
applicationsBean.getWebModule();
for(int i=0; i<webModules.length; i++) {
com.sun.enterprise.config.serverbeans.WebModule nextWebModule =
webModules[i];
String nextContextRoot = nextWebModule.getContextRoot();
if(nextContextRoot != null && nextContextRoot.equalsIgnoreCase(contextRoot)) {
result = nextWebModule;
}
}
return result;
|
public boolean | isDAS()determine if this instance is the DAS
boolean result = true;
Server serverBean = this.getServerBean();
ConfigContext configCtx = this.getConfigContext();
if(serverBean != null && configCtx != null) {
try {
result = ServerHelper.isDAS(configCtx, serverBean);
} catch (ConfigException ex) {}
}
return result;
|
public boolean | isGMSEnabled()If the clusterName is null; return false
else return heartbeat enabled for the cluster
if(getClusterName() == null) {
return false;
}
Cluster cluster = getCluster();
if(cluster == null) {
return false;
}
return cluster.isHeartbeatEnabled();
|
public static boolean | isHADBInstalled()determine if HADB is installed
check if the value of the system property HADB_ROOT_PROPERTY
is a directory
String hadbRootDirString = System.getProperty(SystemPropertyConstants.HADB_ROOT_PROPERTY);
if(hadbRootDirString == null) {
return false;
}
// System.out.println("hadbRootDirString=" + hadbRootDirString);
File hadbRootDir = new File(hadbRootDirString);
return (hadbRootDir.exists()
&& (hadbRootDir.isDirectory()) );
|
public boolean | isNativeReplicationEnabledFromConfig()Get the native_replication_enabled from domain.xml.
return true if not found
if(_logger.isLoggable(Level.FINEST)) {
_logger.finest("in ServerConfigLookup>>getNativeReplicationEnabledFromConfig");
}
String nativeReplicationEnabledString =
this.getAvailabilityServicePropertyString(NATIVE_REPLICATION_ENABLED);
Boolean bool = this.toBoolean(nativeReplicationEnabledString);
if(bool == null) {
return true;
} else {
return bool.booleanValue();
}
|
protected java.lang.Boolean | toBoolean(java.lang.String value)convert the input value to the appropriate Boolean value
if input value is null, return null
if(value == null) return null;
if (value.equalsIgnoreCase("true"))
return Boolean.TRUE;
if (value.equalsIgnoreCase("yes"))
return Boolean.TRUE;
if (value.equalsIgnoreCase("on") )
return Boolean.TRUE;
if (value.equalsIgnoreCase("1"))
return Boolean.TRUE;
return Boolean.FALSE;
|