private void addPendingWrite(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) { PendingWriteQueue pendingWrites = this.pendingWrites; if (pendingWrites == null) { this.pendingWrites = pendingWrites = new PendingWriteQueue(ctx); } pendingWrites.add(msg, promise); }
private void addPendingWrite(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) { PendingWriteQueue pendingWrites = this.pendingWrites; if (pendingWrites == null) { this.pendingWrites = pendingWrites = new PendingWriteQueue(ctx); } pendingWrites.add(msg, promise); }
private void addPendingWrite(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) { PendingWriteQueue pendingWrites = this.pendingWrites; if (pendingWrites == null) { this.pendingWrites = pendingWrites = new PendingWriteQueue(ctx); } pendingWrites.add(msg, promise); }
@Override public void channelRegistered(ChannelHandlerContext ctx) throws Exception { this.queue = new PendingWriteQueue(ctx); this.scheduledTimeouts = new ConcurrentHashMap<>(); this.sentButUnacknowledgedSubContainer = new ConcurrentHashMap<>(); this.correlationToParentContainer = new ConcurrentHashMap<>(); this.containerCorrelationIdMap = new ConcurrentHashMap<>(); this.responsesToBeDelivered = new ConcurrentHashMap<>(); this.correlationIdGenerator = new AtomicInteger(); this.deliveredItems = new AtomicLong(); this.erroredItems = new AtomicLong(); this.deliveredContainers = new AtomicLong(); this.erroredContainers = new AtomicLong(); super.channelRegistered(ctx); }
@Override public void channelRegistered(ChannelHandlerContext ctx) { this.queue = new PendingWriteQueue(ctx); try { Field prevField = FieldUtils.getField(ctx.getClass(), "prev", true); if(prevField != null) { ChannelHandlerContext prevContext = (ChannelHandlerContext) prevField.get(ctx); prevChannelHandler = prevContext.handler(); } } catch(Exception e) { logger.error("Error accessing field 'prev'", e); } }