congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
ProfileContext
Code IndexAdd Tabnine to your IDE (free)

How to use
ProfileContext
in
com.asakusafw.yaess.core

Best Java code snippets using com.asakusafw.yaess.core.ProfileContext (Showing top 15 results out of 315)

origin: asakusafw/asakusafw

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);
  }
}
origin: asakusafw/asakusafw

/**
 * Creates a new context with system variables as context parameters.
 * @param classLoader current class loader
 * @return the created context object
 * @throws IllegalArgumentException if some parameters were {@code null}
 */
public static ProfileContext system(ClassLoader classLoader) {
  return new ProfileContext(classLoader, new VariableResolver(System.getenv()));
}
origin: asakusafw/asakusafw

/**
 * 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();
}
origin: asakusafw/asakusafw

/**
 * 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));
}
origin: asakusafw/asakusafw

  throw new IllegalArgumentException("classLoader must not be null"); //$NON-NLS-1$
return load(properties, prefix, serviceBaseClass, ProfileContext.system(classLoader));
origin: asakusafw/asakusafw

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);
  }
}
origin: asakusafw/asakusafw

env.putAll(System.getenv());
env.putAll(toMap(variables));
result.context = new ProfileContext(loader, new VariableResolver(env));
Properties properties = CommandLineUtil.loadProperties(file);
result.profile = YaessProfile.load(properties, result.context);
origin: asakusafw/asakusafw

  loaded = context.getClassLoader().loadClass(targetClassName);
} catch (ClassNotFoundException e) {
  throw new IllegalArgumentException(MessageFormat.format(
origin: asakusafw/asakusafw

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);
  }
}
origin: asakusafw/asakusafw

@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);
  }
}
origin: asakusafw/asakusafw

@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);
  }
}
origin: asakusafw/asakusafw

@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);
  }
}
origin: asakusafw/asakusafw

if (resolve) {
  try {
    string = getContext().getContextParameters().replace(string, true);
  } catch (IllegalArgumentException e) {
    throw new IllegalArgumentException(MessageFormat.format(
origin: asakusafw/asakusafw

String unresolved = entry.getValue();
try {
  String value = profile.getContext().getContextParameters().replace(unresolved, true);
  resolved.put(key, value);
} catch (IllegalArgumentException e) {
origin: asakusafw/asakusafw

String unresolved = entry.getValue();
try {
  String value = profile.getContext().getContextParameters().replace(unresolved, true);
  resolved.put(key, value);
} catch (IllegalArgumentException e) {
com.asakusafw.yaess.coreProfileContext

Javadoc

The profile context for YAESS.

Most used methods

  • getContextParameters
    Returns context parameters (may be environment variables).
  • <init>
    Creates a new instance.
  • getClassLoader
    Returns a class loader to load services.
  • system
    Creates a new context with system variables as context parameters.

Popular in Java

  • Updating database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • putExtra (Intent)
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now