Methods Summary |
---|
public boolean | calculateEjbAvailabilityEnabledFromConfig()Get the availability-enabled from domain.xml.
This takes into account:
global
ejb-container-availability
j2ee app if not stand-alone
ejb-module (if stand-alone)
return false if not found
FIXME: need to add taking the availability-enabled of the bean itself
_logger.finest("in EJBServerConfigLookup>>calculateEjbAvailabilityEnabledFromConfig");
boolean isVirtual = this.isVirtualApplication();
String appName = this.getApplicationName();
boolean globalAvailability =
this.getAvailabilityEnabledFromConfig();
boolean ejbContainerAvailability =
this.getEjbContainerAvailabilityEnabledFromConfig(globalAvailability);
boolean ejbDescriptorAvailability = true;
//System.out.println("EJBServerConfigLookup: app isVirtual=" + isVirtual);
if (isVirtual) {
boolean ejbModuleAvailability =
this.getEjbModuleAvailability(appName, ejbContainerAvailability);
ejbDescriptorAvailability =
this.getAvailabilityEnabledFromEjbDescriptor(ejbModuleAvailability);
//System.out.println("virtual: ejbModuleAvailability= " + ejbModuleAvailability);
//System.out.println("virtual: ejbDescriptorAvailability= " + ejbDescriptorAvailability);
_haEnabled = globalAvailability
&& ejbContainerAvailability
&& ejbModuleAvailability
&& ejbDescriptorAvailability;
} else {
boolean j2eeApplicationAvailability =
this.getJ2eeApplicationAvailability(appName, ejbContainerAvailability);
ejbDescriptorAvailability =
this.getAvailabilityEnabledFromEjbDescriptor(j2eeApplicationAvailability);
//System.out.println("non-virtual: j2eeApplicationAvailability= " + j2eeApplicationAvailability);
//System.out.println("non-virtual: ejbDescriptorAvailability= " + ejbDescriptorAvailability);
_haEnabled = globalAvailability
&& ejbContainerAvailability
&& j2eeApplicationAvailability
&& ejbDescriptorAvailability;
}
//System.out.println("_haEnabled returned = " + _haEnabled);
return _haEnabled;
|
public static boolean | checkDebugMonitoringEnabled()
boolean result = false;
try
{
Properties props = System.getProperties();
String str=props.getProperty("MONITOR_EJB_CONTAINER");
if(null!=str) {
if( str.equalsIgnoreCase("TRUE"))
result=true;
}
} catch(Exception e)
{
//do nothing just return false
}
return result;
|
private java.lang.String | getApplicationName()return the name of the application to which the bean belongs
it will be the j2ee app name if the bean is part of a j2ee app
it will be the ejb module name if the bean is a stand-alone ejb module
Application application = _ejbDescriptor.getApplication();
return application.getRegistrationName();
|
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;
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
_logger.finest("in EJBServerConfigLookup>>getAvailabilityEnabledFromConfig");
AvailabilityService as = this.getAvailabilityService();
if(as == null) {
_logger.fine("AvailabilityService was not defined - check domain.xml");
return false;
}
return as.isAvailabilityEnabled();
|
public boolean | getAvailabilityEnabledFromEjbDescriptor()Get the availability-enabled for the bean from sun-ejb-jar.xml.
return true if not found
_logger.finest("in EJBServerConfigLookup>>getAvailabilityEnabledFromEjbDescriptor");
IASEjbExtraDescriptors extraDescriptors =
_ejbDescriptor.getIASEjbExtraDescriptors();
if(extraDescriptors == null) {
return true;
}
String availabilityEnabledString =
extraDescriptors.getAttributeValue(extraDescriptors.AVAILABILITY_ENABLED);
Boolean bool = this.toBoolean(availabilityEnabledString);
if(bool == null) {
return true;
} else {
return bool.booleanValue();
}
|
public boolean | getAvailabilityEnabledFromEjbDescriptor(boolean inheritedValue)Get the availability-enabled for the bean from sun-ejb-jar.xml.
return defaultValue if not found
_logger.finest("in EJBServerConfigLookup>>getAvailabilityEnabledFromEjbDescriptor");
IASEjbExtraDescriptors extraDescriptors =
_ejbDescriptor.getIASEjbExtraDescriptors();
if(extraDescriptors == null) {
return inheritedValue;
}
String availabilityEnabledString =
extraDescriptors.getAttributeValue(extraDescriptors.AVAILABILITY_ENABLED);
Boolean bool = this.toBoolean(availabilityEnabledString);
if(bool == null) {
return inheritedValue;
} else {
return bool.booleanValue();
}
|
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();
|
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();
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();
}
|
private com.sun.enterprise.config.serverbeans.EjbContainerAvailability | getEjbContainerAvailability()return the ejb-container-availability element from domain.xml
AvailabilityService availabilityServiceBean = this.getAvailabilityService();
if(availabilityServiceBean == null) {
return null;
}
return availabilityServiceBean.getEjbContainerAvailability();
|
public boolean | getEjbContainerAvailabilityEnabledFromConfig()Get the availability-enabled for the ejb container from domain.xml.
return inherited global availability-enabled if not found
boolean globalAvailabilityEnabled = this.getAvailabilityEnabledFromConfig();
_logger.finest("in EJBServerConfigLookup>>getEjbContainerAvailabilityEnabledFromConfig");
EjbContainerAvailability eas = this.getEjbContainerAvailability();
if(eas == null) {
_logger.fine("EjbContainerAvailability was not defined - check domain.xml");
return globalAvailabilityEnabled;
}
String easString = eas.getAvailabilityEnabled();
Boolean bool = this.toBoolean(easString);
if(bool == null) {
return globalAvailabilityEnabled;
} else {
return bool.booleanValue();
}
|
public boolean | getEjbContainerAvailabilityEnabledFromConfig(boolean inheritedValue)Get the availability-enabled for the ejb container from domain.xml.
return inherited global availability-enabled if not found
_logger.finest("in EJBServerConfigLookup>>getEjbContainerAvailabilityEnabledFromConfig");
EjbContainerAvailability eas = this.getEjbContainerAvailability();
if(eas == null) {
_logger.fine("EjbContainerAvailability was not defined - check domain.xml");
return inheritedValue;
}
String easString = eas.getAvailabilityEnabled();
Boolean bool = this.toBoolean(easString);
if(bool == null) {
return inheritedValue;
} else {
return bool.booleanValue();
}
|
private boolean | getEjbModuleAvailability(java.lang.String name, boolean inheritedValue)return availability-enabled for the deployed ejb module
from domain.xml based on the name
return inheritedValue if module not found or module availability
is not defined
EjbModule ejbModule =
this.getEjbModuleByName(name);
//FIXME remove after testing
//System.out.println("EJBServerConfigLookup>>getEjbModuleAvailability ejbModule = " + ejbModule);
if(ejbModule == null) {
return false;
//FIXME remove after testing
//return inheritedValue;
}
/* FIXME: remove after testing
String moduleString = ejbModule.getAvailabilityEnabled();
Boolean bool = this.toBoolean(moduleString);
if(bool == null) {
return inheritedValue;
} else {
return bool.booleanValue();
}
*/
return ejbModule.isAvailabilityEnabled();
|
private com.sun.enterprise.config.serverbeans.EjbModule | getEjbModuleByName(java.lang.String name)Get the deployed ejb module from domain.xml based on the name
return null if not found
EjbModule result = null;
Applications applicationsBean = this.getApplicationsBeanDynamic();
if(applicationsBean == null) {
return null;
}
return applicationsBean.getEjbModuleByName(name);
|
public java.lang.String | getHaStorePoolJndiNameFromConfig()Get the sfsb-store-pool-name from domain.xml.
return DEFAULT_STORE_POOL_JNDI_NAME if not found
_logger.finest("in EJBServerConfigLookup>>getHaStorePoolJndiNameFromConfig");
//String result = DEFAULT_STORE_POOL_JNDI_NAME;
String result = this.getStorePoolJndiNameFromConfig();
EjbContainerAvailability ejbContainerAvailabilityBean =
this.getEjbContainerAvailability();
if(ejbContainerAvailabilityBean == null) {
return result;
}
String result2 = ejbContainerAvailabilityBean.getSfsbStorePoolName();
if(result2 != null) {
result = result2;
}
return result;
|
private boolean | getJ2eeApplicationAvailability(java.lang.String appName, boolean inheritedValue)return availability-enabled for the deployed j2ee application
from domain.xml based on the app name
return inheritedValue if module not found or j2ee application
availability is not defined
J2eeApplication j2eeApp =
this.getJ2eeApplicationByName(appName);
//FIXME remove after testing
//System.out.println("EJBServerConfigLookup>>getJ2eeApplicationAvailability j2eeApp = " + j2eeApp);
if(j2eeApp == null) {
return false;
//FIXME remove after testing
//return inheritedValue;
}
/* FIXME remove after testing
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)Get the deployed j2ee application from domain.xml based on the appName
return null if not found
J2eeApplication result = null;
Applications applicationsBean = this.getApplicationsBeanDynamic();
if(applicationsBean == null) {
return null;
}
return applicationsBean.getJ2eeApplicationByName(appName);
|
public java.lang.String | getPersistenceStoreType()
return (_haEnabled)
? getSfsbHaPersistenceTypeFromConfig()
: getSfsbNonHaPersistenceTypeFromConfig();
|
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;
|
protected com.sun.enterprise.server.ServerContext | getServerContext()Get the ServerContext for this server
return null if not found
return ApplicationServer.getServerContext();
|
private 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.lang.String | getSfsbHaPersistenceTypeFromConfig()Get the sfsb-ha-persistence-type from domain.xml.
return DEFAULT_SFSB_HA_PERSISTENCE_TYPE if not found
_logger.finest("in EJBServerConfigLookup>>getSfsbHaPersistenceTypeFromConfig");
String result = DEFAULT_SFSB_HA_PERSISTENCE_TYPE;
EjbContainerAvailability ejbContainerAvailabilityBean =
this.getEjbContainerAvailability();
if(ejbContainerAvailabilityBean == null) {
return result;
}
String result2 = ejbContainerAvailabilityBean.getSfsbHaPersistenceType();
if(result2 != null) {
result = result2;
}
return result;
|
public java.lang.String | getSfsbNonHaPersistenceTypeFromConfig()Get the sfsb-non-ha-persistence-type from domain.xml.
return DEFAULT_SFSB_NON_HA_PERSISTENCE_TYPE if not found
_logger.finest("in EJBServerConfigLookup>>getSfsbNonHaPersistenceTypeFromConfig");
String result = DEFAULT_SFSB_NON_HA_PERSISTENCE_TYPE;
EjbContainerAvailability ejbContainerAvailabilityBean =
this.getEjbContainerAvailability();
if(ejbContainerAvailabilityBean == null) {
return result;
}
//String result2 = ejbContainerAvailabilityBean.getSfsbNonHaPersistenceType();
String result2 = ejbContainerAvailabilityBean.getSfsbPersistenceType();
if(result2 != null) {
result = result2;
}
return result;
|
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
_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 static boolean | isDebugMonitoringEnabled()Is private (internal) monitoring enabled
return _isDebugMonitoringEnabled;
|
public static boolean | isMonitoringEnabled()Is (any) monitoring enabled -- private or public
Statistics gathering is based on this value
_isDebugMonitoringEnabled = checkDebugMonitoringEnabled();
//return (isDebugMonitoringEnabled() || isPublicMonitoringEnabled());
return isDebugMonitoringEnabled();
|
private boolean | isReplicationTypeMemory()
return REPLICATED_TYPE.equalsIgnoreCase(getSfsbHaPersistenceTypeFromConfig());
|
private boolean | isVirtualApplication()return whether the bean is a "virtual" app - i.e. a stand-alone
ejb module
Application application = _ejbDescriptor.getApplication();
return application.isVirtual();
|
public static final boolean | needToAddSFSBVersionInterceptors()
boolean isClustered = false;
boolean isEJBAvailabilityEnabled = false;
boolean isStoreTypeMemory = false;
try {
EJBServerConfigLookup ejbSCLookup = new EJBServerConfigLookup();
ConfigContext configCtx = ejbSCLookup.getConfigContext();
isEJBAvailabilityEnabled = ejbSCLookup
.getEjbContainerAvailabilityEnabledFromConfig();
_logger.log(Level.INFO,
"EJBSCLookup:: sc.getEjbContainerAvailabilityEnabledFromConfig() ==> "
+ isEJBAvailabilityEnabled);
try {
isClustered = ServerHelper.isServerClustered(configCtx,
ejbSCLookup.getServerContext().getInstanceName());
} catch (ConfigException conFigEx) {
_logger.log(Level.INFO, "Got ConfigException. Will assume "
+ "isClustered to be false", conFigEx);
isClustered = false;
}
isStoreTypeMemory = ejbSCLookup.isReplicationTypeMemory();
} catch (Exception ex) {
_logger.log(Level.FINE,
"Got exception in needToAddSFSBVersionInterceptors ("
+ ex + "). SFSBVersionInterceptors not added");
_logger.log(Level.FINE, "Exception in needToAddSFSBVersionInterceptors", ex);
}
boolean result = isClustered && isEJBAvailabilityEnabled && isStoreTypeMemory;
_logger.log(Level.FINE, "EJBServerConfigLookup::==> isClustered:"
+ isClustered + " ; isEJBAvailabilityEnabled: "
+ isEJBAvailabilityEnabled + " ; isStoreTypeMemory ==> "
+ isStoreTypeMemory + " ; result: " + result);
// result = sc.getEjbContainerAvailabilityEnabledFromConfig();
return result;
|
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;
|