@Override public NioInboundPipeline wakeup() { addTaskAndWakeup(new NioPipelineTask(this) { @Override protected void run0() throws IOException { registerOp(OP_READ); NioInboundPipeline.this.run(); } }); return this; } }
@Override public long lastReadTimeMillis() { return inboundPipeline.lastReadTimeMillis(); }
@Override public void run() { inboundPipeline.publishMetrics(); } });
@Override protected void run0() throws IOException { registerOp(OP_READ); NioInboundPipeline.this.run(); } });
@Override public InboundPipeline addLast(InboundHandler... addedHandlers) { checkNotNull(addedHandlers, "handlers can't be null"); for (InboundHandler addedHandler : addedHandlers) { fixDependencies(addedHandler); addedHandler.setChannel(channel).handlerAdded(); } updatePipeline(append(handlers, addedHandlers)); return this; }
@Override public void start() { try { // before starting the channel, the socketChannel need to be put in // non blocking mode since that is mandatory for the NioChannel. socketChannel.configureBlocking(false); channelInitializer.initChannel(this); } catch (Exception e) { throw new HazelcastException("Failed to start " + this, e); } inboundPipeline.start(); outboundPipeline.start(); }
@Override public InboundPipeline remove(InboundHandler handler) { return replace(handler); }
private NioInboundPipeline newInboundPipeline(NioChannel channel) { int index = hashToIndex(nextInputThreadIndex.getAndIncrement(), inputThreadCount); NioThread[] threads = inputThreads; if (threads == null) { throw new IllegalStateException("NioNetworking is shutdown!"); } return new NioInboundPipeline( channel, threads[index], errorHandler, loggingService.getLogger(NioInboundPipeline.class), ioBalancer); }
@Override public void run() { for (NioChannel channel : channels) { final NioInboundPipeline inboundPipeline = channel.inboundPipeline; NioThread inputThread = inboundPipeline.owner(); if (inputThread != null) { inputThread.addTaskAndWakeup(new Runnable() { @Override public void run() { inboundPipeline.publishMetrics(); } }); } final NioOutboundPipeline outboundPipeline = channel.outboundPipeline; NioThread outputThread = outboundPipeline.owner(); if (outputThread != null) { outputThread.addTaskAndWakeup(new Runnable() { @Override public void run() { outboundPipeline.publishMetrics(); } }); } } } }
@Override public InboundPipeline addLast(InboundHandler... addedHandlers) { checkNotNull(addedHandlers, "handlers can't be null"); for (InboundHandler addedHandler : addedHandlers) { fixDependencies(addedHandler); addedHandler.setChannel(channel).handlerAdded(); } updatePipeline(append(handlers, addedHandlers)); return this; }
@Override protected void run0() throws IOException { registerOp(OP_READ); NioInboundPipeline.this.run(); } });
@Override public void start() { try { // before starting the channel, the socketChannel need to be put in // non blocking mode since that is mandatory for the NioChannel. socketChannel.configureBlocking(false); channelInitializer.initChannel(this); } catch (Exception e) { throw new HazelcastException("Failed to start " + this, e); } inboundPipeline.start(); outboundPipeline.start(); }
@Override public InboundPipeline remove(InboundHandler handler) { return replace(handler); }
private NioInboundPipeline newInboundPipeline(NioChannel channel) { int index = hashToIndex(nextInputThreadIndex.getAndIncrement(), inputThreadCount); NioThread[] threads = inputThreads; if (threads == null) { throw new IllegalStateException("NioNetworking is shutdown!"); } return new NioInboundPipeline( channel, threads[index], errorHandler, loggingService.getLogger(NioInboundPipeline.class), ioBalancer); }
@Override public void run() { for (NioChannel channel : channels) { final NioInboundPipeline inboundPipeline = channel.inboundPipeline; NioThread inputThread = inboundPipeline.owner(); if (inputThread != null) { inputThread.addTaskAndWakeup(new Runnable() { @Override public void run() { inboundPipeline.publishMetrics(); } }); } final NioOutboundPipeline outboundPipeline = channel.outboundPipeline; NioThread outputThread = outboundPipeline.owner(); if (outputThread != null) { outputThread.addTaskAndWakeup(new Runnable() { @Override public void run() { outboundPipeline.publishMetrics(); } }); } } } }
@Override public InboundPipeline replace(InboundHandler oldHandler, InboundHandler... addedHandlers) { checkNotNull(oldHandler, "oldHandler can't be null"); checkNotNull(addedHandlers, "addedHandlers can't be null"); InboundHandler[] newHandlers = replaceFirst(handlers, oldHandler, addedHandlers); if (newHandlers == handlers) { throw new IllegalArgumentException("handler " + oldHandler + " isn't part of the pipeline"); } for (InboundHandler addedHandler : addedHandlers) { fixDependencies(addedHandler); addedHandler.setChannel(channel).handlerAdded(); } updatePipeline(newHandlers); return this; }
@Override public void run() { inboundPipeline.publishMetrics(); } });
@Override public NioInboundPipeline wakeup() { addTaskAndWakeup(new NioPipelineTask(this) { @Override protected void run0() throws IOException { registerOp(OP_READ); NioInboundPipeline.this.run(); } }); return this; } }
@Override public long lastReadTimeMillis() { return inboundPipeline.lastReadTimeMillis(); }
@Override public InboundPipeline replace(InboundHandler oldHandler, InboundHandler... addedHandlers) { checkNotNull(oldHandler, "oldHandler can't be null"); checkNotNull(addedHandlers, "addedHandlers can't be null"); InboundHandler[] newHandlers = replaceFirst(handlers, oldHandler, addedHandlers); if (newHandlers == handlers) { throw new IllegalArgumentException("handler " + oldHandler + " isn't part of the pipeline"); } for (InboundHandler addedHandler : addedHandlers) { fixDependencies(addedHandler); addedHandler.setChannel(channel).handlerAdded(); } updatePipeline(newHandlers); return this; }