Examples of addListener()


Examples of javax.servlet.AsyncContext.addListener()

  public void index(final HttpServletRequest req, final HttpServletResponse resp) throws IOException {
    if (req.isAsyncStarted()) {
      req.getAsyncContext().complete();
    } else if (req.isAsyncSupported()) {
      AsyncContext actx = req.startAsync();
      actx.addListener(this);
      resp.setContentType("text/plain");
      actx.setTimeout(3000);
      clients.add(actx);
      if (clientcount.incrementAndGet() == 1) {
        ticker.addTickListener(this);
View Full Code Here

Examples of javax.servlet.ServletContext.addListener()

    public static class SCL2 implements ServletContextListener {

        @Override
        public void contextInitialized(ServletContextEvent sce) {
            ServletContext sc = sce.getServletContext();
            sc.addListener(SCL3.class.getName());
        }

        @Override
        public void contextDestroyed(ServletContextEvent sce) {
            // NOOP
View Full Code Here

Examples of jcurses.widgets.Button.addListener()

    manager.addWidget(field, BorderLayoutManager.CENTER, WidgetsConstants.ALIGNMENT_CENTER,
        WidgetsConstants.ALIGNMENT_CENTER);

    if (okText != null) {
      Button ok = new Button("Goto");
      ok.addListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
          saveAndClose();
        }
      });
View Full Code Here

Examples of jpianotrain.staff.TuneFactory.addListener()

    case LESSONS:{
      throw new UnsupportedOperationException("mode is not implemented yet");
    }
    }
    if (tf!=null) {
      tf.addListener(this);
      oldFactory=tf;
    }
  }

  private static class BlinkThread extends Thread {
View Full Code Here

Examples of jsprit.analysis.toolbox.ComputationalLaboratory.addListener()

       
    /*
     * plot search progress of different algorithms
     */
    final XYLineChartBuilder chartBuilder = XYLineChartBuilder.newInstance("random variations", "iterations", "costs");
    computationalLab.addListener(new CalculationListener() {
     
      @Override
      public void calculationStarts(BenchmarkInstance p, final String algorithmName,VehicleRoutingAlgorithm algorithm, final int run) {
        algorithm.addListener(new IterationStartsListener() {
         
View Full Code Here

Examples of jsprit.core.algorithm.VehicleRoutingAlgorithm.addListener()

    @Test
    public void whenSettingPrematureBreak_itShouldReadTermination(){
        VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp,"src/test/resources/algorithmConfigForReaderTest2.xml");
        IterationCounter iCounter = new IterationCounter();
        vra.addListener(iCounter);
        vra.searchSolutions();
        Assert.assertEquals(100,iCounter.iterations);
    }

    @Test
View Full Code Here

Examples of jsprit.core.algorithm.recreate.InsertionStrategy.addListener()

      if(insertionName.equals("bestInsertion")){   
        insertionStrategy = iBuilder.build();
      }
      else throw new IllegalStateException("currently only 'bestInsertion' is supported");
     
      for(InsertionListener l : insertionListeners) insertionStrategy.addListener(l);

      algorithmListeners.addAll(algoListeners);
     
      return insertionStrategy;
    }
View Full Code Here

Examples of junit.framework.TestResult.addListener()

        TestDescriptorInternal testInternal = new DefaultTestClassDescriptor(idGenerator.generateId(), testClassName);
        resultProcessor.started(testInternal, new TestStartEvent(timeProvider.getCurrentTime()));

        Test adapter = createTest(testClassName);
        TestResult result = new TestResult();
        result.addListener(listener);
        adapter.run(result);

        resultProcessor.completed(testInternal.getId(), new TestCompleteEvent(timeProvider.getCurrentTime()));
    }
View Full Code Here

Examples of junit.framework.TestSuite.addListener()

    public static class OnAllServers {
        public static Test suite() throws Exception {
            final Report report = new Report(new File(System.getProperty("testsuite.results", "results.html")));
            TestSuite result = new TestSuite() {
                public void run(TestResult result) {
                    result.addListener(report);
                    report.startSuite();
                    super.run(result);
                    result.removeListener(report);
                    report.endSuite();
                }
View Full Code Here

Examples of lineage2.gameserver.model.Zone.addListener()

      if (random > 15000)
      {
        message = random - 15000;
        ThreadPoolManager.getInstance().schedule(new BroadcastMessageTask(1, zone), message);
      }
      zone.addListener(_zoneListener);
    }
    _buffTask = ThreadPoolManager.getInstance().scheduleAtFixedRate(new BuffTask(), TICK_BUFF_DELAY, TICK_BUFF_DELAY);
  }
 
  /**
 
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.