Methods Summary |
---|
private java.lang.String | determineLogFile(java.lang.String logFileName)Computes absolute path to log file from log-service/file
attribute.
if(logFileName.startsWith(envInstanceRootVar)) {
int length = envInstanceRootVar.length() ;
if(length > 0) {
String logFileSuffix = logFileName.substring(length);
if(repositoryDir != null)
logFileName = repositoryDir + logFileSuffix;
else
logFileName = logFileSuffix;
}
}
return logFileName;
|
public java.lang.String | getAttribute(java.lang.String attribute)Returns value of specified attribute from domain.xml
if (local){
if (diagnosticElement == null)
initializeXMLElements();
return getDOMAttribute(attribute);
}
return getRuntimeAttribute(attribute);
|
public java.lang.String | getConfigName()Gets config name
return configName;
|
private java.lang.String | getDOMAttribute(java.lang.String attribute)Retrieves attribute from loaded DOM - domain.xml
if(attribute.equals(ServerTags.FILE)) {
Element logElement = xmlHelper.getElement(configElement,"log-service");
return determineLogFile(logElement.getAttribute(ServerTags.FILE));
}
logger.log(Level.FINEST, "diagnostic-service.attribute_name",
new Object[] {attribute});
logger.log(Level.FINEST, "diagnostic-service.attribute_value",
new Object[] {diagnosticElement.getAttribute(attribute)});
return diagnosticElement.getAttribute(attribute);
|
private java.lang.String | getRuntimeAttribute(java.lang.String attribute)Retrieves value from runtime attributes
try {
logger.log(Level.FINE, "Instance Name :" + instanceName);
ConfigContext configContext =
AdminService.getAdminService().getAdminContext().getAdminConfigContext();
Server server = ServerHelper.getServerByName(configContext, instanceName);
configName = server.getConfigRef();
Config config = ConfigAPIHelper.getConfigByName(configContext,
configName);
if(attribute.equals(ServerTags.FILE)) {
LogService logService = config.getLogService();
return determineLogFile(logService.getFile());
}
else {
DiagnosticService diagService = config.getDiagnosticService();
return diagService.getAttributeValue(attribute);
}
} catch(ConfigException ce) {
logger.log(Level.SEVERE,
"diagnostic-service.error_retrieving_logFileName",
ce.getMessage());
throw new DiagnosticException(ce.getMessage());
}
|
private void | initializeXMLElements()Initialize XML elements
try {
xmlHelper = new DomainXMLHelper(repositoryDir);
Element element = xmlHelper.getElement("server", instanceName);
configName = xmlHelper.getAttribute(element, "config-ref");
configElement = xmlHelper.getElement("config", configName);
diagnosticElement = xmlHelper.getElement(configElement,
"diagnostic-service");
}catch(Exception e) {
e.printStackTrace();
throw new DiagnosticException(e.getMessage());
}
|
public java.lang.String | instanceName()Retrieves instance name
return instanceName;
|