/** * Allows subclasses to obtain command line options differently. * <p/> * Useful for testing purposes * * @param args arguments received from command line * @return map containing each configuration option name and value */ Map<String, Object> getCommandLineOptions(String[] args) { Map<String, Object> commandlineOptions; try { commandlineOptions = SystemUtils.getCommandLineOptions(args, CLI_OPTIONS); } catch (MuleException me) { throw new IllegalArgumentException(me.toString()); } return commandlineOptions; }
protected void init(String[] args) throws IllegalArgumentException { // TODO(pablo.kraan): move initialization of others classes outside this method Map<String, Object> commandlineOptions; try { commandlineOptions = SystemUtils.getCommandLineOptions(args, CLI_OPTIONS); } catch (MuleException me) { throw new IllegalArgumentException(me.toString()); } // set our own UrlStreamHandlerFactory to become more independent of system // properties MuleUrlStreamHandlerFactory.installUrlStreamHandlerFactory(); MuleArtifactUrlStreamHandler.register(); // Startup properties String propertiesFile = (String) commandlineOptions.get("props"); if (propertiesFile != null) { setStartupPropertiesFile(propertiesFile); } StartupContext.get().setStartupOptions(commandlineOptions); }