Package org.jboss.netty.channel

Examples of org.jboss.netty.channel.ChannelFutureListener


     
      Channel channel = getChannel(leaderChannel);
      sendSlaveMonitorInfoEvent.setChannel(channel);
      ChannelFuture channelFuture = channel.write(sendSlaveMonitorInfoEvent);

      channelFuture.addListener(new ChannelFutureListener() {
        public void operationComplete(ChannelFuture future) {
          if (!future.isSuccess()) {
            responseQueue.remove(event.getSequence());
            logger.error("Slavesocket write error when trying to get tasks from master.", future.getCause());
            future.getChannel().close();
View Full Code Here


        if (requests == null)
            return;

        pendings.incrementAndGet();
        ChannelFuture future = channel.write(requests);
        future.addListener(new ChannelFutureListener() {
            public void operationComplete(ChannelFuture future)
                    throws Exception {

                pendings.decrementAndGet();
                if (!future.isSuccess()) {
View Full Code Here

      if (host == null) {
         throw new IOException("tso.host missing from configuration");
      }

      bootstrap.connect(new InetSocketAddress(host, port)).addListener(new ChannelFutureListener() {
        
         @Override
         public void operationComplete(ChannelFuture future) throws Exception {
            if (future.isSuccess()) {
               System.out.println("Compacter connected!");
View Full Code Here

            IOException e = new IOException("Max connection retries exceeded");
            bailout(e);
            throw e;
         }
         retries++;
         bootstrap.connect(addr).addListener(new ChannelFutureListener() {
            @Override
            public void operationComplete(ChannelFuture future) throws Exception {
               LOG.debug("Connection completed. Success: " + future.isSuccess());
            }
         });
View Full Code Here

            }

            AbortRequest ar = new AbortRequest();
            ar.startTimestamp = transactionId;
            ChannelFuture f = channel.write(ar);
            f.addListener(new ChannelFutureListener() {
               public void operationComplete(ChannelFuture future) {
                  if (!future.isSuccess()) {
                     error(new IOException("Error writing to socket"));
                  }
               }
View Full Code Here

               createCallbacks.add(cb);
            }

            TimestampRequest tr = new TimestampRequest();
            ChannelFuture f = channel.write(tr);
            f.addListener(new ChannelFutureListener() {
                  public void operationComplete(ChannelFuture future) {
                     if (!future.isSuccess()) {
                        error(new IOException("Error writing to socket"));
                     }
                  }
View Full Code Here

            }
           
            CommitQueryRequest qr = new CommitQueryRequest(startTimestamp,
                                                           pendingWriteTimestamp);
            ChannelFuture f = channel.write(qr);
            f.addListener(new ChannelFutureListener() {
                  public void operationComplete(ChannelFuture future) {
                     if (!future.isSuccess()) {
                        error(new IOException("Error writing to socket"));
                     }
                  }
View Full Code Here

           
            CommitRequest cr = new CommitRequest();
            cr.startTimestamp = transactionId;
            cr.rows = rows;
            ChannelFuture f = channel.write(cr);
            f.addListener(new ChannelFutureListener() {
                  public void operationComplete(ChannelFuture future) {
                     if (!future.isSuccess()) {
                        error(new IOException("Error writing to socket"));
                     }
                  }
View Full Code Here

            LOG.warn("No more message");
            // wait for all outstanding msgs and then close the channel
            // if (outstandingTransactions.intValue() == 0) {
            if (outstandingTransactions == 0) {
               LOG.warn("Close channel");
               channel.close().addListener(new ChannelFutureListener() {
                  public void operationComplete(ChannelFuture future) {
                     answer.offer(true);
                  }
               });
            }
View Full Code Here

         try {
            FullAbortRequest far = new FullAbortRequest();
            far.startTimestamp = transactionId;

            ChannelFuture f = channel.write(far);
            f.addListener(new ChannelFutureListener() {
                  public void operationComplete(ChannelFuture future) {
                     if (!future.isSuccess()) {
                        error(new IOException("Error writing to socket"));
                     } else {
                        cb.complete();
View Full Code Here

TOP

Related Classes of org.jboss.netty.channel.ChannelFutureListener

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.