/** * Loads a YAESS profile from the specified properties. * @param properties source properties * @param classLoader the class loader to load the service class * @return the loaded profile * @throws IllegalArgumentException if the target profile is invalid, or parameters contain {@code null} * @deprecated use {@link #load(Properties, ProfileContext)} instead */ @Deprecated public static YaessProfile load(Properties properties, ClassLoader classLoader) { if (properties == null) { throw new IllegalArgumentException("properties must not be null"); //$NON-NLS-1$ } if (classLoader == null) { throw new IllegalArgumentException("classLoader must not be null"); //$NON-NLS-1$ } return load(properties, ProfileContext.system(classLoader)); }
throw new IllegalArgumentException("commandHandlers must not be null"); //$NON-NLS-1$ checkPrefix(core, PREFIX_CORE); checkPrefix(monitors, PREFIX_MONITOR); checkPrefix(locks, PREFIX_LOCK); checkPrefix(scheduler, PREFIX_SCHEDULER); checkPrefix(hadoopHandler, PREFIX_HADOOP); this.core = core; this.monitors = monitors;
ExecutionMonitorProvider monitors = profile.getMonitors().newInstance(); ExecutionLockProvider locks = profile.getLocks().newInstance(); JobScheduler scheduler = profile.getScheduler().newInstance(); HadoopScriptHandler hadoopHandler = profile.getHadoopHandler().newInstance(); : profile.getCommandHandlers().entrySet()) { commandHandlers.put(entry.getKey(), entry.getValue().newInstance());
commandHandlers.add(profile); return new YaessProfile(core, monitors, locks, scheduler, hadoopHandler, commandHandlers);
result.context = new ProfileContext(loader, new VariableResolver(env)); Properties properties = CommandLineUtil.loadProperties(file); result.profile = YaessProfile.load(properties, result.context); } catch (Exception e) { YSLOG.error(e, "E01001", file.getPath());