@Override public ChannelHandler last() { return delegate.last(); }
static HttpSession get(Channel ch) { final ChannelHandler lastHandler = ch.pipeline().last(); if (lastHandler instanceof HttpSession) { return (HttpSession) lastHandler; } return INACTIVE; }
@Nullable static HttpServer get(Channel channel) { final ChannelPipeline p = channel.pipeline(); final ChannelHandler lastHandler = p.last(); if (lastHandler instanceof HttpServer) { return (HttpServer) lastHandler; } for (ChannelHandler h : p.toMap().values()) { if (h instanceof HttpServer) { return (HttpServer) h; } } return null; }
@Override public ChannelHandler last() { return pipeline.last(); }
public EmbeddedChannelPipelineDelegate(EmbeddedChannel newChannel) { pipeline = newChannel.pipeline(); final ChannelHandler lastHandler = pipeline.last(); if (null != lastHandler) { List<String> names = pipeline.names(); for (String name : names) { if (pipeline.get(name) == lastHandler) { lastHandlerName = name; return; } } lastHandlerName = null; } else { lastHandlerName = null; } }
@Override public ChannelHandler last() { return pipeline.last(); }
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { if (this == ctx.pipeline().last()) logger.error("Exception in response", cause); ctx.fireExceptionCaught(cause); } }
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { if (this == ctx.pipeline().last()) logger.error("Exception in response", cause); ctx.fireExceptionCaught(cause); } }
public void registerCounterNotificationManager(TestCounterNotificationManager manager) { ClientHandler handler = (ClientHandler) ch.pipeline().last(); handler.registerCounterNotificationManager(manager); } }
private final void putConnection() { conn.channel.config().setAutoRead(false); InboundHandler handler = (InboundHandler)conn.channel.pipeline().last(); handler.command = null; conn.updateLastUsed(); command.node.putAsyncConnection(conn, eventState.index); }
Either<List<String>, Integer> readN() { BatchingClientHandler last = (BatchingClientHandler) ch.pipeline().last(); return last.errors.isEmpty() ? Either.newRight(last.n) : Either.newLeft(last.errors); }
private TestResponse execute(Op op, long expectedResponseMessageId) { writeOp(op); ClientHandler handler = (ClientHandler) ch.pipeline().last(); return handler.getResponse(expectedResponseMessageId); }
public TestResponse commitTx(Xid xid) { CommitOrRollbackOp op = new CommitOrRollbackOp(protocolVersion, defaultCacheName, xid, true); writeOp(op); ClientHandler handler = (ClientHandler) ch.pipeline().last(); return handler.getResponse(op.id); }
public Map<String, String> stats() { StatsOp op = new StatsOp(0xA0, protocolVersion, (byte) 0x15, defaultCacheName, (byte) 1, 0, null); boolean writeFuture = writeOp(op); // Get the handler instance to retrieve the answer. ClientHandler handler = (ClientHandler) ch.pipeline().last(); TestStatsResponse resp = (TestStatsResponse) handler.getResponse(op.id); return resp.stats; }
public TestBulkGetKeysResponse bulkGetKeys(int scope) { BulkGetKeysOp op = new BulkGetKeysOp(0xA0, protocolVersion, (byte) 0x1D, defaultCacheName, (byte) 1, 0, scope); boolean writeFuture = writeOp(op); // Get the handler instance to retrieve the answer. ClientHandler handler = (ClientHandler) ch.pipeline().last(); return (TestBulkGetKeysResponse) handler.getResponse(op.id); }
public TestQueryResponse query(byte[] query) { QueryOp op = new QueryOp(0xA0, protocolVersion, defaultCacheName, (byte) 1, 0, query); boolean writeFuture = writeOp(op); // Get the handler instance to retrieve the answer. ClientHandler handler = (ClientHandler) ch.pipeline().last(); return (TestQueryResponse) handler.getResponse(op.id); }
public TestResponse forgetTx(Xid xid) { TxOp op = new ForgetTxOp(protocolVersion, xid); writeOp(op); ClientHandler handler = (ClientHandler) ch.pipeline().last(); return handler.getResponse(op.id); }
public TestResponse recovery() { Op op = new RecoveryOp(protocolVersion); writeOp(op); ClientHandler handler = (ClientHandler) ch.pipeline().last(); return handler.getResponse(op.id); }
public TestResponse addClientListener(TestClientListener listener, boolean includeState, Optional<KeyValuePair<String, List<byte[]>>> filterFactory, Optional<KeyValuePair<String, List<byte[]>>> converterFactory, boolean useRawData) { AddClientListenerOp op = new AddClientListenerOp(0xA0, protocolVersion, defaultCacheName, (byte) 1, 0, listener.getId(), includeState, filterFactory, converterFactory, useRawData); ClientHandler handler = (ClientHandler) ch.pipeline().last(); handler.addClientListener(listener); writeOp(op); return handler.getResponse(op.id); }
public TestResponse removeClientListener(byte[] listenerId) { RemoveClientListenerOp op = new RemoveClientListenerOp(0xA0, protocolVersion, defaultCacheName, (byte) 1, 0, listenerId); ClientHandler handler = (ClientHandler) ch.pipeline().last(); writeOp(op); TestResponse response = handler.getResponse(op.id); if (response.getStatus() == Success) handler.removeClientListener(listenerId); return response; }