@Override public final void configure(ServiceProfile<?> profile) throws InterruptedException, IOException { this.prefix = profile.getPrefix(); try { configureResourceId(profile); Map<String, String> desiredProperties = getDesiredProperties(profile); Map<String, String> desiredEnvironmentVariables = getDesiredEnvironmentVariables(profile); this.properties = Collections.unmodifiableMap(desiredProperties); this.environmentVariables = Collections.unmodifiableMap(desiredEnvironmentVariables); doConfigure(profile, desiredProperties, desiredEnvironmentVariables); } catch (IllegalArgumentException e) { throw new IOException(MessageFormat.format( "Failed to configure \"{0}\" ({1})", profile.getPrefix(), profile.getPrefix()), e); } }
/** * Cleanup the target environment. * @param monitor the progress monitor of the operation * @param context the current execution context * @throws InterruptedException if this operation is interrupted * @throws IOException if failed to setup the target environment */ public void cleanUp( ExecutionMonitor monitor, ExecutionContext context) throws InterruptedException, IOException { monitor.open(1); try { voidCleanUp(context); } finally { monitor.close(); } }
/** * Setup the target environment. * @param monitor the progress monitor of the operation * @param context the current execution context * @throws InterruptedException if this operation is interrupted * @throws IOException if failed to setup the target environment */ public void setUp( ExecutionMonitor monitor, ExecutionContext context) throws InterruptedException, IOException { monitor.open(1); try { voidSetUp(context); } finally { monitor.close(); } }
/** * Performs as {@link #setUp(ExecutionMonitor, ExecutionContext)} that does nothing. * @param context current context * @since 0.4.0 */ protected final void voidSetUp(ExecutionContext context) { YSLOG.info("I51001", context.getBatchId(), context.getFlowId(), context.getExecutionId(), context.getPhase(), getHandlerId()); }
/** * Performs as {@link #cleanUp(ExecutionMonitor, ExecutionContext)} that does nothing. * @param context current context * @since 0.4.0 */ protected final void voidCleanUp(ExecutionContext context) { YSLOG.info("I51002", context.getBatchId(), context.getFlowId(), context.getExecutionId(), context.getPhase(), getHandlerId()); } }