public static Channel inheritedChannel() throws IOException { return System.inheritedChannel(); }
public static Channel inheritedChannel() throws IOException { return System.inheritedChannel(); }
public static Channel inheritedChannel() throws IOException { return System.inheritedChannel(); }
public static Channel inheritedChannel() throws IOException { return System.inheritedChannel(); }
@SuppressWarnings("unchecked") protected <T> T getSystemInheritedChannel(final Class<?> channelType) throws IOException { final Channel inheritedChannel = System.inheritedChannel(); if (inheritedChannel == null) { throw new IOException("Inherited channel is not set"); } if (!(channelType.isInstance(inheritedChannel))) { throw new IOException("Inherited channel is not " + channelType.getName() + ", but " + inheritedChannel.getClass().getName()); } return (T) inheritedChannel; }
@SuppressWarnings("unchecked") protected <T> T getSystemInheritedChannel(final Class<?> channelType) throws IOException { final Channel inheritedChannel = System.inheritedChannel(); if (inheritedChannel == null) { throw new IOException("Inherited channel is not set"); } if (!(channelType.isInstance(inheritedChannel))) { throw new IOException("Inherited channel is not " + channelType.getName() + ", but " + inheritedChannel.getClass().getName()); } return (T) inheritedChannel; }
@SuppressWarnings("unchecked") protected <T> T getSystemInheritedChannel(final Class<?> channelType) throws IOException { final Channel inheritedChannel = System.inheritedChannel(); if (inheritedChannel == null) { throw new IOException("Inherited channel is not set"); } if (!(channelType.isInstance(inheritedChannel))) { throw new IOException("Inherited channel is not " + channelType.getName() + ", but " + inheritedChannel.getClass().getName()); } return (T) inheritedChannel; }
@SuppressWarnings("unchecked") protected <T> T getSystemInheritedChannel(final Class<?> channelType) throws IOException { final Channel inheritedChannel = System.inheritedChannel(); if (inheritedChannel == null) { throw new IOException("Inherited channel is not set"); } if (!(channelType.isInstance(inheritedChannel))) { throw new IOException("Inherited channel is not " + channelType.getName() + ", but " + inheritedChannel.getClass().getName()); } return (T) inheritedChannel; }
@SuppressWarnings("unchecked") protected <T> T getSystemInheritedChannel(final Class<?> channelType) throws IOException { final Channel inheritedChannel = System.inheritedChannel(); if (inheritedChannel == null) { throw new IOException("Inherited channel is not set"); } if (!(channelType.isInstance(inheritedChannel))) { throw new IOException("Inherited channel is not " + channelType.getName() + ", but " + inheritedChannel.getClass().getName()); } return (T) inheritedChannel; }
@SuppressWarnings("unchecked") protected <T> T getSystemInheritedChannel(final Class<?> channelType) throws IOException { final Channel inheritedChannel = System.inheritedChannel(); if (inheritedChannel == null) { throw new IOException("Inherited channel is not set"); } if (!(channelType.isInstance(inheritedChannel))) { throw new IOException("Inherited channel is not " + channelType.getName() + ", but " + inheritedChannel.getClass().getName()); } return (T) inheritedChannel; }
@SuppressWarnings("unchecked") protected <T> T getSystemInheritedChannel(final Class<?> channelType) throws IOException { final Channel inheritedChannel = System.inheritedChannel(); if (inheritedChannel == null) { throw new IOException("Inherited channel is not set"); } if (!(channelType.isInstance(inheritedChannel))) { throw new IOException("Inherited channel is not " + channelType.getName() + ", but " + inheritedChannel.getClass().getName()); } return (T) inheritedChannel; }
@SuppressWarnings("unchecked") protected <T> T getSystemInheritedChannel(final Class<?> channelType) throws IOException { final Channel inheritedChannel = System.inheritedChannel(); if (inheritedChannel == null) { throw new IOException("Inherited channel is not set"); } if (!(channelType.isInstance(inheritedChannel))) { throw new IOException("Inherited channel is not " + channelType.getName() + ", but " + inheritedChannel.getClass().getName()); } return (T) inheritedChannel; }
@SuppressWarnings("unchecked") protected <T> T getSystemInheritedChannel(final Class<?> channelType) throws IOException { final Channel inheritedChannel = System.inheritedChannel(); if (inheritedChannel == null) { throw new IOException("Inherited channel is not set"); } if (!(channelType.isInstance(inheritedChannel))) { throw new IOException("Inherited channel is not " + channelType.getName() + ", but " + inheritedChannel.getClass().getName()); } return (T) inheritedChannel; }
@SuppressWarnings("unchecked") protected <T> T getSystemInheritedChannel(final Class<?> channelType) throws IOException { final Channel inheritedChannel = System.inheritedChannel(); if (inheritedChannel == null) { throw new IOException("Inherited channel is not set"); } if (!(channelType.isInstance(inheritedChannel))) { throw new IOException("Inherited channel is not " + channelType.getName() + ", but " + inheritedChannel.getClass().getName()); } return (T) inheritedChannel; }
@SuppressWarnings("unchecked") protected <T> T getSystemInheritedChannel(final Class<?> channelType) throws IOException { final Channel inheritedChannel = System.inheritedChannel(); if (inheritedChannel == null) { throw new IOException("Inherited channel is not set"); } if (!(channelType.isInstance(inheritedChannel))) { throw new IOException("Inherited channel is not " + channelType.getName() + ", but " + inheritedChannel.getClass().getName()); } return (T) inheritedChannel; }
@SuppressWarnings("unchecked") protected <T> T getSystemInheritedChannel(final Class<?> channelType) throws IOException { final Channel inheritedChannel = System.inheritedChannel(); if (inheritedChannel == null) { throw new IOException("Inherited channel is not set"); } if (!(channelType.isInstance(inheritedChannel))) { throw new IOException("Inherited channel is not " + channelType.getName() + ", but " + inheritedChannel.getClass().getName()); } return (T) inheritedChannel; }
protected void initServerSocket() throws Exception { if (!getUseInheritedChannel()) { serverSock = ServerSocketChannel.open(); socketProperties.setProperties(serverSock.socket()); InetSocketAddress addr = (getAddress()!=null?new InetSocketAddress(getAddress(),getPort()):new InetSocketAddress(getPort())); serverSock.socket().bind(addr,getAcceptCount()); } else { // Retrieve the channel provided by the OS Channel ic = System.inheritedChannel(); if (ic instanceof ServerSocketChannel) { serverSock = (ServerSocketChannel) ic; } if (serverSock == null) { throw new IllegalArgumentException(sm.getString("endpoint.init.bind.inherited")); } } serverSock.configureBlocking(true); //mimic APR behavior }
@Override public void open() throws IOException { synchronized(this) { try { Channel channel = System.inheritedChannel(); if ( channel instanceof ServerSocketChannel ) _acceptChannel = (ServerSocketChannel)channel; else LOG.warn("Unable to use System.inheritedChannel() [" +channel+ "]. Trying a new ServerSocketChannel at " + getHost() + ":" + getPort()); if ( _acceptChannel != null ) _acceptChannel.configureBlocking(true); } catch(NoSuchMethodError e) { LOG.warn("Need at least Java 5 to use socket inherited from xinetd/inetd."); } if (_acceptChannel == null) super.open(); } }
@Override public void open() throws IOException { synchronized(this) { try { Channel channel = System.inheritedChannel(); if ( channel instanceof ServerSocketChannel ) _acceptChannel = (ServerSocketChannel)channel; else LOG.warn("Unable to use System.inheritedChannel() [" +channel+ "]. Trying a new ServerSocketChannel at " + getHost() + ":" + getPort()); if ( _acceptChannel != null ) _acceptChannel.configureBlocking(true); } catch(NoSuchMethodError e) { LOG.warn("Need at least Java 5 to use socket inherited from xinetd/inetd."); } if (_acceptChannel == null) super.open(); } }
@Override public void open() throws IOException { synchronized(this) { try { Channel channel = System.inheritedChannel(); if ( channel instanceof ServerSocketChannel ) _acceptChannel = (ServerSocketChannel)channel; else LOG.warn("Unable to use System.inheritedChannel() [" +channel+ "]. Trying a new ServerSocketChannel at " + getHost() + ":" + getPort()); if ( _acceptChannel != null ) _acceptChannel.configureBlocking(true); } catch(NoSuchMethodError e) { LOG.warn("Need at least Java 5 to use socket inherited from xinetd/inetd."); } if (_acceptChannel == null) super.open(); } }