Package org.apache.droids.api

Examples of org.apache.droids.api.Droid


    }
    ApplicationContext context = new ClassPathXmlApplicationContext(
        "classpath:/org/apache/droids/dynamic/droids-core-context.xml");
   
    DroidsConfig config = (DroidsConfig) context.getBean("org.apache.droids.dynamic.DroidsConfig");
    Droid droid = config.getDroid(name);
   
    if (droid == null) {
      log.error("Droid " + name + " is not defined");
      log.error(getUsage());
      return;
    }
   
    log.info("A p a c h e    D r o i d s - an intelligent robot framework");
    if (droid instanceof CrawlingDroid) {
      List<String> locations = new ArrayList<String>();
      if (location == null) {
        log.error("Droid " + name + " is a crawler, however you have not defined a starting location.");
        log.error(getUsage());
        return;
      }
      locations.add(location);
      ((CrawlingDroid) droid).setInitialLocations(locations);
    }
    droid.init();
    droid.start();
    droid.getTaskMaster().awaitTermination(0, TimeUnit.MILLISECONDS);
  }
View Full Code Here


   * Start a given Droid. First we will look up the droid
   * identified by the given name and then start it.
   * @param name the name of the droid we want to use
   */
  public void start(String name) throws DroidsException {
    Droid droid = getDroid(name);
   
    droid.init();
    droid.start();
  }
View Full Code Here

    }
    ApplicationContext context = new ClassPathXmlApplicationContext(
        "classpath:/org/apache/droids/dynamic/droids-core-context.xml");
   
    DroidsConfig config = (DroidsConfig) context.getBean("org.apache.droids.dynamic.DroidsConfig");
    Droid droid = config.getDroid(name);
   
    if (droid == null) {
      LOG.error("Droid " + name + " is not defined");
      LOG.error(getUsage());
      return;
    }
   
    LOG.info("A p a c h e    D r o i d s - an intelligent robot framework");
    if (droid instanceof CrawlingDroid) {
      List<String> locations = new ArrayList<String>();
      if (location == null) {
        LOG.error("Droid " + name + " is a crawler, however you have not defined a starting location.");
        LOG.error(getUsage());
        return;
      }
      locations.add(location);
      ((CrawlingDroid) droid).setInitialLocations(locations);
    }
    droid.init();
    droid.start();
    droid.getTaskMaster().awaitTermination(0, TimeUnit.MILLISECONDS);
  }
View Full Code Here

TOP

Related Classes of org.apache.droids.api.Droid

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.