/** * Returns the class loader which loaded this service class. * @return the class loader * @deprecated use {@link #getContext()} instead */ @Deprecated public ClassLoader getClassLoader() { return getContext().getClassLoader(); }
private static String resolve(ServiceProfile<?> profile, String key, String value) { assert profile != null; assert key != null; assert value != null; try { return profile.getContext().getContextParameters().replace(value, true); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(MessageFormat.format( "Failed to resolve {0} ({1})", key, value), e); } }
private List<String> extractCommand(ServiceProfile<?> profile, String prefix) throws IOException { try { return ProcessUtil.extractCommandLineTokens( prefix, profile.getConfiguration(), profile.getContext().getContextParameters()); } catch (IllegalArgumentException e) { throw new IOException(MessageFormat.format( "Failed to resolve command line tokens ({0})", profile.getPrefix() + '.' + prefix + '*'), e); } }
private List<String> extractCommand( ServiceProfile<?> profile, String prefix) throws IOException { try { return ProcessUtil.extractCommandLineTokens( prefix, profile.getConfiguration(), profile.getContext().getContextParameters()); } catch (IllegalArgumentException e) { throw new IOException(MessageFormat.format( "Failed to resolve command line tokens ({0})", profile.getPrefix() + '.' + prefix + '*'), e); } }
@Override protected void doConfigure(ServiceProfile<?> profile) throws InterruptedException, IOException { try { this.executor = ParallelJobExecutor.extract( profile.getPrefix(), profile.getConfiguration(), profile.getContext().getContextParameters()); } catch (IllegalArgumentException e) { throw new IOException(MessageFormat.format( "Failed to configure job scheduler: {0}", profile.getPrefix()), e); } }
@Override protected void configureExtension(ServiceProfile<?> profile) throws InterruptedException, IOException { try { this.executor = JschProcessExecutor.extract( profile.getPrefix(), profile.getConfiguration(), profile.getContext().getContextParameters()); } catch (IllegalArgumentException e) { throw new IOException(MessageFormat.format( "Failed to configure SSH: {0}", profile.getPrefix()), e); } catch (JSchException e) { throw new IOException(MessageFormat.format( "Failed to configure SSH: {0}", profile.getPrefix()), e); } }
@Override protected void configureExtension(ServiceProfile<?> profile) throws InterruptedException, IOException { try { this.executor = JschProcessExecutor.extract( profile.getPrefix(), profile.getConfiguration(), profile.getContext().getContextParameters()); } catch (IllegalArgumentException e) { throw new IOException(MessageFormat.format( "Failed to configure SSH: {0}", profile.getPrefix()), e); } catch (JSchException e) { throw new IOException(MessageFormat.format( "Failed to configure SSH: {0}", profile.getPrefix()), e); } }
if (resolve) { try { string = getContext().getContextParameters().replace(string, true); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(MessageFormat.format(
subPrefix, handlerKind, profile.getContext()); } catch (IllegalArgumentException e) { throw new IOException(MessageFormat.format(
String unresolved = entry.getValue(); try { String value = profile.getContext().getContextParameters().replace(unresolved, true); resolved.put(key, value); } catch (IllegalArgumentException e) {
String unresolved = entry.getValue(); try { String value = profile.getContext().getContextParameters().replace(unresolved, true); resolved.put(key, value); } catch (IllegalArgumentException e) {