@Override public InetSocketAddress getLocalAddress() { return (InetSocketAddress) connection.getLocalAddress(); }
@Override public InetSocketAddress getLocalAddress() { return (InetSocketAddress) connection.getLocalAddress(); }
/** * @return the Internet Protocol (IP) port number of the interface on which * the request was received. */ public int getLocalPort() { if (localPort == -1) { localPort = ((InetSocketAddress) connection.getLocalAddress()).getPort(); } return localPort; }
/** * @return the Internet Protocol (IP) port number of the interface on which * the request was received. */ public int getLocalPort() { if (localPort == -1) { localPort = ((InetSocketAddress) connection.getLocalAddress()).getPort(); } return localPort; }
/** * @return the Internet Protocol (IP) port number of the interface on which * the request was received. */ public int getLocalPort() { if (localPort == -1) { localPort = ((InetSocketAddress) connection.getLocalAddress()).getPort(); } return localPort; }
/** * @return the Internet Protocol (IP) port number of the interface on which * the request was received. */ public int getLocalPort() { if (localPort == -1) { localPort = ((InetSocketAddress) connection.getLocalAddress()).getPort(); } return localPort; }
@Override public void onBindEvent(Connection connection) { final String bindAddress = connection.getLocalAddress().toString(); if (boundConnections.putIfAbsent(connection, bindAddress) == null) { boundAddresses.add(bindAddress); } }
@Override public Executor getThreadPoolFor(Connection connection, IOEvent ioEvent) { if (WORKER_THREAD_EVENT_SET.contains(ioEvent)) { final String ip = ((InetSocketAddress) connection.getLocalAddress()).getAddress().getHostAddress(); final int port = ((InetSocketAddress) connection.getLocalAddress()).getPort(); return executorProvider.getExecutor(new DefaultServerAddress(ip, port)); } else { // Run other types of IOEvent in selector thread. return null; } }
private F retrieveFilter(Connection connection) { final InetSocketAddress inetAddress = (InetSocketAddress) connection.getLocalAddress(); final int port = inetAddress.getPort(); final String ip = inetAddress.getAddress().getHostAddress(); return filters.get(new ServerAddress(ip, port)); }
private F retrieveFilter(Connection connection) { final InetSocketAddress inetAddress = (InetSocketAddress) connection.getLocalAddress(); final int port = inetAddress.getPort(); final String ip = inetAddress.getAddress().getHostAddress(); return filters.get(new DefaultServerAddress(ip, port)); }
/** * @return a {@link DataChunk} representing the host name of the * Internet Protocol (IP) interface on which the request was received. */ public DataChunk localName() { if (localNameC.isNull()) { InetAddress inetAddr = ((InetSocketAddress) connection .getLocalAddress()).getAddress(); localNameC.setString(inetAddr.getHostName()); } return localNameC; }
/** * @return a {@link DataChunk} representing the Internet Protocol (IP) * address of the interface on which the request was received. */ public DataChunk localAddr() { if (localAddressC.isNull()) { InetAddress inetAddr = ((InetSocketAddress) connection .getLocalAddress()).getAddress(); localAddressC.setString(inetAddr.getHostAddress()); } return localAddressC; }
/** * @return a {@link DataChunk} representing the host name of the * Internet Protocol (IP) interface on which the request was received. */ public DataChunk localName() { if (localNameC.isNull()) { InetAddress inetAddr = ((InetSocketAddress) connection .getLocalAddress()).getAddress(); localNameC.setString(inetAddr.getHostName()); } return localNameC; }
/** * @return a {@link DataChunk} representing the Internet Protocol (IP) * address of the interface on which the request was received. */ public DataChunk localAddr() { if (localAddressC.isNull()) { InetAddress inetAddr = ((InetSocketAddress) connection .getLocalAddress()).getAddress(); localAddressC.setString(inetAddr.getHostAddress()); } return localAddressC; }
/** * @return a {@link DataChunk} representing the Internet Protocol (IP) * address of the interface on which the request was received. */ public DataChunk localAddr() { if (localAddressC.isNull()) { InetAddress inetAddr = ((InetSocketAddress) connection .getLocalAddress()).getAddress(); localAddressC.setString(inetAddr.getHostAddress()); } return localAddressC; }
/** * @return a {@link DataChunk} representing the host name of the * Internet Protocol (IP) interface on which the request was received. */ public DataChunk localName() { if (localNameC.isNull()) { InetAddress inetAddr = ((InetSocketAddress) connection .getLocalAddress()).getAddress(); localNameC.setString(inetAddr.getHostName()); } return localNameC; }
/** * @return a {@link DataChunk} representing the Internet Protocol (IP) * address of the interface on which the request was received. */ public DataChunk localAddr() { if (localAddressC.isNull()) { InetAddress inetAddr = ((InetSocketAddress) connection .getLocalAddress()).getAddress(); localAddressC.setString(inetAddr.getHostAddress()); } return localAddressC; }
/** * @return a {@link DataChunk} representing the Internet Protocol (IP) * address of the interface on which the request was received. */ public DataChunk localAddr() { if (localAddressC.isNull()) { InetAddress inetAddr = ((InetSocketAddress) connection .getLocalAddress()).getAddress(); localAddressC.setString(inetAddr.getHostAddress()); } return localAddressC; }
@Before public void before() throws UnknownHostException { ioStrategy = new ExecutorPerServerAddressIOStrategy(executorProvider); when(connection.getLocalAddress()).thenReturn(new InetSocketAddress(InetAddress.getLocalHost(), 80)); when(executorProvider.getExecutor(any(ServerAddress.class))).thenReturn(executor); }
private DefaultHttpRequestContext createRequestContext(FilterChainContext ctx, String scheme, GrizzlyHttpRequestAdapter httpRequest) { DefaultClientConnection clientConnection; SSLSession sslSession = (SSLSession) ctx.getAttributes().getAttribute(SSL_SESSION_ATTRIBUTE_KEY); if (sslSession != null) { clientConnection = new DefaultClientConnection(sslSession, (InetSocketAddress) ctx.getConnection().getPeerAddress()); } else { clientConnection = new DefaultClientConnection((InetSocketAddress) ctx.getConnection().getPeerAddress()); } ServerConnection serverConnection = new DefaultServerConnection((InetSocketAddress) ctx.getConnection().getLocalAddress()); return new DefaultHttpRequestContext(scheme, httpRequest, clientConnection, serverConnection); }