/** * Calls the {@link #initialize()} method and then runs the main {@link #doIt()} method. Call this if you set * the target and source in the constructor. * @throws Throwable */ public void run() throws Throwable { initialize(); doIt(); }
@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."); }