
org.openas2.app.HealthCheck Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openas2-server Show documentation
Show all versions of openas2-server Show documentation
Open source implementation of the AS2 standard for signed encrypted and compressed document transfer
package org.openas2.app;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openas2.ComponentNotFoundException;
import org.openas2.processor.ProcessorModule;
import org.openas2.processor.receiver.HealthCheckHandler;
public class HealthCheck {
private Log logger = LogFactory.getLog(HealthCheckHandler.class.getSimpleName());
/*
* Runs a check of application status to try to determine if ther is any issue to be dealt with
* @param module the module that invoked the health check
* @return a string array of issues identified in executing the health check. the array will be empty if no errors are identified
*/
public List runCheck(ProcessorModule module) {
// Invoke each configured modules healthcheck method with any results returned in the failures array
List failures = new ArrayList();
try {
if (module == null) logger.warn("Module passed in to helathcheck is NULL so not module check was performed.");
else module.getSession().getProcessor().checkActiveModules(failures);
} catch (ComponentNotFoundException e) {
failures.add("Error executing module check: " + e.getMessage());
e.printStackTrace();
}
// TODO : Add other (non-module) checks
return failures;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy