Search in sources :

Example 1 with MailUtilProvider

use of edu.uiuc.ncsa.security.util.mail.MailUtilProvider in project OA4MP by ncsa.

the class Monitor method initialize.

@Override
public void initialize() throws Exception {
    super.initialize();
    // Allow for over-riding the log file from the command line.
    if (getLogfileName().equals(DEFAULT_LOG_FILE)) {
        setMyLogger(getEnvironment().getMyLogger());
    } else {
        File f = new File(getLogfileName());
        info("Setting up environment, log file = " + f.getAbsolutePath());
    }
    String cfgName = null;
    if (hasOption(CONFIG_NAME_OPTION, CONFIG_NAME_LONG_OPTION)) {
        cfgName = getCommandLine().getOptionValue(CONFIG_NAME_OPTION);
    }
    if (cfgName == null) {
        info("no named for a configuration given");
    } else {
        info("getting named configuration \"" + cfgName + "\"");
    }
    try {
        List list = getConfigurationNode().getChildren("mail");
        if (list.size() != 0) {
            mup = new MailUtilProvider((ConfigurationNode) list.get(0));
        }
    } catch (Throwable t) {
        info("Did not initialize a mail notification environment:" + t.getMessage());
    }
    serviceClient = ((AbstractClientLoader) getLoader()).createServiceClient(getClientEnvironment().getAccessTokenUri());
    info("Done with bootstrap.");
}
Also used : MailUtilProvider(edu.uiuc.ncsa.security.util.mail.MailUtilProvider) ConfigurationNode(org.apache.commons.configuration.tree.ConfigurationNode) List(java.util.List) File(java.io.File)

Aggregations

MailUtilProvider (edu.uiuc.ncsa.security.util.mail.MailUtilProvider)1 File (java.io.File)1 List (java.util.List)1 ConfigurationNode (org.apache.commons.configuration.tree.ConfigurationNode)1