Package com.almende.eve.capabilities

Examples of com.almende.eve.capabilities.Config


   * @param cl
   *            the custom classloader
   */
  public static void loadAgents(final InputStream is, final WakeService ws,
      final ClassLoader cl) {
    final Config config = YamlReader.load(is).expand();
   
    final ArrayNode agents = (ArrayNode) config.get("agents");
    for (final JsonNode agent : agents) {
      final AgentConfig agentConfig = new AgentConfig((ObjectNode) agent);
      final Agent newAgent = new AgentBuilder().withWakeService(ws)
          .withClassLoader(cl).with(agentConfig).build();
      LOG.info("Created agent:" + newAgent.getId());
View Full Code Here


   * @return the config
   */
  public static Config load(final InputStream is) {
    final ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
    try {
      return new Config((ObjectNode) mapper.readTree(is));
    } catch (final JsonProcessingException e) {
      LOG.log(Level.WARNING, "Couldn't parse Yaml file", e);
    } catch (final IOException e) {
      LOG.log(Level.WARNING, "Couldn't read Yaml file", e);
    }
View Full Code Here

TOP

Related Classes of com.almende.eve.capabilities.Config

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.