Examples of ProgramController


Examples of co.cask.cdap.app.runtime.ProgramController

   * Executes given MapReduce Program and block until it completed. On completion, return the MapReduceContext.
   *
   * @throws Exception if execution failed.
   */
  private MapReduceContext runAndWait(Program program, ProgramOptions options) throws Exception {
    ProgramController controller = programRunner.run(program, options);
    final MapReduceContext context = (controller instanceof MapReduceProgramController)
                                        ? ((MapReduceProgramController) controller).getContext()
                                        : null;
    // Execute the program.
    final SettableFuture<MapReduceContext> completion = SettableFuture.create();
    controller.addListener(new AbstractListener() {
      @Override
      public void stopped() {
        completion.set(context);
      }

View Full Code Here

Examples of co.cask.tigon.internal.app.runtime.ProgramController

  protected static FlowManager deployFlow(Class<? extends Flow> flowClz, Map<String, String> runtimeArgs,
                                   File...bundleEmbeddedJars) {
    Preconditions.checkNotNull(flowClz, "Flow class cannot be null");
    try {
      Location deployJar = deployClient.jarForTestBase(flowClz, bundleEmbeddedJars);
      ProgramController controller = deployClient.startFlow(new File(deployJar.toURI()), flowClz.getName(),
                                                            tmpFolder.newFolder(), runtimeArgs);
      return new DefaultFlowManager(controller);
    } catch (Exception e) {
      throw Throwables.propagate(e);
    }
View Full Code Here

Examples of org.spw.controller.ProgramController

    /**
     * Getter for property programs.
     * @return Value of property programs.
     */
    public Option[] getPrograms() {
        final ProgramController ctrl = new ProgramController();
        final List<Program> programs = ctrl.getPrograms();
        Option[] options = new Option[programs.size()];
        int i = 0;
        for (Program programField : programs) {
            options[i++] = new Option(programField, programField.toString());
        }
View Full Code Here

Examples of org.spw.controller.ProgramController

        this.year = year;
        //check the fundraising of this year
        Fundraising fundraising = new FundraisingController().read(year);
        target = (fundraising != null)? fundraising.getTarget() : new BigDecimal(0);
       
        programs = new ProgramController().getProgramsYear(year);
        volunteersByMonth = new ArrayList[13];
        Calendar cal = Calendar.getInstance();
        for (Program program: programs) {
            for (VolunteerApplication application : program.getApplications()) {
                Volunteer volunteer = application.getVolunteer();
View Full Code Here

Examples of org.spw.controller.ProgramController

    }
   
    public String buttonDelete_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            ProgramController  ctrl = new ProgramController();
            Program program = (Program)list.getObject(rk);
            ctrl.delete(program);
            list.refreshList();
        }
       
        return null;
    }
View Full Code Here

Examples of org.spw.controller.ProgramController

            statuses.put(status, new Integer(0));
        }
        numberDoubleImpact = 0;
        totalVols = 0;
       
        ProgramController ctrl = new ProgramController();
        List<Program> programs = ctrl.getProgramsYear(year);
        extracted = new ProgrammeAnalysis[programs.size()];
        int ix=0;
        for(Program program : programs) {
            setStatus(program);
            ProgrammeAnalysis pa = new ProgrammeAnalysis(
View Full Code Here

Examples of org.spw.controller.ProgramController

        setList(aList);       
    }
   
    public void refreshList() {
        aList.clear();
        ProgramController ctrl = new ProgramController();
        aList.addAll(ctrl.getPrograms());
    }
View Full Code Here

Examples of org.spw.controller.ProgramController

    protected void setUp() throws Exception
    {
        super.setUp();
        applicationCtrl = new VolunteerApplicationController();
        volunteerCtrl = new VolunteerController();
        programCtrl = new ProgramController();
       
        assertTrue(programCtrl.getPrograms().size() > 0);
        anyProgram = programCtrl.getPrograms().get(0);
    }
View Full Code Here

Examples of org.spw.controller.ProgramController

    /**
     * Test of toElement method, of class org.spw.volunteer.report.xml.VolunteerDetailsFundraisingXmlReport.
     */
    public void testToElement() throws Exception{
        System.out.println("toElement");
        ProgramController programCtrl = new ProgramController();
        VolunteerController voCtrl = new VolunteerController();
       
        // Create
        Volunteer volunteer = new Volunteer();
        volunteer.setFirstName(getName());
        volunteer.setLastName(getName());
        volunteer.setTypeVolunteer("Accepted");
        volunteer.setYearApplyingFor(1900);
        voCtrl.create(volunteer);

       
        VolunteerApplication application = new VolunteerApplication();
        List<Program> programs = programCtrl.getPrograms();
        assertFalse("No programs, must have at leat one for this test.",
                programs.size() == 0);
        Program program = programs.get(0);
        application.setProgram(program);
        application.setAcceptanceFeeReceived(new Date());
View Full Code Here

Examples of org.spw.controller.ProgramController

        try {
            id = new Long(value);
        } catch (NumberFormatException ex) {
            throw new ConverterException("Incorrect id for Program[" + value +"]");
        }
        ProgramController ctrl = new ProgramController();
        return ctrl.read(id);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.