use of edu.uiuc.ncsa.myproxy.oa4mp.server.util.NewClientNotifier in project OA4MP by ncsa.
the class OA4MPServletInitializer method setupNotifiers.
public void setupNotifiers() throws IOException {
// do this once or you will have a message sent for each listener!
if (notifiersSet)
return;
MyProxyDelegationServlet mps = (MyProxyDelegationServlet) getServlet();
ServiceEnvironmentImpl env = (ServiceEnvironmentImpl) getEnvironment();
MyLoggingFacade logger = env.getMyLogger();
// debugging this...
NewClientNotifier newClientNotifier = createNewClientNotifier(env.getMailUtil(), logger);
MyProxyDelegationServlet.addNotificationListener(newClientNotifier);
MailUtil x = new MailUtil(env.getMailUtil().getMailEnvironment());
String fName = mps.getServletContext().getInitParameter(ERROR_NOTIFICATION_SUBJECT_KEY);
if (fName == null) {
logger.info("No error notification subject set. Skipping...");
notifiersSet = true;
return;
} else {
logger.info("Set error notification subject to " + fName);
}
x.setSubjectTemplate(getTemplate(new File(fName)));
fName = mps.getServletContext().getInitParameter(ERROR_NOTIFICATION_BODY_KEY);
if (fName == null) {
logger.info("No error notification message body set. Skipping...");
notifiersSet = true;
return;
} else {
logger.info("Set error notification message body to " + fName);
}
x.setMessageTemplate(getTemplate(new File(fName)));
ExceptionEventNotifier exceptionNotifier = new ExceptionEventNotifier(x, logger);
MyProxyDelegationServlet.addNotificationListener(exceptionNotifier);
notifiersSet = true;
}
Aggregations