Examples of addListener()


Examples of net.tomp2p.futures.FutureResponse.addListener()

                public void operationComplete(final FutureChannelCreator futureChannelCreator) throws Exception {
                    if (futureChannelCreator.isSuccess()) {
                        FutureResponse futureResponse = getTaskRPC().sendResult(senderAddress,
                                futureChannelCreator.getChannelCreator(), taskId, outputData2,
                                peer.getPeerBean().getKeyPair(), false, sign);
                        futureResponse.addListener(new BaseFutureAdapter<FutureResponse>() {
                            @Override
                            public void operationComplete(FutureResponse future) throws Exception {
                                if (future.isSuccess()) {
                                    synchronized (lock) {
                                        status.put(taskKey, Status.SUCCESS_RESULT_SENT);
View Full Code Here

Examples of net.tomp2p.futures.FutureRouting.addListener()

                if (future.isSuccess()) {
                    final ChannelCreator channelCreator = future.getChannelCreator();
                    // routing, find close peers
                    final FutureRouting futureRouting = createRouting(locationKey, null, null, routingConfiguration,
                            requestP2PConfiguration, Type.REQUEST_4, channelCreator);
                    futureRouting.addListener(new BaseFutureAdapter<FutureRouting>() {
                        @Override
                        public void operationComplete(FutureRouting future) throws Exception {
                            if (futureRouting.isSuccess()) {
                                // direct hits mean that there
                                // is a task scheduled
View Full Code Here

Examples of net.tomp2p.futures.FutureSend.addListener()

        .send(Number160.createHash(message.getTargetKey())).setObject(encryptedMessage)
        .setRequestP2PConfiguration(createSendingConfiguration()).start();

    // attach a future listener to log, handle and notify events
    FutureRoutedListener listener = new FutureRoutedListener(message, targetPublicKey, this);
    futureSend.addListener(listener);
    boolean success = listener.await();

    if (success) {
      logger.debug("Message sent. Target key = '{}', Message ID = '{}'.",
          message.getTargetKey(), message.getMessageID());
View Full Code Here

Examples of net.tomp2p.relay.FutureRelay.addListener()

          // setup relay
          LOG.debug("bootstrap completed");
          final FutureRelay futureRelay = new FutureRelay();
          final DistributedRelay distributedRelay = startSetupRelay(futureRelay);
          futureBootstrapNAT.futureRelay(futureRelay);
          futureRelay.addListener(new BaseFutureAdapter<FutureRelay>() {

            @Override
            public void operationComplete(FutureRelay future) throws Exception {
              // find neighbors again
              if (future.isSuccess()) {
View Full Code Here

Examples of net.zero.smarttrace.Tracer.addListener()

    TraceFilter filter=new TraceFilter();
    filter.setTraceFilterName(configName);
    filter.loadConfiguration();
   
    Tracer tracer=new Tracer(config, filter);
    tracer.addListener(new EventsViewUpdater((TableViewer) Launcher.singleton.events));
   
    tracer.connect();
    }
 
  }
View Full Code Here

Examples of nginx.clojure.NginxHttpServerChannel.addListener()

 
  @Override
  public Object[] invoke(Map<String, Object> request) {
    NginxRequest req = (NginxRequest) request;
    NginxHttpServerChannel downstream = req.handler().hijack(req, true);
    downstream.addListener(downstream, new ChannelListener<NginxHttpServerChannel>() {

      @Override
      public void onClose(NginxHttpServerChannel data) {
        log.info("***downstream closed!");
      }
View Full Code Here

Examples of nu.fw.jeti.plugins.jingle.jingle.IncomingJingleSession.addListener()

            if(option == JOptionPane.NO_OPTION){
                      try {
                          // Accept the call
                          IncomingJingleSession incoming = request.accept();
                          incoming.start();
                            incoming.addListener(createSessionListener(request.getFrom()));
                      }
                      catch (Exception e) {
                          e.printStackTrace();
                      }
            }
View Full Code Here

Examples of nu.fw.jeti.plugins.jingle.jingle.OutgoingJingleSession.addListener()

            e.printStackTrace();
          }
         }
            try {
                 OutgoingJingleSession jos = manager.createOutgoingJingleSession(jidStatus.getCompleteJID());
                 jos.addListener(createSessionListener(jidStatus.getCompleteJID()));
                 jos.start();
                 sessions.put(jidStatus.getCompleteJID(),jos);
                 endVoiceMenu.setEnabled(true);
                } catch (XMPPException e) {
          // TODO Auto-generated catch block
View Full Code Here

Examples of nz.ac.waikato.modeljunit.GreedyTester.addListener()

     
      tester.addCoverageMetric(new StateCoverage());
      tester.addCoverageMetric(new TransitionCoverage());
      tester.addCoverageMetric(new TransitionPairCoverage());
     
      tester.addListener(new StopOnFailureListener());
     
      tester.generate(10000);
     
      tester.printCoverage();
    }
View Full Code Here

Examples of nz.ac.waikato.modeljunit.RandomTester.addListener()

    graph.printGraphDot("ecinema.dot");
    CoverageMetric trans = tester.addCoverageMetric(new TransitionCoverage());
    CoverageMetric trpairs = tester.addCoverageMetric(new TransitionPairCoverage());
    CoverageMetric states = tester.addCoverageMetric(new StateCoverage());
    CoverageMetric actions = tester.addCoverageMetric(new ActionCoverage());
    tester.addListener("verbose");
    // this illustrates how to generate tests upto a given level of coverage.
    int steps = 0;
    while (actions.getPercentage() < 100 /* || steps < 1000*/) {
      tester.generate();
      steps++;
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.