Remove unnecessary empty lines
This commit is contained in:
parent
a52c5befe3
commit
7f1b38262c
2
pom.xml
2
pom.xml
@ -648,7 +648,7 @@
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
<version>2.8</version>
|
||||
<version>2.9.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>check-style</id>
|
||||
|
@ -190,7 +190,6 @@ public class ChannelBufferInputStream extends InputStream implements DataInput {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return lineBuf.toString();
|
||||
}
|
||||
|
||||
|
@ -447,7 +447,6 @@ public final class ChannelBuffers {
|
||||
return EMPTY_BUFFER;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new composite buffer which wraps the slices of the specified
|
||||
* NIO buffers without copying them. A modification on the content of the
|
||||
|
@ -614,7 +614,6 @@ public class CompositeChannelBuffer extends AbstractChannelBuffer {
|
||||
|
||||
//Return the component byte buffer
|
||||
return components[componentId(index)];
|
||||
|
||||
}
|
||||
|
||||
public ChannelBuffer slice(int index, int length) {
|
||||
|
@ -38,7 +38,6 @@ public class ChannelLocal<T> implements Iterable<Entry<Channel, T>> {
|
||||
private final ConcurrentMap<Channel, T> map =
|
||||
new ConcurrentIdentityWeakKeyHashMap<Channel, T>();
|
||||
|
||||
|
||||
private final ChannelFutureListener remover = new ChannelFutureListener() {
|
||||
public void operationComplete(ChannelFuture future) throws Exception {
|
||||
remove(future.getChannel());
|
||||
|
@ -437,7 +437,6 @@ public interface ChannelPipeline {
|
||||
*/
|
||||
ChannelHandlerContext getContext(Class<? extends ChannelHandler> handlerType);
|
||||
|
||||
|
||||
/**
|
||||
* Sends the specified {@link ChannelEvent} to the first
|
||||
* {@link ChannelUpstreamHandler} in this pipeline.
|
||||
|
@ -309,10 +309,8 @@ public final class Channels {
|
||||
fireWriteComplete(channel, amount);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sends a {@code "writeComplete"} event to the first
|
||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
||||
@ -347,7 +345,6 @@ public final class Channels {
|
||||
|
||||
public void run() {
|
||||
fireChannelInterestChanged(channel);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -426,7 +423,6 @@ public final class Channels {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sends a {@code "channelUnbound"} event to the first
|
||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
||||
@ -449,8 +445,6 @@ public final class Channels {
|
||||
ctx.getChannel(), ChannelState.BOUND, null));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Sends a {@code "channelClosed"} event to the first
|
||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
||||
@ -463,10 +457,8 @@ public final class Channels {
|
||||
fireChannelClosed(channel);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sends a {@code "channelClosed"} event to the first
|
||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
||||
|
@ -721,7 +721,6 @@ public class DefaultChannelPipeline implements ChannelPipeline {
|
||||
canHandleUpstream = handler instanceof ChannelUpstreamHandler;
|
||||
canHandleDownstream = handler instanceof ChannelDownstreamHandler;
|
||||
|
||||
|
||||
if (!canHandleUpstream && !canHandleDownstream) {
|
||||
throw new IllegalArgumentException(
|
||||
"handler must be either " +
|
||||
@ -796,7 +795,6 @@ public class DefaultChannelPipeline implements ChannelPipeline {
|
||||
if (logger.isWarnEnabled()) {
|
||||
logger.warn("Not attached yet; discarding: " + e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void exceptionCaught(ChannelPipeline pipeline,
|
||||
@ -804,7 +802,6 @@ public class DefaultChannelPipeline implements ChannelPipeline {
|
||||
throw cause;
|
||||
}
|
||||
|
||||
|
||||
public ChannelFuture execute(ChannelPipeline pipeline, Runnable task) {
|
||||
if (logger.isWarnEnabled()) {
|
||||
logger.warn("Not attached yet; rejecting: " + task);
|
||||
|
@ -113,7 +113,6 @@ public class SimpleChannelDownstreamHandler implements ChannelDownstreamHandler
|
||||
*/
|
||||
public void bindRequested(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
|
||||
ctx.sendDownstream(e);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -121,7 +120,6 @@ public class SimpleChannelDownstreamHandler implements ChannelDownstreamHandler
|
||||
*/
|
||||
public void connectRequested(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
|
||||
ctx.sendDownstream(e);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -136,7 +134,6 @@ public class SimpleChannelDownstreamHandler implements ChannelDownstreamHandler
|
||||
*/
|
||||
public void disconnectRequested(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
|
||||
ctx.sendDownstream(e);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -144,7 +141,6 @@ public class SimpleChannelDownstreamHandler implements ChannelDownstreamHandler
|
||||
*/
|
||||
public void unbindRequested(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
|
||||
ctx.sendDownstream(e);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -297,7 +297,6 @@ public class SimpleChannelHandler implements ChannelUpstreamHandler, ChannelDown
|
||||
*/
|
||||
public void bindRequested(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
|
||||
ctx.sendDownstream(e);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -305,7 +304,6 @@ public class SimpleChannelHandler implements ChannelUpstreamHandler, ChannelDown
|
||||
*/
|
||||
public void connectRequested(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
|
||||
ctx.sendDownstream(e);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -320,7 +318,6 @@ public class SimpleChannelHandler implements ChannelUpstreamHandler, ChannelDown
|
||||
*/
|
||||
public void disconnectRequested(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
|
||||
ctx.sendDownstream(e);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -328,7 +325,6 @@ public class SimpleChannelHandler implements ChannelUpstreamHandler, ChannelDown
|
||||
*/
|
||||
public void unbindRequested(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
|
||||
ctx.sendDownstream(e);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -470,7 +470,6 @@ public class StaticChannelPipeline implements ChannelPipeline {
|
||||
canHandleUpstream = handler instanceof ChannelUpstreamHandler;
|
||||
canHandleDownstream = handler instanceof ChannelDownstreamHandler;
|
||||
|
||||
|
||||
if (!canHandleUpstream && !canHandleDownstream) {
|
||||
throw new IllegalArgumentException(
|
||||
"handler must be either " +
|
||||
|
@ -34,7 +34,6 @@ public class DefaultLocalServerChannelFactory implements LocalServerChannelFacto
|
||||
return channel;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Release all the previous created channels.
|
||||
* This takes care of calling {@link LocalChannelRegistry#unregister(LocalAddress)} for each of them.
|
||||
|
@ -28,7 +28,6 @@ public class ChannelRunnableWrapper extends DefaultChannelFuture implements Runn
|
||||
this.task = task;
|
||||
}
|
||||
|
||||
|
||||
public void run() {
|
||||
synchronized (this) {
|
||||
if (!isCancelled()) {
|
||||
@ -52,7 +51,4 @@ public class ChannelRunnableWrapper extends DefaultChannelFuture implements Runn
|
||||
}
|
||||
return super.cancel();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -276,7 +276,6 @@ public final class HttpTunnelingSocketChannelConfig implements SocketChannelConf
|
||||
|
||||
public void setSendBufferSize(int sendBufferSize) {
|
||||
channel.realChannel.getConfig().setSendBufferSize(sendBufferSize);
|
||||
|
||||
}
|
||||
|
||||
public void setSoLinger(int soLinger) {
|
||||
|
@ -80,7 +80,6 @@ public abstract class AbstractNioBossPool<E extends Boss>
|
||||
return (E) bosses[Math.abs(bossIndex.getAndIncrement() % bosses.length)];
|
||||
}
|
||||
|
||||
|
||||
public void releaseExternalResources() {
|
||||
ExecutorUtil.terminate(bossExecutor);
|
||||
for (Boss boss: bosses) {
|
||||
|
@ -92,7 +92,6 @@ abstract class AbstractNioChannel<C extends SelectableChannel & WritableByteChan
|
||||
boolean inWriteNowLoop;
|
||||
boolean writeSuspended;
|
||||
|
||||
|
||||
private volatile InetSocketAddress localAddress;
|
||||
volatile InetSocketAddress remoteAddress;
|
||||
|
||||
@ -167,7 +166,6 @@ abstract class AbstractNioChannel<C extends SelectableChannel & WritableByteChan
|
||||
setInterestOpsNow(interestOps);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getInterestOps() {
|
||||
if (!isOpen()) {
|
||||
|
@ -35,8 +35,6 @@ public abstract class AbstractNioChannelSink extends AbstractChannelSink {
|
||||
return wrapper;
|
||||
}
|
||||
return super.execute(pipeline, task);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -48,5 +46,4 @@ public abstract class AbstractNioChannelSink extends AbstractChannelSink {
|
||||
}
|
||||
return fireLater;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -55,7 +55,6 @@ import static org.jboss.netty.channel.Channels.*;
|
||||
|
||||
abstract class AbstractNioWorker implements Worker, ExternalResourceReleasable {
|
||||
|
||||
|
||||
private static final AtomicInteger nextId = new AtomicInteger();
|
||||
|
||||
final int id = nextId.incrementAndGet();
|
||||
@ -70,7 +69,6 @@ abstract class AbstractNioWorker implements Worker, ExternalResourceReleasable {
|
||||
|
||||
static final int CLEANUP_INTERVAL = 256; // XXX Hard-coded value, but won't need customization.
|
||||
|
||||
|
||||
/**
|
||||
* Executor used to execute {@link Runnable}s such as channel registration
|
||||
* task.
|
||||
@ -118,7 +116,6 @@ abstract class AbstractNioWorker implements Worker, ExternalResourceReleasable {
|
||||
|
||||
private final Queue<Runnable> eventQueue = new ConcurrentLinkedQueue<Runnable>();
|
||||
|
||||
|
||||
private volatile int cancelledKeys; // should use AtomicInteger but we just need approximation
|
||||
|
||||
protected final SocketSendBufferPool sendBufferPool = new SocketSendBufferPool();
|
||||
@ -147,7 +144,6 @@ abstract class AbstractNioWorker implements Worker, ExternalResourceReleasable {
|
||||
if (wakenUp.compareAndSet(false, true)) {
|
||||
selector.wakeup();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -221,7 +217,6 @@ abstract class AbstractNioWorker implements Worker, ExternalResourceReleasable {
|
||||
assert selector != null && selector.isOpen();
|
||||
}
|
||||
|
||||
|
||||
public void run() {
|
||||
thread = Thread.currentThread();
|
||||
|
||||
@ -271,9 +266,7 @@ abstract class AbstractNioWorker implements Worker, ExternalResourceReleasable {
|
||||
// this may be the cause of the jdk epoll(..) bug, so increment the counter
|
||||
// which we use later to see if its really the jdk bug.
|
||||
selectReturnsImmediately ++;
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
selectReturnsImmediately = 0;
|
||||
}
|
||||
@ -419,10 +412,8 @@ abstract class AbstractNioWorker implements Worker, ExternalResourceReleasable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void processRegisterTaskQueue() throws IOException {
|
||||
for (;;) {
|
||||
final Runnable task = registerTaskQueue.poll();
|
||||
@ -498,8 +489,6 @@ abstract class AbstractNioWorker implements Worker, ExternalResourceReleasable {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void close(SelectionKey k) {
|
||||
AbstractNioChannel<?> ch = (AbstractNioChannel<?>) k.attachment();
|
||||
close(ch, succeededFuture(ch));
|
||||
@ -574,7 +563,6 @@ abstract class AbstractNioWorker implements Worker, ExternalResourceReleasable {
|
||||
} else {
|
||||
future = evt.getFuture();
|
||||
buf = channel.currentWriteBuffer;
|
||||
|
||||
}
|
||||
|
||||
long localWrittenBytes = 0;
|
||||
@ -712,7 +700,6 @@ abstract class AbstractNioWorker implements Worker, ExternalResourceReleasable {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void close(AbstractNioChannel<?> channel, ChannelFuture future) {
|
||||
boolean connected = channel.isConnected();
|
||||
boolean bound = channel.isBound();
|
||||
@ -804,8 +791,6 @@ abstract class AbstractNioWorker implements Worker, ExternalResourceReleasable {
|
||||
fireExceptionCaught = true;
|
||||
}
|
||||
evt.getFuture().setFailure(cause);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -920,7 +905,6 @@ abstract class AbstractNioWorker implements Worker, ExternalResourceReleasable {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void releaseExternalResources() {
|
||||
sendBufferPool.releaseExternalResources();
|
||||
}
|
||||
|
@ -103,7 +103,6 @@ public abstract class AbstractNioWorkerPool<E extends AbstractNioWorker>
|
||||
return (E) workers[Math.abs(workerIndex.getAndIncrement() % workers.length)];
|
||||
}
|
||||
|
||||
|
||||
public void releaseExternalResources() {
|
||||
ExecutorUtil.terminate(workerExecutor);
|
||||
for (AbstractNioWorker worker: workers) {
|
||||
|
@ -63,7 +63,6 @@ class DefaultNioDatagramChannelConfig extends DefaultDatagramChannelConfig
|
||||
+ "writeBufferHighWaterMark; setting to the half of the "
|
||||
+ "writeBufferHighWaterMark.");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -193,7 +192,6 @@ class DefaultNioDatagramChannelConfig extends DefaultDatagramChannelConfig
|
||||
throw new ChannelException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -244,6 +242,4 @@ class DefaultNioDatagramChannelConfig extends DefaultDatagramChannelConfig
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -62,7 +62,6 @@ class DefaultNioSocketChannelConfig extends DefaultSocketChannelConfig
|
||||
"writeBufferHighWaterMark; setting to the half of the " +
|
||||
"writeBufferHighWaterMark.");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,6 @@ public final class NioClientBoss implements Boss {
|
||||
if (wakenUp.compareAndSet(false, true)) {
|
||||
selector.wakeup();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void run() {
|
||||
@ -187,9 +186,7 @@ public final class NioClientBoss implements Boss {
|
||||
// this may be the cause of the jdk epoll(..) bug, so increment the counter
|
||||
// which we use later to see if its really the jdk bug.
|
||||
selectReturnsImmediately ++;
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
selectReturnsImmediately = 0;
|
||||
}
|
||||
@ -269,7 +266,6 @@ public final class NioClientBoss implements Boss {
|
||||
logger.warn(
|
||||
"Failed to close a selector.", e);
|
||||
}
|
||||
|
||||
} finally {
|
||||
this.selector = null;
|
||||
}
|
||||
@ -291,7 +287,6 @@ public final class NioClientBoss implements Boss {
|
||||
"Unexpected exception in the selector loop.", t);
|
||||
}
|
||||
|
||||
|
||||
// Prevent possible consecutive immediate failures.
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
|
@ -44,7 +44,6 @@ public class NioClientBossPool extends AbstractNioBossPool<NioClientBoss> {
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a new instance using a new {@link HashedWheelTimer} and no {@link ThreadNameDeterminer}
|
||||
*
|
||||
|
@ -58,7 +58,6 @@ final class NioClientSocketChannel extends NioSocketChannel {
|
||||
"Failed to close a partially initialized socket.",
|
||||
e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -207,7 +207,6 @@ public class NioClientSocketChannelFactory implements ClientSocketChannelFactory
|
||||
sink = new NioClientSocketPipelineSink(bossPool);
|
||||
}
|
||||
|
||||
|
||||
public SocketChannel newChannel(ChannelPipeline pipeline) {
|
||||
return new NioClientSocketChannel(this, pipeline, sink, workerPool.nextWorker());
|
||||
}
|
||||
|
@ -35,7 +35,6 @@ class NioClientSocketPipelineSink extends AbstractNioChannelSink {
|
||||
static final InternalLogger logger =
|
||||
InternalLoggerFactory.getInstance(NioClientSocketPipelineSink.class);
|
||||
|
||||
|
||||
private final BossPool<NioClientBoss> bossPool;
|
||||
|
||||
NioClientSocketPipelineSink(BossPool<NioClientBoss> bossPool) {
|
||||
|
@ -59,7 +59,6 @@ public final class NioDatagramChannel extends AbstractNioChannel<DatagramChannel
|
||||
config = new DefaultNioDatagramChannelConfig(channel);
|
||||
|
||||
fireChannelOpen(this);
|
||||
|
||||
}
|
||||
|
||||
private static DatagramChannel openNonBlockingChannel(InternetProtocolFamily family) {
|
||||
@ -96,8 +95,6 @@ public final class NioDatagramChannel extends AbstractNioChannel<DatagramChannel
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public NioDatagramWorker getWorker() {
|
||||
return (NioDatagramWorker) super.getWorker();
|
||||
@ -125,8 +122,6 @@ public final class NioDatagramChannel extends AbstractNioChannel<DatagramChannel
|
||||
return channel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ChannelFuture joinGroup(InetAddress multicastAddress) {
|
||||
try {
|
||||
return joinGroup(
|
||||
@ -136,7 +131,6 @@ public final class NioDatagramChannel extends AbstractNioChannel<DatagramChannel
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ChannelFuture joinGroup(InetSocketAddress multicastAddress, NetworkInterface networkInterface) {
|
||||
return joinGroup(multicastAddress.getAddress(), networkInterface, null);
|
||||
}
|
||||
@ -169,7 +163,6 @@ public final class NioDatagramChannel extends AbstractNioChannel<DatagramChannel
|
||||
synchronized (this) {
|
||||
if (memberships == null) {
|
||||
memberships = new HashMap<InetAddress, List<MembershipKey>>();
|
||||
|
||||
}
|
||||
List<MembershipKey> keys = memberships.get(multicastAddress);
|
||||
if (keys == null) {
|
||||
@ -191,7 +184,6 @@ public final class NioDatagramChannel extends AbstractNioChannel<DatagramChannel
|
||||
} catch (SocketException e) {
|
||||
return failedFuture(this, e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ChannelFuture leaveGroup(InetSocketAddress multicastAddress,
|
||||
@ -224,12 +216,11 @@ public final class NioDatagramChannel extends AbstractNioChannel<DatagramChannel
|
||||
while (keyIt.hasNext()) {
|
||||
MembershipKey key = keyIt.next();
|
||||
if (networkInterface.equals(key.networkInterface())) {
|
||||
if (source == null && key.sourceAddress() == null ||
|
||||
source != null && source.equals(key.sourceAddress())) {
|
||||
key.drop();
|
||||
keyIt.remove();
|
||||
}
|
||||
|
||||
if (source == null && key.sourceAddress() == null ||
|
||||
source != null && source.equals(key.sourceAddress())) {
|
||||
key.drop();
|
||||
keyIt.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (keys.isEmpty()) {
|
||||
@ -276,15 +267,13 @@ public final class NioDatagramChannel extends AbstractNioChannel<DatagramChannel
|
||||
}
|
||||
}
|
||||
return succeededFuture(this);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Block the given sourceToBlock address for the given multicastAddress
|
||||
*
|
||||
*/
|
||||
* Block the given sourceToBlock address for the given multicastAddress
|
||||
*
|
||||
*/
|
||||
public ChannelFuture block(InetAddress multicastAddress, InetAddress sourceToBlock) {
|
||||
try {
|
||||
block(multicastAddress, NetworkInterface.getByInetAddress(getLocalAddress().getAddress()), sourceToBlock);
|
||||
@ -292,8 +281,8 @@ public final class NioDatagramChannel extends AbstractNioChannel<DatagramChannel
|
||||
return failedFuture(this, e);
|
||||
}
|
||||
return succeededFuture(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
InetSocketAddress getLocalSocketAddress() throws Exception {
|
||||
return (InetSocketAddress) channel.socket().getLocalSocketAddress();
|
||||
@ -311,6 +300,5 @@ public final class NioDatagramChannel extends AbstractNioChannel<DatagramChannel
|
||||
} else {
|
||||
return super.write(message, remoteAddress);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -108,7 +108,6 @@ public class NioDatagramWorker extends AbstractNioWorker {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void releaseExternalResources() {
|
||||
super.releaseExternalResources();
|
||||
@ -137,7 +136,6 @@ public class NioDatagramWorker extends AbstractNioWorker {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static void disconnect(NioDatagramChannel channel, ChannelFuture future) {
|
||||
boolean connected = channel.isConnected();
|
||||
boolean iothread = isIoThread(channel);
|
||||
@ -161,7 +159,6 @@ public class NioDatagramWorker extends AbstractNioWorker {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected Runnable createRegisterTask(AbstractNioChannel<?> channel, ChannelFuture future) {
|
||||
return new ChannelRegistionTask((NioDatagramChannel) channel, future);
|
||||
|
@ -101,7 +101,6 @@ final class NioProviderMetadata {
|
||||
"Using the autodetected NIO constraint level: " +
|
||||
constraintLevel);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,6 @@ public final class NioServerBoss implements Boss {
|
||||
|
||||
private Thread currentThread;
|
||||
|
||||
|
||||
private volatile int cancelledKeys; // should use AtomicInteger but we just need approximation
|
||||
static final int CLEANUP_INTERVAL = 256; // XXX Hard-coded value, but won't need customization.
|
||||
|
||||
@ -121,7 +120,6 @@ public final class NioServerBoss implements Boss {
|
||||
close(channel, future);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
assert offered;
|
||||
@ -307,7 +305,6 @@ public final class NioServerBoss implements Boss {
|
||||
break;
|
||||
}
|
||||
registerAcceptedChannel(channel, acceptedSocket, currentThread);
|
||||
|
||||
}
|
||||
} catch (CancelledKeyException e) {
|
||||
// Raised by accept() when the server socket was closed.
|
||||
@ -358,7 +355,6 @@ public final class NioServerBoss implements Boss {
|
||||
"Failed to close a partially accepted socket.",
|
||||
e2);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,6 @@ import java.util.concurrent.Executor;
|
||||
public class NioServerBossPool extends AbstractNioBossPool<NioServerBoss> {
|
||||
private final ThreadNameDeterminer determiner;
|
||||
|
||||
|
||||
/**
|
||||
* Create a new instance
|
||||
*
|
||||
@ -50,7 +49,6 @@ public class NioServerBossPool extends AbstractNioBossPool<NioServerBoss> {
|
||||
this(bossExecutor, bossCount, null);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected NioServerBoss newBoss(Executor executor) {
|
||||
return new NioServerBoss(executor, determiner);
|
||||
|
@ -68,7 +68,6 @@ class NioServerSocketChannel extends AbstractServerChannel
|
||||
logger.warn(
|
||||
"Failed to close a partially initialized socket.", e2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
throw new ChannelException("Failed to enter non-blocking mode.", e);
|
||||
|
@ -175,7 +175,6 @@ public class NioServerSocketChannelFactory implements ServerSocketChannelFactory
|
||||
public NioServerSocketChannelFactory(
|
||||
Executor bossExecutor, int bossCount, WorkerPool<NioWorker> workerPool) {
|
||||
this(new NioServerBossPool(bossExecutor, bossCount, null), workerPool);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -27,7 +27,6 @@ import java.net.SocketAddress;
|
||||
|
||||
class NioServerSocketPipelineSink extends AbstractNioChannelSink {
|
||||
|
||||
|
||||
public void eventSunk(
|
||||
ChannelPipeline pipeline, ChannelEvent e) throws Exception {
|
||||
Channel channel = e.getChannel();
|
||||
|
@ -37,7 +37,6 @@ public class NioSocketChannel extends AbstractNioChannel<SocketChannel>
|
||||
|
||||
private final NioSocketChannelConfig config;
|
||||
|
||||
|
||||
public NioSocketChannel(
|
||||
Channel parent, ChannelFactory factory,
|
||||
ChannelPipeline pipeline, ChannelSink sink,
|
||||
@ -89,7 +88,6 @@ public class NioSocketChannel extends AbstractNioChannel<SocketChannel>
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
InetSocketAddress getLocalSocketAddress() throws Exception {
|
||||
return (InetSocketAddress) channel.socket().getLocalSocketAddress();
|
||||
@ -100,7 +98,6 @@ public class NioSocketChannel extends AbstractNioChannel<SocketChannel>
|
||||
return (InetSocketAddress) channel.socket().getRemoteSocketAddress();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ChannelFuture write(Object message, SocketAddress remoteAddress) {
|
||||
if (remoteAddress == null || remoteAddress.equals(getRemoteAddress())) {
|
||||
|
@ -81,7 +81,6 @@ public class NioWorker extends AbstractNioWorker {
|
||||
buffer.setBytes(0, bb);
|
||||
buffer.writerIndex(readBytes);
|
||||
|
||||
|
||||
// Update the predictor.
|
||||
predictor.previousReceiveBufferSize(readBytes);
|
||||
|
||||
@ -98,7 +97,6 @@ public class NioWorker extends AbstractNioWorker {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean scheduleWriteIfNecessary(final AbstractNioChannel<?> channel) {
|
||||
final Thread currentThread = Thread.currentThread();
|
||||
@ -200,8 +198,6 @@ public class NioWorker extends AbstractNioWorker {
|
||||
"Failed to register a socket to the selector.", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -33,7 +33,6 @@ public class NioWorkerPool extends AbstractNioWorkerPool<NioWorker> {
|
||||
this(workerExecutor, workerCount, null);
|
||||
}
|
||||
|
||||
|
||||
public NioWorkerPool(Executor workerExecutor, int workerCount, ThreadNameDeterminer determiner) {
|
||||
super(workerExecutor, workerCount, false);
|
||||
this.determiner = determiner;
|
||||
@ -44,5 +43,4 @@ public class NioWorkerPool extends AbstractNioWorkerPool<NioWorker> {
|
||||
protected NioWorker createWorker(Executor executor) {
|
||||
return new NioWorker(executor, determiner);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ final class SocketReceiveBufferAllocator implements ExternalResourceReleasable {
|
||||
this.percentual = percentual;
|
||||
}
|
||||
|
||||
|
||||
ByteBuffer get(int size) {
|
||||
if (buf == null) {
|
||||
return newBuffer(size);
|
||||
|
@ -66,7 +66,6 @@ final class SocketSendBufferPool implements ExternalResourceReleasable {
|
||||
return EMPTY_BUFFER;
|
||||
}
|
||||
|
||||
|
||||
if (src instanceof CompositeChannelBuffer && ((CompositeChannelBuffer) src).useGathering()) {
|
||||
return new GatheringSendBuffer(src.toByteBuffers());
|
||||
}
|
||||
@ -305,7 +304,6 @@ final class SocketSendBufferPool implements ExternalResourceReleasable {
|
||||
public void release() {
|
||||
// nothing todo
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
final class FileSendBuffer implements SendBuffer {
|
||||
@ -313,7 +311,6 @@ final class SocketSendBufferPool implements ExternalResourceReleasable {
|
||||
private final FileRegion file;
|
||||
private long writtenBytes;
|
||||
|
||||
|
||||
FileSendBuffer(FileRegion file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
@ -30,6 +30,4 @@ public interface WorkerPool<E extends Worker> {
|
||||
* @return worker
|
||||
*/
|
||||
E nextWorker();
|
||||
|
||||
|
||||
}
|
||||
|
@ -62,18 +62,14 @@ abstract class AbstractOioChannel extends AbstractChannel {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean isBound() {
|
||||
return isOpen() && isSocketBound();
|
||||
}
|
||||
|
||||
|
||||
public boolean isConnected() {
|
||||
return isOpen() && isSocketConnected();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public InetSocketAddress getLocalAddress() {
|
||||
InetSocketAddress localAddress = this.localAddress;
|
||||
if (localAddress == null) {
|
||||
@ -87,7 +83,6 @@ abstract class AbstractOioChannel extends AbstractChannel {
|
||||
return localAddress;
|
||||
}
|
||||
|
||||
|
||||
public InetSocketAddress getRemoteAddress() {
|
||||
InetSocketAddress remoteAddress = this.remoteAddress;
|
||||
if (remoteAddress == null) {
|
||||
|
@ -40,8 +40,6 @@ public abstract class AbstractOioChannelSink extends AbstractChannelSink {
|
||||
}
|
||||
|
||||
return super.execute(pipeline, task);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -51,7 +51,6 @@ abstract class AbstractOioWorker<C extends AbstractOioChannel> implements Worker
|
||||
channel.worker = this;
|
||||
}
|
||||
|
||||
|
||||
public void run() {
|
||||
thread = channel.workerThread = Thread.currentThread();
|
||||
|
||||
@ -105,14 +104,12 @@ abstract class AbstractOioWorker<C extends AbstractOioChannel> implements Worker
|
||||
|
||||
// just to make we don't have something left
|
||||
processEventQueue();
|
||||
|
||||
}
|
||||
|
||||
static boolean isIoThread(AbstractOioChannel channel) {
|
||||
return Thread.currentThread() == channel.workerThread;
|
||||
}
|
||||
|
||||
|
||||
public void executeInIoThread(Runnable task) {
|
||||
// check if the current thread is the worker thread
|
||||
//
|
||||
@ -139,7 +136,6 @@ abstract class AbstractOioWorker<C extends AbstractOioChannel> implements Worker
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Process the incoming messages and also is responsible for call
|
||||
* {@link Channels#fireMessageReceived(Channel, Object)} once a message was processed without
|
||||
|
@ -62,7 +62,6 @@ final class OioDatagramChannel extends AbstractOioChannel
|
||||
config = new DefaultDatagramChannelConfig(socket);
|
||||
|
||||
fireChannelOpen(this);
|
||||
|
||||
}
|
||||
|
||||
public DatagramChannelConfig getConfig() {
|
||||
@ -146,6 +145,4 @@ final class OioDatagramChannel extends AbstractOioChannel
|
||||
boolean isSocketClosed() {
|
||||
return socket.isClosed();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -33,8 +33,6 @@ class OioDatagramWorker extends AbstractOioWorker<OioDatagramChannel> {
|
||||
super(channel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
boolean process() throws IOException {
|
||||
|
||||
@ -58,8 +56,6 @@ class OioDatagramWorker extends AbstractOioWorker<OioDatagramChannel> {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void write(
|
||||
OioDatagramChannel channel, ChannelFuture future,
|
||||
Object message, SocketAddress remoteAddress) {
|
||||
@ -102,7 +98,6 @@ class OioDatagramWorker extends AbstractOioWorker<OioDatagramChannel> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void disconnect(OioDatagramChannel channel, ChannelFuture future) {
|
||||
boolean connected = channel.isConnected();
|
||||
boolean iothread = isIoThread(channel);
|
||||
|
@ -68,7 +68,6 @@ class OioServerSocketChannel extends AbstractServerChannel
|
||||
logger.warn(
|
||||
"Failed to close a partially initialized socket.", e2);
|
||||
}
|
||||
|
||||
}
|
||||
throw new ChannelException(
|
||||
"Failed to set the server socket timeout.", e);
|
||||
|
@ -221,7 +221,6 @@ class OioServerSocketPipelineSink extends AbstractOioChannelSink {
|
||||
"Failed to close a partially accepted socket.",
|
||||
e2);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} catch (SocketTimeoutException e) {
|
||||
|
@ -44,10 +44,9 @@ class OioWorker extends AbstractOioWorker<OioSocketChannel> {
|
||||
public void run() {
|
||||
boolean fireConnected = channel instanceof OioAcceptedSocketChannel;
|
||||
if (fireConnected && channel.isOpen()) {
|
||||
// Fire the channelConnected event for OioAcceptedSocketChannel.
|
||||
// Fire the channelConnected event for OioAcceptedSocketChannel.
|
||||
// See #287
|
||||
fireChannelConnected(channel, channel.getRemoteAddress());
|
||||
|
||||
}
|
||||
super.run();
|
||||
}
|
||||
@ -117,7 +116,6 @@ class OioWorker extends AbstractOioWorker<OioSocketChannel> {
|
||||
fr.releaseExternalResources();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
ChannelBuffer a = (ChannelBuffer) message;
|
||||
@ -150,6 +148,4 @@ class OioWorker extends AbstractOioWorker<OioSocketChannel> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -86,7 +86,6 @@ public class AutobahnServerHandler extends SimpleChannelUpstreamHandler {
|
||||
.format("Channel %s received %s", ctx.getChannel().getId(), frame.getClass().getSimpleName()));
|
||||
}
|
||||
|
||||
|
||||
if (frame instanceof CloseWebSocketFrame) {
|
||||
handshaker.close(ctx.getChannel(), (CloseWebSocketFrame) frame);
|
||||
} else if (frame instanceof PingWebSocketFrame) {
|
||||
|
@ -32,16 +32,11 @@ public class PrematureChannelClosureException extends Exception {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
|
||||
public PrematureChannelClosureException(String msg, Throwable t) {
|
||||
super(msg, t);
|
||||
}
|
||||
|
||||
|
||||
public PrematureChannelClosureException(Throwable t) {
|
||||
super(t);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -117,7 +117,6 @@ public class ZlibDecoder extends OneToOneDecoder {
|
||||
z.next_out_index = 0;
|
||||
z.avail_out = out.length;
|
||||
|
||||
|
||||
loop: for (;;) {
|
||||
// Decompress 'in' into 'out'
|
||||
int resultCode = z.inflate(JZlib.Z_SYNC_FLUSH);
|
||||
|
@ -283,8 +283,6 @@ public class DelimiterBasedFrameDecoder extends FrameDecoder {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void fail(ChannelHandlerContext ctx, long frameLength) {
|
||||
if (frameLength > 0) {
|
||||
Channels.fireExceptionCaught(
|
||||
|
@ -83,7 +83,6 @@ public class FixedLengthFrameDecoder extends FrameDecoder {
|
||||
ChannelBufferFactory factory = ctx.getChannel().getConfig().getBufferFactory();
|
||||
if (allocateFullBuffer) {
|
||||
return factory.getBuffer(frameLength);
|
||||
|
||||
}
|
||||
return super.newCumulationBuffer(ctx, minimumCapacity);
|
||||
}
|
||||
|
@ -304,7 +304,6 @@ public abstract class FrameDecoder extends SimpleChannelUpstreamHandler implemen
|
||||
} finally {
|
||||
updateCumulation(ctx, input);
|
||||
}
|
||||
|
||||
} else {
|
||||
input = appendToCumulation(input);
|
||||
try {
|
||||
@ -529,7 +528,6 @@ public abstract class FrameDecoder extends SimpleChannelUpstreamHandler implemen
|
||||
} finally {
|
||||
pipeline.remove(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -542,8 +540,6 @@ public abstract class FrameDecoder extends SimpleChannelUpstreamHandler implemen
|
||||
return internalBuffer().readableBytes();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the internal cumulative buffer of this decoder. You usually
|
||||
* do not need to access the internal buffer directly to write a decoder.
|
||||
|
@ -395,7 +395,6 @@ public class LengthFieldBasedFrameDecoder extends FrameDecoder {
|
||||
return frame;
|
||||
}
|
||||
|
||||
|
||||
private void failIfNecessary(ChannelHandlerContext ctx, boolean firstDetectionOfTooLongFrame) {
|
||||
if (bytesToDiscard == 0) {
|
||||
// Reset to the initial state and tell the handlers that
|
||||
@ -413,7 +412,6 @@ public class LengthFieldBasedFrameDecoder extends FrameDecoder {
|
||||
fail(ctx, tooLongFrameLength);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void fail(ChannelHandlerContext ctx, long frameLength) {
|
||||
|
@ -97,7 +97,6 @@ public class LineBasedFrameDecoder extends FrameDecoder {
|
||||
frame = extractFrame(buffer, buffer.readerIndex(), length + delimLength);
|
||||
}
|
||||
buffer.skipBytes(length + delimLength);
|
||||
|
||||
}
|
||||
return frame;
|
||||
}
|
||||
@ -115,7 +114,6 @@ public class LineBasedFrameDecoder extends FrameDecoder {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private void fail(final ChannelHandlerContext ctx, final String msg) {
|
||||
Channels.fireExceptionCaught(ctx.getChannel(),
|
||||
new TooLongFrameException("Frame length exceeds " + maxLength + " ("
|
||||
|
@ -180,7 +180,6 @@ public class CookieDecoder {
|
||||
return cookies;
|
||||
}
|
||||
|
||||
|
||||
private static void extractKeyValuePairs(
|
||||
final String header, final List<String> names, final List<String> values) {
|
||||
|
||||
|
@ -165,7 +165,6 @@ public class CookieEncoder {
|
||||
sb.setCharAt(sb.length() - 1, (char) HttpConstants.DOUBLE_QUOTE);
|
||||
sb.append((char) HttpConstants.SEMICOLON);
|
||||
sb.append((char) HttpConstants.SP);
|
||||
|
||||
}
|
||||
if (cookie.isDiscard()) {
|
||||
sb.append(CookieHeaderNames.DISCARD);
|
||||
@ -264,7 +263,6 @@ public class CookieEncoder {
|
||||
sb.append((char) HttpConstants.DOUBLE_QUOTE);
|
||||
sb.append((char) HttpConstants.SEMICOLON);
|
||||
sb.append((char) HttpConstants.SP);
|
||||
|
||||
}
|
||||
|
||||
private static void add(StringBuilder sb, String name, int val) {
|
||||
|
@ -214,7 +214,6 @@ public class HttpChunkAggregator extends SimpleChannelUpstreamHandler implements
|
||||
} else {
|
||||
currentMessage.setContent(ChannelBuffers.wrappedBuffer(cumulation, input));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void beforeAdd(ChannelHandlerContext ctx) throws Exception {
|
||||
|
@ -475,7 +475,6 @@ public class HttpHeaders {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns {@code true} if and only if the connection can remain open and
|
||||
* thus 'kept alive'. This methods respects the value of the
|
||||
|
@ -401,7 +401,6 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDec
|
||||
default: {
|
||||
throw new Error("Shouldn't reach here.");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -431,7 +430,6 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDec
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private Object reset() {
|
||||
HttpMessage message = this.message;
|
||||
ChannelBuffer content = this.content;
|
||||
@ -619,7 +617,6 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDec
|
||||
throw new TooLongFrameException(
|
||||
"HTTP header is larger than " +
|
||||
maxHeaderSize + " bytes.");
|
||||
|
||||
}
|
||||
|
||||
sb.append(nextByte);
|
||||
|
@ -133,7 +133,6 @@ public abstract class HttpMessageEncoder extends OneToOneEncoder {
|
||||
} else {
|
||||
return chunk.getContent();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Unknown message type.
|
||||
|
@ -178,7 +178,6 @@ public class QueryStringDecoder {
|
||||
this.uri = newUri.replace(';', '&');
|
||||
this.charset = charset;
|
||||
this.maxParams = maxParams;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -120,7 +120,6 @@ final class HttpPostBodyUtil {
|
||||
private HttpPostBodyUtil() {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Exception when NO Backend Array is found
|
||||
*/
|
||||
|
@ -519,7 +519,6 @@ public class HttpPostRequestEncoder implements ChunkedInput {
|
||||
HttpPostBodyUtil.FILE + "; " + HttpPostBodyUtil.FILENAME + "=\"" +
|
||||
encodeAttribute(fileUpload.getFilename(), charset) +
|
||||
"\"\r\n");
|
||||
|
||||
} else {
|
||||
internal.addValue("--" + multipartDataBoundary + "\r\n");
|
||||
// Content-Disposition: form-data; name="files"; filename="file1.txt"
|
||||
@ -941,7 +940,6 @@ public class HttpPostRequestEncoder implements ChunkedInput {
|
||||
return isLastChunkSent;
|
||||
}
|
||||
|
||||
|
||||
public boolean hasNextChunk() throws Exception {
|
||||
return !isLastChunkSent;
|
||||
}
|
||||
|
@ -89,7 +89,6 @@ public class WebSocketClientHandshaker00 extends WebSocketClientHandshaker {
|
||||
super(webSocketURL, version, subprotocol, customHeaders, maxFramePayloadLength);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Sends the opening request to the server:
|
||||
@ -266,8 +265,6 @@ public class WebSocketClientHandshaker00 extends WebSocketClientHandshaker {
|
||||
|
||||
channel.getPipeline().get(HttpResponseDecoder.class).replace("ws-decoder",
|
||||
new WebSocket00FrameDecoder(getMaxFramePayloadLength()));
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static String insertRandomCharacters(String key) {
|
||||
|
@ -99,7 +99,6 @@ public class WebSocketClientHandshaker08 extends WebSocketClientHandshaker {
|
||||
this.allowExtensions = allowExtensions;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* /**
|
||||
* <p>
|
||||
@ -249,12 +248,9 @@ public class WebSocketClientHandshaker08 extends WebSocketClientHandshaker {
|
||||
String subprotocol = response.getHeader(Names.SEC_WEBSOCKET_PROTOCOL);
|
||||
setActualSubprotocol(subprotocol);
|
||||
|
||||
|
||||
setHandshakeComplete();
|
||||
|
||||
channel.getPipeline().get(HttpResponseDecoder.class).replace("ws-decoder",
|
||||
new WebSocket08FrameDecoder(false, allowExtensions, getMaxFramePayloadLength()));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -249,7 +249,5 @@ public class WebSocketClientHandshaker13 extends WebSocketClientHandshaker {
|
||||
|
||||
channel.getPipeline().get(HttpResponseDecoder.class).replace("ws-decoder",
|
||||
new WebSocket13FrameDecoder(false, allowExtensions, getMaxFramePayloadLength()));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +82,5 @@ public class WebSocketClientHandshakerFactory {
|
||||
}
|
||||
|
||||
throw new WebSocketHandshakeException("Protocol version " + version.toString() + " not supported.");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -184,7 +184,6 @@ public class WebSocketServerHandshaker00 extends WebSocketServerHandshaker {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ChannelFuture future = channel.write(res);
|
||||
|
||||
// Upgrade the connection and send the handshake response.
|
||||
|
@ -116,11 +116,9 @@ public class WebSocketServerProtocolHandler extends SimpleChannelUpstreamHandler
|
||||
public void beforeAdd(ChannelHandlerContext ctx) throws Exception {
|
||||
}
|
||||
|
||||
|
||||
public void beforeRemove(ChannelHandlerContext ctx) throws Exception {
|
||||
}
|
||||
|
||||
public void afterRemove(ChannelHandlerContext ctx) throws Exception {
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -96,7 +96,6 @@ final class WebSocketUtil {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #base64(ChannelBuffer)}
|
||||
*/
|
||||
@ -147,7 +146,6 @@ final class WebSocketUtil {
|
||||
return (int) (Math.random() * max + min);
|
||||
}
|
||||
|
||||
|
||||
private WebSocketUtil() {
|
||||
// Unused
|
||||
}
|
||||
|
@ -31,7 +31,6 @@ class ChannelBufferByteOutput implements ByteOutput {
|
||||
|
||||
private final ChannelBuffer buffer;
|
||||
|
||||
|
||||
/**
|
||||
* Create a new instance which use the given {@link ChannelBuffer}
|
||||
*/
|
||||
|
@ -113,7 +113,6 @@ public class CompatibleMarshallingDecoder extends ReplayingDecoder<VoidEnum> {
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {
|
||||
if (e.getCause() instanceof TooLongFrameException) {
|
||||
e.getChannel().close();
|
||||
|
||||
} else {
|
||||
super.exceptionCaught(ctx, e);
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ public class CompatibleMarshallingEncoder extends OneToOneEncoder {
|
||||
|
||||
private final MarshallerProvider provider;
|
||||
|
||||
|
||||
/**
|
||||
* Create a new instance of the {@link CompatibleMarshallingEncoder}
|
||||
*
|
||||
@ -46,7 +45,6 @@ public class CompatibleMarshallingEncoder extends OneToOneEncoder {
|
||||
this.provider = provider;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected Object encode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception {
|
||||
Marshaller marshaller = provider.getMarshaller(ctx);
|
||||
|
@ -98,11 +98,6 @@ class LimitingByteInput implements ByteInput {
|
||||
*
|
||||
*/
|
||||
static final class TooBigObjectException extends IOException {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,6 @@ public class MarshallingDecoder extends LengthFieldBasedFrameDecoder {
|
||||
this.provider = provider;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected Object decode(
|
||||
ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception {
|
||||
|
@ -83,7 +83,6 @@ public class MarshallingEncoder extends OneToOneEncoder {
|
||||
marshaller.finish();
|
||||
marshaller.close();
|
||||
|
||||
|
||||
ChannelBuffer encoded = output.getBuffer();
|
||||
encoded.setInt(0, encoded.writerIndex() - 4);
|
||||
|
||||
|
@ -283,13 +283,11 @@ import java.net.SocketAddress;
|
||||
public abstract class ReplayingDecoder<T extends Enum<T>>
|
||||
extends FrameDecoder {
|
||||
|
||||
|
||||
private final ReplayingDecoderBuffer replayable = new ReplayingDecoderBuffer(this);
|
||||
private T state;
|
||||
private int checkpoint;
|
||||
private boolean needsCleanup;
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new instance with no initial state (i.e: {@code null}).
|
||||
*/
|
||||
|
@ -37,7 +37,6 @@ class UnsafeDynamicChannelBuffer extends DynamicChannelBuffer {
|
||||
this(factory, 256);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void checkReadableBytes(int minReaderRemaining) {
|
||||
// Do not check here - ReplayingDecoderBuffer will check.
|
||||
|
@ -260,7 +260,6 @@ public final class RtspResponseStatuses {
|
||||
public static final HttpResponseStatus OPTION_NOT_SUPPORTED = new HttpResponseStatus(
|
||||
551, "Option not supported");
|
||||
|
||||
|
||||
/**
|
||||
* Returns the {@link HttpResponseStatus} represented by the specified code.
|
||||
* If the specified code is a standard RTSP status code, a cached instance
|
||||
|
@ -53,7 +53,6 @@ public class ObjectDecoder extends LengthFieldBasedFrameDecoder {
|
||||
this(1048576);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new decoder whose maximum object size is {@code 1048576}
|
||||
* bytes. If the size of the received object is greater than
|
||||
@ -98,7 +97,6 @@ public class ObjectDecoder extends LengthFieldBasedFrameDecoder {
|
||||
this.classResolver = classResolver;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a new decoder with the specified maximum object size and the {@link ClassLoader}
|
||||
* wrapped in {@link ClassResolvers#weakCachingResolver(ClassLoader)}.
|
||||
|
@ -264,11 +264,9 @@ final class SpdyCodecUtil {
|
||||
SPDY2_DICT = SPDY2_DICT_;
|
||||
}
|
||||
|
||||
|
||||
private SpdyCodecUtil() {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reads a big-endian unsigned short integer from the buffer.
|
||||
*/
|
||||
|
@ -117,7 +117,6 @@ public class SpdyFrameEncoder implements ChannelDownstreamHandler {
|
||||
ChannelBuffer frame = ChannelBuffers.wrappedBuffer(header, data);
|
||||
Channels.write(ctx, e.getFuture(), frame, e.getRemoteAddress());
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (msg instanceof SpdySynStreamFrame) {
|
||||
@ -163,7 +162,6 @@ public class SpdyFrameEncoder implements ChannelDownstreamHandler {
|
||||
Channels.write(ctx, e.getFuture(), buffer, e.getRemoteAddress());
|
||||
}
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (msg instanceof SpdySynReplyFrame) {
|
||||
@ -199,7 +197,6 @@ public class SpdyFrameEncoder implements ChannelDownstreamHandler {
|
||||
Channels.write(ctx, e.getFuture(), buffer, e.getRemoteAddress());
|
||||
}
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (msg instanceof SpdyRstStreamFrame) {
|
||||
@ -214,7 +211,6 @@ public class SpdyFrameEncoder implements ChannelDownstreamHandler {
|
||||
frame.writeInt(spdyRstStreamFrame.getStatus().getCode());
|
||||
Channels.write(ctx, e.getFuture(), frame, e.getRemoteAddress());
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (msg instanceof SpdySettingsFrame) {
|
||||
@ -257,7 +253,6 @@ public class SpdyFrameEncoder implements ChannelDownstreamHandler {
|
||||
}
|
||||
Channels.write(ctx, e.getFuture(), frame, e.getRemoteAddress());
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (msg instanceof SpdyNoOpFrame) {
|
||||
@ -269,7 +264,6 @@ public class SpdyFrameEncoder implements ChannelDownstreamHandler {
|
||||
frame.writeInt(0);
|
||||
Channels.write(ctx, e.getFuture(), frame, e.getRemoteAddress());
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (msg instanceof SpdyPingFrame) {
|
||||
@ -283,7 +277,6 @@ public class SpdyFrameEncoder implements ChannelDownstreamHandler {
|
||||
frame.writeInt(spdyPingFrame.getId());
|
||||
Channels.write(ctx, e.getFuture(), frame, e.getRemoteAddress());
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (msg instanceof SpdyGoAwayFrame) {
|
||||
@ -301,7 +294,6 @@ public class SpdyFrameEncoder implements ChannelDownstreamHandler {
|
||||
}
|
||||
Channels.write(ctx, e.getFuture(), frame, e.getRemoteAddress());
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (msg instanceof SpdyHeadersFrame) {
|
||||
@ -333,7 +325,6 @@ public class SpdyFrameEncoder implements ChannelDownstreamHandler {
|
||||
Channels.write(ctx, e.getFuture(), buffer, e.getRemoteAddress());
|
||||
}
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (msg instanceof SpdyWindowUpdateFrame) {
|
||||
|
@ -96,7 +96,6 @@ public class SpdyHeaders {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the header value with the specified header name. If there are
|
||||
* more than one header value for the specified header name, the first
|
||||
@ -479,7 +478,6 @@ public class SpdyHeaders {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static final int BUCKET_SIZE = 17;
|
||||
|
||||
private static int hash(String name) {
|
||||
|
@ -133,7 +133,6 @@ public class SpdyHttpDecoder extends OneToOneDecoder {
|
||||
new DefaultSpdyRstStreamFrame(streamID, SpdyStreamStatus.PROTOCOL_ERROR);
|
||||
Channels.write(ctx, Channels.future(channel), spdyRstStreamFrame);
|
||||
}
|
||||
|
||||
} else {
|
||||
// SYN_STREAM frames initiated by the client are HTTP requests
|
||||
try {
|
||||
|
@ -149,7 +149,6 @@ public class SpdyHttpEncoder implements ChannelDownstreamHandler {
|
||||
spdyVersion = version;
|
||||
}
|
||||
|
||||
|
||||
public void handleDownstream(ChannelHandlerContext ctx, ChannelEvent evt)
|
||||
throws Exception {
|
||||
if (!(evt instanceof MessageEvent)) {
|
||||
|
@ -512,7 +512,6 @@ public class SpdySessionHandler extends SimpleChannelUpstreamHandler
|
||||
|
||||
Channels.write(ctx, writeFuture, partialDataFrame, remoteAddress);
|
||||
return;
|
||||
|
||||
} else {
|
||||
// Stream is stalled -- enqueue Data frame and return
|
||||
spdySession.putPendingWrite(streamID, e);
|
||||
@ -801,7 +800,6 @@ public class SpdySessionHandler extends SimpleChannelUpstreamHandler
|
||||
}
|
||||
|
||||
Channels.write(ctx, e.getFuture(), spdyDataFrame, e.getRemoteAddress());
|
||||
|
||||
} else {
|
||||
// We can send a partial frame
|
||||
spdySession.updateSendWindowSize(streamID, -1 * newWindowSize);
|
||||
|
@ -82,7 +82,6 @@ public class ChainedExecutor implements Executor, ExternalResourceReleasable {
|
||||
releaseExternal(next);
|
||||
}
|
||||
|
||||
|
||||
private static void releaseExternal(Executor executor) {
|
||||
if (executor instanceof ExternalResourceReleasable) {
|
||||
((ExternalResourceReleasable) executor).releaseExternalResources();
|
||||
|
@ -27,7 +27,6 @@ import org.jboss.netty.channel.ChannelHandlerContext;
|
||||
*/
|
||||
public class ChannelUpstreamEventRunnable extends ChannelEventRunnable {
|
||||
|
||||
|
||||
/**
|
||||
* Creates a {@link Runnable} which sends the specified {@link ChannelEvent}
|
||||
* upstream via the specified {@link ChannelHandlerContext}.
|
||||
@ -36,7 +35,6 @@ public class ChannelUpstreamEventRunnable extends ChannelEventRunnable {
|
||||
super(ctx, e, executor);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sends the event upstream.
|
||||
*/
|
||||
|
@ -120,7 +120,6 @@ public class ExecutionHandler implements ChannelUpstreamHandler, ChannelDownstre
|
||||
this(executor, false, true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Use {@link #ExecutionHandler(Executor, boolean, boolean)}
|
||||
*
|
||||
|
@ -314,7 +314,6 @@ public class MemoryAwareThreadPoolExecutor extends ThreadPoolExecutor {
|
||||
channels = new HashSet<Channel>();
|
||||
}
|
||||
|
||||
|
||||
// store the Channel of the event for later notification of the exceptionCaught event
|
||||
channels.add(event.getChannel());
|
||||
}
|
||||
@ -386,7 +385,6 @@ public class MemoryAwareThreadPoolExecutor extends ThreadPoolExecutor {
|
||||
return totalLimiter.limit;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated <tt>maxTotalMemorySize</tt> is not modifiable anymore.
|
||||
*/
|
||||
@ -425,8 +423,6 @@ public class MemoryAwareThreadPoolExecutor extends ThreadPoolExecutor {
|
||||
return notifyOnShutdown;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void execute(Runnable command) {
|
||||
if (command instanceof ChannelDownstreamEventRunnable) {
|
||||
@ -627,7 +623,6 @@ public class MemoryAwareThreadPoolExecutor extends ThreadPoolExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static class Limiter {
|
||||
|
||||
final long limit;
|
||||
|
@ -73,7 +73,6 @@ public final class OrderedDownstreamThreadPoolExecutor extends OrderedMemoryAwar
|
||||
keepAliveTime, unit, threadFactory);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return {@code null}
|
||||
*/
|
||||
@ -153,7 +152,6 @@ public final class OrderedDownstreamThreadPoolExecutor extends OrderedMemoryAwar
|
||||
if (oldExecutor != null) {
|
||||
executor = oldExecutor;
|
||||
} else {
|
||||
|
||||
// register a listener so that the ChildExecutor will get removed once the channel was closed
|
||||
e.getChannel().getCloseFuture().addListener(new ChannelFutureListener() {
|
||||
|
||||
@ -166,6 +164,4 @@ public final class OrderedDownstreamThreadPoolExecutor extends OrderedMemoryAwar
|
||||
|
||||
return executor;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -287,7 +287,6 @@ public class OrderedMemoryAwareThreadPoolExecutor extends
|
||||
// TODO: What todo if the add return false ?
|
||||
tasks.add(command);
|
||||
|
||||
|
||||
if (!isRunning.get()) {
|
||||
doUnorderedExecute(this);
|
||||
}
|
||||
@ -330,7 +329,6 @@ public class OrderedMemoryAwareThreadPoolExecutor extends
|
||||
if (acquired && !isRunning.get() && tasks.peek() != null) {
|
||||
doUnorderedExecute(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,6 @@ public class CIDR6 extends CIDR {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int compareTo(CIDR arg) {
|
||||
if (arg instanceof CIDR4) {
|
||||
BigInteger net = ipv6AddressToBigInteger(arg.baseAddress);
|
||||
|
@ -95,7 +95,6 @@ public abstract class IpFilteringHandlerImpl implements ChannelUpstreamHandler,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e) throws Exception {
|
||||
if (e instanceof ChannelStateEvent) {
|
||||
ChannelStateEvent evt = (ChannelStateEvent) e;
|
||||
@ -150,15 +149,11 @@ public abstract class IpFilteringHandlerImpl implements ChannelUpstreamHandler,
|
||||
ctx.sendUpstream(e);
|
||||
}
|
||||
|
||||
|
||||
public void setIpFilterListener(IpFilterListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
|
||||
public void removeIpFilterListener() {
|
||||
listener = null;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -173,7 +173,6 @@ public class PatternRule implements IpFilterRule, Comparable<Object> {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public int compareTo(Object o) {
|
||||
|
@ -99,7 +99,6 @@ public class LoggingHandler implements ChannelUpstreamHandler, ChannelDownstream
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private final InternalLogger logger;
|
||||
private final InternalLogLevel level;
|
||||
private final boolean hexDump;
|
||||
|
@ -274,7 +274,6 @@ public class BufferedWriteHandler extends SimpleChannelHandler implements LifeCy
|
||||
}
|
||||
}
|
||||
consolidatedWrite(pendingWrites);
|
||||
|
||||
} else {
|
||||
for (;;) {
|
||||
MessageEvent e = queue.poll();
|
||||
@ -383,7 +382,6 @@ public class BufferedWriteHandler extends SimpleChannelHandler implements LifeCy
|
||||
cause = new ClosedChannelException();
|
||||
}
|
||||
ev.getFuture().setFailure(cause);
|
||||
|
||||
}
|
||||
if (cause != null) {
|
||||
Channels.fireExceptionCaught(ctx.getChannel(), cause);
|
||||
@ -394,12 +392,10 @@ public class BufferedWriteHandler extends SimpleChannelHandler implements LifeCy
|
||||
|
||||
public void beforeAdd(ChannelHandlerContext ctx) throws Exception {
|
||||
// Nothing to do
|
||||
|
||||
}
|
||||
|
||||
public void afterAdd(ChannelHandlerContext ctx) throws Exception {
|
||||
// Nothing to do
|
||||
|
||||
}
|
||||
|
||||
public void beforeRemove(ChannelHandlerContext ctx) throws Exception {
|
||||
@ -424,12 +420,10 @@ public class BufferedWriteHandler extends SimpleChannelHandler implements LifeCy
|
||||
cause = new IOException("Unable to flush message");
|
||||
}
|
||||
ev.getFuture().setFailure(cause);
|
||||
|
||||
}
|
||||
|
||||
if (cause != null) {
|
||||
Channels.fireExceptionCaughtLater(ctx.getChannel(), cause);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -109,7 +109,6 @@ public class SslBufferPool {
|
||||
return acquireBuffer();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Release a previous acquired {@link ByteBuffer}
|
||||
*/
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user