Merge remote branch 'upstream/master'

This commit is contained in:
Jestan Nirojan 2011-12-02 03:39:09 +05:30
commit 78c949f282
627 changed files with 6407 additions and 4280 deletions

1
.gitignore vendored
View File

@ -7,3 +7,4 @@
/*.iml /*.iml
/*.ipr /*.ipr
/*.iws /*.iws
/*.geany

56
pom.xml
View File

@ -73,7 +73,7 @@
<dependency> <dependency>
<groupId>com.google.protobuf</groupId> <groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId> <artifactId>protobuf-java</artifactId>
<version>2.3.0</version> <version>2.4.1</version>
<scope>compile</scope> <scope>compile</scope>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
@ -128,7 +128,7 @@
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId> <artifactId>slf4j-api</artifactId>
<version>1.6.1</version> <version>1.6.4</version>
<scope>compile</scope> <scope>compile</scope>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
@ -176,19 +176,19 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.8.2</version> <version>4.10</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.easymock</groupId> <groupId>org.easymock</groupId>
<artifactId>easymock</artifactId> <artifactId>easymock</artifactId>
<version>2.5.2</version> <version>3.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.easymock</groupId> <groupId>org.easymock</groupId>
<artifactId>easymockclassextension</artifactId> <artifactId>easymockclassextension</artifactId>
<version>2.5.2</version> <version>3.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -200,7 +200,7 @@
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId> <artifactId>slf4j-simple</artifactId>
<version>1.6.1</version> <version>1.6.4</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
@ -225,7 +225,7 @@
<plugin> <plugin>
<!-- See org.jboss:jboss-parent --> <!-- See org.jboss:jboss-parent -->
<artifactId>maven-enforcer-plugin</artifactId> <artifactId>maven-enforcer-plugin</artifactId>
<version>1.0</version> <version>1.0.1</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
@ -241,7 +241,7 @@
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version> <version>2.5</version>
<configuration> <configuration>
<encoding>UTF-8</encoding> <encoding>UTF-8</encoding>
</configuration> </configuration>
@ -272,7 +272,7 @@
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.7.2</version> <version>2.10</version>
<configuration> <configuration>
<forkMode>once</forkMode> <forkMode>once</forkMode>
<excludes> <excludes>
@ -329,7 +329,7 @@
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-antrun-plugin</artifactId> <artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version> <version>1.7</version>
<executions> <executions>
<execution> <execution>
<id>write-version</id> <id>write-version</id>
@ -434,7 +434,7 @@
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>2.7</version> <version>2.8</version>
<executions> <executions>
<execution> <execution>
<id>generate-javadoc</id> <id>generate-javadoc</id>
@ -529,6 +529,36 @@
</execution> </execution>
</executions> </executions>
<dependencies> <dependencies>
<dependency>
<groupId>org.eclipse.wst.css</groupId>
<artifactId>core</artifactId>
<version>1.1.101-v200705302225</version>
<exclusions>
<exclusion>
<groupId>org.apache</groupId>
<artifactId>xerces</artifactId>
</exclusion>
<exclusion>
<groupId>com.ibm</groupId>
<artifactId>icu</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.wst.sse</groupId>
<artifactId>core</artifactId>
<version>1.1.202-v200709061102</version>
<exclusions>
<exclusion>
<groupId>org.apache</groupId>
<artifactId>xerces</artifactId>
</exclusion>
<exclusion>
<groupId>com.ibm</groupId>
<artifactId>icu</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency> <dependency>
<groupId>org.jboss</groupId> <groupId>org.jboss</groupId>
<artifactId>jbossorg-docbook-xslt</artifactId> <artifactId>jbossorg-docbook-xslt</artifactId>
@ -615,7 +645,7 @@
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>2.2</version> <version>2.2.1</version>
<executions> <executions>
<execution> <execution>
<id>generate-distribution</id> <id>generate-distribution</id>
@ -636,7 +666,7 @@
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-release-plugin</artifactId> <artifactId>maven-release-plugin</artifactId>
<version>2.1</version> <version>2.2.1</version>
<configuration> <configuration>
<!-- We don't want to use the default release profile because it <!-- We don't want to use the default release profile because it
causes the JavaDoc and source jars to be deployed twice. --> causes the JavaDoc and source jars to be deployed twice. -->

View File

@ -43,8 +43,6 @@ import org.jboss.netty.util.ExternalResourceReleasable;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.uses org.jboss.netty.channel.ChannelFactory * @apiviz.uses org.jboss.netty.channel.ChannelFactory
*/ */
public class Bootstrap implements ExternalResourceReleasable { public class Bootstrap implements ExternalResourceReleasable {
@ -60,7 +58,6 @@ public class Bootstrap implements ExternalResourceReleasable {
* I/O operation is requested. * I/O operation is requested.
*/ */
protected Bootstrap() { protected Bootstrap() {
super();
} }
/** /**

View File

@ -106,8 +106,6 @@ import org.jboss.netty.channel.Channels;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.landmark * @apiviz.landmark
*/ */
public class ClientBootstrap extends Bootstrap { public class ClientBootstrap extends Bootstrap {
@ -118,7 +116,6 @@ public class ClientBootstrap extends Bootstrap {
* operation is requested. * operation is requested.
*/ */
public ClientBootstrap() { public ClientBootstrap() {
super();
} }
/** /**

View File

@ -115,8 +115,6 @@ import org.jboss.netty.channel.Channels;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.landmark * @apiviz.landmark
*/ */
public class ConnectionlessBootstrap extends Bootstrap { public class ConnectionlessBootstrap extends Bootstrap {
@ -127,7 +125,6 @@ public class ConnectionlessBootstrap extends Bootstrap {
* operation is requested. * operation is requested.
*/ */
public ConnectionlessBootstrap() { public ConnectionlessBootstrap() {
super();
} }
/** /**

View File

@ -156,8 +156,6 @@ import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.landmark * @apiviz.landmark
*/ */
public class ServerBootstrap extends Bootstrap { public class ServerBootstrap extends Bootstrap {
@ -170,7 +168,6 @@ public class ServerBootstrap extends Bootstrap {
* operation is requested. * operation is requested.
*/ */
public ServerBootstrap() { public ServerBootstrap() {
super();
} }
/** /**

View File

@ -29,8 +29,6 @@ import java.nio.charset.Charset;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public abstract class AbstractChannelBuffer implements ChannelBuffer { public abstract class AbstractChannelBuffer implements ChannelBuffer {
@ -138,6 +136,11 @@ public abstract class AbstractChannelBuffer implements ChannelBuffer {
} }
} }
@Override
public boolean getBoolean(int index) {
return (getByte(index) == 1);
}
@Override @Override
public short getUnsignedByte(int index) { public short getUnsignedByte(int index) {
return (short) (getByte(index) & 0xFF); return (short) (getByte(index) & 0xFF);
@ -196,6 +199,11 @@ public abstract class AbstractChannelBuffer implements ChannelBuffer {
dst.writerIndex(dst.writerIndex() + length); dst.writerIndex(dst.writerIndex() + length);
} }
@Override
public void setBoolean(int index, boolean value) {
setByte(index, value ? 1 : 0);
}
@Override @Override
public void setChar(int index, int value) { public void setChar(int index, int value) {
setShort(index, value); setShort(index, value);
@ -271,6 +279,11 @@ public abstract class AbstractChannelBuffer implements ChannelBuffer {
return getByte(readerIndex ++); return getByte(readerIndex ++);
} }
@Override
public boolean readBoolean() {
return (readByte() == 1);
}
@Override @Override
public short readUnsignedByte() { public short readUnsignedByte() {
return (short) (readByte() & 0xFF); return (short) (readByte() & 0xFF);
@ -427,6 +440,11 @@ public abstract class AbstractChannelBuffer implements ChannelBuffer {
readerIndex = newReaderIndex; readerIndex = newReaderIndex;
} }
@Override
public void writeBoolean(boolean value) {
writeByte(value ? 1 : 0);
}
@Override @Override
public void writeByte(int value) { public void writeByte(int value) {
setByte(writerIndex ++, value); setByte(writerIndex ++, value);

View File

@ -22,8 +22,6 @@ import java.nio.ByteOrder;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public abstract class AbstractChannelBufferFactory implements ChannelBufferFactory { public abstract class AbstractChannelBufferFactory implements ChannelBufferFactory {

View File

@ -25,8 +25,6 @@ import java.nio.ByteOrder;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public class BigEndianHeapChannelBuffer extends HeapChannelBuffer { public class BigEndianHeapChannelBuffer extends HeapChannelBuffer {

View File

@ -31,9 +31,6 @@ import java.nio.channels.ScatteringByteChannel;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*
*/ */
public class ByteBufferBackedChannelBuffer extends AbstractChannelBuffer { public class ByteBufferBackedChannelBuffer extends AbstractChannelBuffer {

View File

@ -232,8 +232,6 @@ import java.nio.charset.UnsupportedCharsetException;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.landmark * @apiviz.landmark
*/ */
public interface ChannelBuffer extends Comparable<ChannelBuffer> { public interface ChannelBuffer extends Comparable<ChannelBuffer> {
@ -449,6 +447,17 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
*/ */
void ensureWritableBytes(int writableBytes); void ensureWritableBytes(int writableBytes);
/**
* Gets a boolean at the specified absolute (@code index) in this buffer.
* This method does not modify the {@code readerIndex} or {@code writerIndex}
* of this buffer.
*
* @throws IndexOutOfBoundsException
* if the specified {@code index} is less than {@code 0} or
* {@code index + 1} is greater than {@code this.capacity}
*/
boolean getBoolean(int index);
/** /**
* Gets a byte at the specified absolute {@code index} in this buffer. * Gets a byte at the specified absolute {@code index} in this buffer.
* This method does not modify {@code readerIndex} or {@code writerIndex} of * This method does not modify {@code readerIndex} or {@code writerIndex} of
@ -668,7 +677,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
* if {@code dstIndex + length} is greater than * if {@code dstIndex + length} is greater than
* {@code dst.length} * {@code dst.length}
*/ */
void getBytes(int index, byte[] dst, int dstIndex, int length); void getBytes(int index, byte[] dst, int dstIndex, int length);
/** /**
* Transfers this buffer's data to the specified destination starting at * Transfers this buffer's data to the specified destination starting at
@ -682,7 +691,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
* if {@code index + dst.remaining()} is greater than * if {@code index + dst.remaining()} is greater than
* {@code this.capacity} * {@code this.capacity}
*/ */
void getBytes(int index, ByteBuffer dst); void getBytes(int index, ByteBuffer dst);
/** /**
* Transfers this buffer's data to the specified stream starting at the * Transfers this buffer's data to the specified stream starting at the
@ -699,7 +708,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
* @throws IOException * @throws IOException
* if the specified stream threw an exception during I/O * if the specified stream threw an exception during I/O
*/ */
void getBytes(int index, OutputStream out, int length) throws IOException; void getBytes(int index, OutputStream out, int length) throws IOException;
/** /**
* Transfers this buffer's data to the specified channel starting at the * Transfers this buffer's data to the specified channel starting at the
@ -718,7 +727,19 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
* @throws IOException * @throws IOException
* if the specified channel threw an exception during I/O * if the specified channel threw an exception during I/O
*/ */
int getBytes(int index, GatheringByteChannel out, int length) throws IOException; int getBytes(int index, GatheringByteChannel out, int length) throws IOException;
/**
* Sets the specified boolean at the specified absolute {@code index} in this
* buffer.
* This method does not modify {@code readerIndex} or {@code writerIndex} of
* this buffer.
*
* @throws IndexOutOfBoundsException
* if the specified {@code index} is less than {@code 0} or
* {@code index + 1} is greater than {@code this.capacity}
*/
void setBoolean(int index, boolean value);
/** /**
* Sets the specified byte at the specified absolute {@code index} in this * Sets the specified byte at the specified absolute {@code index} in this
@ -730,7 +751,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
* if the specified {@code index} is less than {@code 0} or * if the specified {@code index} is less than {@code 0} or
* {@code index + 1} is greater than {@code this.capacity} * {@code index + 1} is greater than {@code this.capacity}
*/ */
void setByte(int index, int value); void setByte(int index, int value);
/** /**
* Sets the specified 16-bit short integer at the specified absolute * Sets the specified 16-bit short integer at the specified absolute
@ -970,6 +991,15 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
*/ */
void setZero(int index, int length); void setZero(int index, int length);
/**
* Gets a boolean at the current {@code readerIndex} and increases
* the {@code readerIndex} by {@code 1} in this buffer.
*
* @throws IndexOutOfBoundsException
* if {@code this.readableBytes} is less than {@code 1}
*/
boolean readBoolean();
/** /**
* Gets a byte at the current {@code readerIndex} and increases * Gets a byte at the current {@code readerIndex} and increases
* the {@code readerIndex} by {@code 1} in this buffer. * the {@code readerIndex} by {@code 1} in this buffer.
@ -1229,6 +1259,15 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
*/ */
void skipBytes(int length); void skipBytes(int length);
/**
* Sets the specified boolean at the current {@code writerIndex}
* and increases the {@code writerIndex} by {@code 1} in this buffer.
*
* @throws IndexOutOfBoundsException
* if {@code this.writableBytes} is less than {@code 1}
*/
void writeBoolean(boolean value);
/** /**
* Sets the specified byte at the current {@code writerIndex} * Sets the specified byte at the current {@code writerIndex}
* and increases the {@code writerIndex} by {@code 1} in this buffer. * and increases the {@code writerIndex} by {@code 1} in this buffer.
@ -1237,7 +1276,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
* @throws IndexOutOfBoundsException * @throws IndexOutOfBoundsException
* if {@code this.writableBytes} is less than {@code 1} * if {@code this.writableBytes} is less than {@code 1}
*/ */
void writeByte(int value); void writeByte(int value);
/** /**
* Sets the specified 16-bit short integer at the current * Sets the specified 16-bit short integer at the current

View File

@ -23,7 +23,6 @@ import java.nio.ByteOrder;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @version $Rev$, $Date$
*/ */
public interface ChannelBufferFactory { public interface ChannelBufferFactory {

View File

@ -28,8 +28,6 @@ package org.jboss.netty.buffer;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.uses org.jboss.netty.buffer.ChannelBuffer * @apiviz.uses org.jboss.netty.buffer.ChannelBuffer
*/ */
public interface ChannelBufferIndexFinder { public interface ChannelBufferIndexFinder {
@ -47,7 +45,7 @@ public interface ChannelBufferIndexFinder {
/** /**
* Index finder which locates a {@code NUL (0x00)} byte. * Index finder which locates a {@code NUL (0x00)} byte.
*/ */
static ChannelBufferIndexFinder NUL = new ChannelBufferIndexFinder() { ChannelBufferIndexFinder NUL = new ChannelBufferIndexFinder() {
@Override @Override
public boolean find(ChannelBuffer buffer, int guessedIndex) { public boolean find(ChannelBuffer buffer, int guessedIndex) {
return buffer.getByte(guessedIndex) == 0; return buffer.getByte(guessedIndex) == 0;
@ -57,7 +55,7 @@ public interface ChannelBufferIndexFinder {
/** /**
* Index finder which locates a non-{@code NUL (0x00)} byte. * Index finder which locates a non-{@code NUL (0x00)} byte.
*/ */
static ChannelBufferIndexFinder NOT_NUL = new ChannelBufferIndexFinder() { ChannelBufferIndexFinder NOT_NUL = new ChannelBufferIndexFinder() {
@Override @Override
public boolean find(ChannelBuffer buffer, int guessedIndex) { public boolean find(ChannelBuffer buffer, int guessedIndex) {
return buffer.getByte(guessedIndex) != 0; return buffer.getByte(guessedIndex) != 0;
@ -67,7 +65,7 @@ public interface ChannelBufferIndexFinder {
/** /**
* Index finder which locates a {@code CR ('\r')} byte. * Index finder which locates a {@code CR ('\r')} byte.
*/ */
static ChannelBufferIndexFinder CR = new ChannelBufferIndexFinder() { ChannelBufferIndexFinder CR = new ChannelBufferIndexFinder() {
@Override @Override
public boolean find(ChannelBuffer buffer, int guessedIndex) { public boolean find(ChannelBuffer buffer, int guessedIndex) {
return buffer.getByte(guessedIndex) == '\r'; return buffer.getByte(guessedIndex) == '\r';
@ -77,7 +75,7 @@ public interface ChannelBufferIndexFinder {
/** /**
* Index finder which locates a non-{@code CR ('\r')} byte. * Index finder which locates a non-{@code CR ('\r')} byte.
*/ */
static ChannelBufferIndexFinder NOT_CR = new ChannelBufferIndexFinder() { ChannelBufferIndexFinder NOT_CR = new ChannelBufferIndexFinder() {
@Override @Override
public boolean find(ChannelBuffer buffer, int guessedIndex) { public boolean find(ChannelBuffer buffer, int guessedIndex) {
return buffer.getByte(guessedIndex) != '\r'; return buffer.getByte(guessedIndex) != '\r';
@ -87,7 +85,7 @@ public interface ChannelBufferIndexFinder {
/** /**
* Index finder which locates a {@code LF ('\n')} byte. * Index finder which locates a {@code LF ('\n')} byte.
*/ */
static ChannelBufferIndexFinder LF = new ChannelBufferIndexFinder() { ChannelBufferIndexFinder LF = new ChannelBufferIndexFinder() {
@Override @Override
public boolean find(ChannelBuffer buffer, int guessedIndex) { public boolean find(ChannelBuffer buffer, int guessedIndex) {
return buffer.getByte(guessedIndex) == '\n'; return buffer.getByte(guessedIndex) == '\n';
@ -97,7 +95,7 @@ public interface ChannelBufferIndexFinder {
/** /**
* Index finder which locates a non-{@code LF ('\n')} byte. * Index finder which locates a non-{@code LF ('\n')} byte.
*/ */
static ChannelBufferIndexFinder NOT_LF = new ChannelBufferIndexFinder() { ChannelBufferIndexFinder NOT_LF = new ChannelBufferIndexFinder() {
@Override @Override
public boolean find(ChannelBuffer buffer, int guessedIndex) { public boolean find(ChannelBuffer buffer, int guessedIndex) {
return buffer.getByte(guessedIndex) != '\n'; return buffer.getByte(guessedIndex) != '\n';
@ -107,7 +105,7 @@ public interface ChannelBufferIndexFinder {
/** /**
* Index finder which locates a {@code CR ('\r')} or {@code LF ('\n')}. * Index finder which locates a {@code CR ('\r')} or {@code LF ('\n')}.
*/ */
static ChannelBufferIndexFinder CRLF = new ChannelBufferIndexFinder() { ChannelBufferIndexFinder CRLF = new ChannelBufferIndexFinder() {
@Override @Override
public boolean find(ChannelBuffer buffer, int guessedIndex) { public boolean find(ChannelBuffer buffer, int guessedIndex) {
byte b = buffer.getByte(guessedIndex); byte b = buffer.getByte(guessedIndex);
@ -119,7 +117,7 @@ public interface ChannelBufferIndexFinder {
* Index finder which locates a byte which is neither a {@code CR ('\r')} * Index finder which locates a byte which is neither a {@code CR ('\r')}
* nor a {@code LF ('\n')}. * nor a {@code LF ('\n')}.
*/ */
static ChannelBufferIndexFinder NOT_CRLF = new ChannelBufferIndexFinder() { ChannelBufferIndexFinder NOT_CRLF = new ChannelBufferIndexFinder() {
@Override @Override
public boolean find(ChannelBuffer buffer, int guessedIndex) { public boolean find(ChannelBuffer buffer, int guessedIndex) {
byte b = buffer.getByte(guessedIndex); byte b = buffer.getByte(guessedIndex);
@ -131,7 +129,7 @@ public interface ChannelBufferIndexFinder {
* Index finder which locates a linear whitespace * Index finder which locates a linear whitespace
* ({@code ' '} and {@code '\t'}). * ({@code ' '} and {@code '\t'}).
*/ */
static ChannelBufferIndexFinder LINEAR_WHITESPACE = new ChannelBufferIndexFinder() { ChannelBufferIndexFinder LINEAR_WHITESPACE = new ChannelBufferIndexFinder() {
@Override @Override
public boolean find(ChannelBuffer buffer, int guessedIndex) { public boolean find(ChannelBuffer buffer, int guessedIndex) {
byte b = buffer.getByte(guessedIndex); byte b = buffer.getByte(guessedIndex);
@ -143,7 +141,7 @@ public interface ChannelBufferIndexFinder {
* Index finder which locates a byte which is not a linear whitespace * Index finder which locates a byte which is not a linear whitespace
* (neither {@code ' '} nor {@code '\t'}). * (neither {@code ' '} nor {@code '\t'}).
*/ */
static ChannelBufferIndexFinder NOT_LINEAR_WHITESPACE = new ChannelBufferIndexFinder() { ChannelBufferIndexFinder NOT_LINEAR_WHITESPACE = new ChannelBufferIndexFinder() {
@Override @Override
public boolean find(ChannelBuffer buffer, int guessedIndex) { public boolean find(ChannelBuffer buffer, int guessedIndex) {
byte b = buffer.getByte(guessedIndex); byte b = buffer.getByte(guessedIndex);

View File

@ -35,8 +35,6 @@ import java.io.InputStream;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @see ChannelBufferOutputStream * @see ChannelBufferOutputStream
* @apiviz.uses org.jboss.netty.buffer.ChannelBuffer * @apiviz.uses org.jboss.netty.buffer.ChannelBuffer
*/ */

View File

@ -34,8 +34,6 @@ import java.io.OutputStream;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @see ChannelBufferInputStream * @see ChannelBufferInputStream
* @apiviz.uses org.jboss.netty.buffer.ChannelBuffer * @apiviz.uses org.jboss.netty.buffer.ChannelBuffer
*/ */

View File

@ -85,8 +85,6 @@ import org.jboss.netty.util.CharsetUtil;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.landmark * @apiviz.landmark
* @apiviz.has org.jboss.netty.buffer.ChannelBuffer oneway - - creates * @apiviz.has org.jboss.netty.buffer.ChannelBuffer oneway - - creates
*/ */
@ -804,8 +802,7 @@ public class ChannelBuffers {
} }
private static ChannelBuffer copiedBuffer(ByteOrder endianness, CharBuffer buffer, Charset charset) { private static ChannelBuffer copiedBuffer(ByteOrder endianness, CharBuffer buffer, Charset charset) {
CharBuffer src = buffer; ByteBuffer dst = ChannelBuffers.encodeString(buffer, charset);
ByteBuffer dst = ChannelBuffers.encodeString(src, charset);
ChannelBuffer result = wrappedBuffer(endianness, dst.array()); ChannelBuffer result = wrappedBuffer(endianness, dst.array());
result.writerIndex(dst.remaining()); result.writerIndex(dst.remaining());
return result; return result;

View File

@ -35,9 +35,6 @@ import java.util.List;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @author Frederic Bregier (fredbregier@free.fr) * @author Frederic Bregier (fredbregier@free.fr)
*
* @version $Rev$, $Date$
*
*/ */
public class CompositeChannelBuffer extends AbstractChannelBuffer { public class CompositeChannelBuffer extends AbstractChannelBuffer {

View File

@ -32,7 +32,6 @@ import java.nio.ByteOrder;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @version $Rev$, $Date$
*/ */
public class DirectChannelBufferFactory extends AbstractChannelBufferFactory { public class DirectChannelBufferFactory extends AbstractChannelBufferFactory {

View File

@ -31,9 +31,6 @@ import java.nio.channels.ScatteringByteChannel;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*
*/ */
public class DuplicatedChannelBuffer extends AbstractChannelBuffer implements WrappedChannelBuffer { public class DuplicatedChannelBuffer extends AbstractChannelBuffer implements WrappedChannelBuffer {

View File

@ -31,9 +31,6 @@ import java.nio.channels.ScatteringByteChannel;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*
*/ */
public class DynamicChannelBuffer extends AbstractChannelBuffer { public class DynamicChannelBuffer extends AbstractChannelBuffer {

View File

@ -28,8 +28,6 @@ import java.nio.channels.ScatteringByteChannel;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public abstract class HeapChannelBuffer extends AbstractChannelBuffer { public abstract class HeapChannelBuffer extends AbstractChannelBuffer {

View File

@ -26,7 +26,6 @@ import java.nio.ByteOrder;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @version $Rev$, $Date$
*/ */
public class HeapChannelBufferFactory extends AbstractChannelBufferFactory { public class HeapChannelBufferFactory extends AbstractChannelBufferFactory {
@ -57,7 +56,6 @@ public class HeapChannelBufferFactory extends AbstractChannelBufferFactory {
* {@link ByteOrder#BIG_ENDIAN}. * {@link ByteOrder#BIG_ENDIAN}.
*/ */
public HeapChannelBufferFactory() { public HeapChannelBufferFactory() {
super();
} }
/** /**

View File

@ -25,8 +25,6 @@ import java.nio.ByteOrder;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public class LittleEndianHeapChannelBuffer extends HeapChannelBuffer { public class LittleEndianHeapChannelBuffer extends HeapChannelBuffer {

View File

@ -31,9 +31,6 @@ import java.nio.channels.ScatteringByteChannel;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*
*/ */
public class ReadOnlyChannelBuffer extends AbstractChannelBuffer implements WrappedChannelBuffer { public class ReadOnlyChannelBuffer extends AbstractChannelBuffer implements WrappedChannelBuffer {

View File

@ -32,9 +32,6 @@ import java.nio.channels.ScatteringByteChannel;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*
*/ */
public class SlicedChannelBuffer extends AbstractChannelBuffer implements WrappedChannelBuffer { public class SlicedChannelBuffer extends AbstractChannelBuffer implements WrappedChannelBuffer {

View File

@ -32,9 +32,6 @@ import java.nio.channels.ScatteringByteChannel;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*
*/ */
public class TruncatedChannelBuffer extends AbstractChannelBuffer implements WrappedChannelBuffer { public class TruncatedChannelBuffer extends AbstractChannelBuffer implements WrappedChannelBuffer {

View File

@ -21,9 +21,6 @@ package org.jboss.netty.buffer;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*
*/ */
public interface WrappedChannelBuffer extends ChannelBuffer { public interface WrappedChannelBuffer extends ChannelBuffer {
/** /**

View File

@ -26,8 +26,6 @@ import org.jboss.netty.util.internal.ConcurrentHashMap;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
*/ */
public abstract class AbstractChannel implements Channel { public abstract class AbstractChannel implements Channel {

View File

@ -22,8 +22,6 @@ import static org.jboss.netty.channel.Channels.*;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public abstract class AbstractChannelSink implements ChannelSink { public abstract class AbstractChannelSink implements ChannelSink {
@ -31,7 +29,6 @@ public abstract class AbstractChannelSink implements ChannelSink {
* Creates a new instance. * Creates a new instance.
*/ */
protected AbstractChannelSink() { protected AbstractChannelSink() {
super();
} }
/** /**

View File

@ -32,9 +32,6 @@ import java.net.SocketAddress;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*
*/ */
public abstract class AbstractServerChannel extends AbstractChannel implements ServerChannel { public abstract class AbstractServerChannel extends AbstractChannel implements ServerChannel {

View File

@ -30,9 +30,6 @@ import java.util.List;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*
*/ */
public class AdaptiveReceiveBufferSizePredictor implements public class AdaptiveReceiveBufferSizePredictor implements
ReceiveBufferSizePredictor { ReceiveBufferSizePredictor {

View File

@ -22,8 +22,6 @@ package org.jboss.netty.channel;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public class AdaptiveReceiveBufferSizePredictorFactory implements public class AdaptiveReceiveBufferSizePredictorFactory implements
ReceiveBufferSizePredictorFactory { ReceiveBufferSizePredictorFactory {

View File

@ -103,8 +103,6 @@ import org.jboss.netty.channel.socket.nio.NioSocketChannelConfig;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.landmark * @apiviz.landmark
* @apiviz.composedOf org.jboss.netty.channel.ChannelConfig * @apiviz.composedOf org.jboss.netty.channel.ChannelConfig
* @apiviz.composedOf org.jboss.netty.channel.ChannelPipeline * @apiviz.composedOf org.jboss.netty.channel.ChannelPipeline
@ -117,25 +115,25 @@ public interface Channel extends Comparable<Channel> {
* The {@link #getInterestOps() interestOps} value which tells that only * The {@link #getInterestOps() interestOps} value which tells that only
* read operation has been suspended. * read operation has been suspended.
*/ */
static int OP_NONE = 0; int OP_NONE = 0;
/** /**
* The {@link #getInterestOps() interestOps} value which tells that neither * The {@link #getInterestOps() interestOps} value which tells that neither
* read nor write operation has been suspended. * read nor write operation has been suspended.
*/ */
static int OP_READ = 1; int OP_READ = 1;
/** /**
* The {@link #getInterestOps() interestOps} value which tells that both * The {@link #getInterestOps() interestOps} value which tells that both
* read and write operation has been suspended. * read and write operation has been suspended.
*/ */
static int OP_WRITE = 4; int OP_WRITE = 4;
/** /**
* The {@link #getInterestOps() interestOps} value which tells that only * The {@link #getInterestOps() interestOps} value which tells that only
* write operation has been suspended. * write operation has been suspended.
*/ */
static int OP_READ_WRITE = OP_READ | OP_WRITE; int OP_READ_WRITE = OP_READ | OP_WRITE;
/** /**
* Returns the unique integer ID of this channel. * Returns the unique integer ID of this channel.

View File

@ -63,8 +63,6 @@ import org.jboss.netty.channel.socket.nio.NioSocketChannelConfig;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.has org.jboss.netty.channel.ChannelPipelineFactory * @apiviz.has org.jboss.netty.channel.ChannelPipelineFactory
* @apiviz.composedOf org.jboss.netty.channel.ReceiveBufferSizePredictor * @apiviz.composedOf org.jboss.netty.channel.ReceiveBufferSizePredictor
* *

View File

@ -71,8 +71,6 @@ package org.jboss.netty.channel;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.exclude ^org\.jboss\.netty\.handler\..*$ * @apiviz.exclude ^org\.jboss\.netty\.handler\..*$
*/ */
public interface ChannelDownstreamHandler extends ChannelHandler { public interface ChannelDownstreamHandler extends ChannelHandler {

View File

@ -181,8 +181,6 @@ import org.jboss.netty.channel.socket.ServerSocketChannel;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.landmark * @apiviz.landmark
* @apiviz.composedOf org.jboss.netty.channel.ChannelFuture * @apiviz.composedOf org.jboss.netty.channel.ChannelFuture
*/ */

View File

@ -21,8 +21,6 @@ package org.jboss.netty.channel;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.hidden * @apiviz.hidden
*/ */
public class ChannelException extends RuntimeException { public class ChannelException extends RuntimeException {
@ -33,7 +31,6 @@ public class ChannelException extends RuntimeException {
* Creates a new exception. * Creates a new exception.
*/ */
public ChannelException() { public ChannelException() {
super();
} }
/** /**

View File

@ -50,8 +50,6 @@ import org.jboss.netty.util.ExternalResourceReleasable;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.landmark * @apiviz.landmark
* @apiviz.has org.jboss.netty.channel.Channel oneway - - creates * @apiviz.has org.jboss.netty.channel.Channel oneway - - creates
* *

View File

@ -167,8 +167,6 @@ import org.jboss.netty.handler.execution.ExecutionHandler;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.landmark * @apiviz.landmark
* @apiviz.owns org.jboss.netty.channel.ChannelFutureListener - - notifies * @apiviz.owns org.jboss.netty.channel.ChannelFutureListener - - notifies
*/ */

View File

@ -14,13 +14,11 @@
* under the License. * under the License.
*/ */
package org.jboss.netty.channel.socket.http; package org.jboss.netty.channel;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelFutureListener;
/** /**
* Class which is used to consolidate multiple channel futures into one, by * Class which is used to consolidate multiple channel futures into one, by
@ -31,24 +29,28 @@ import org.jboss.netty.channel.ChannelFutureListener;
* @author Iain McGinniss (iain.mcginniss@onedrum.com) * @author Iain McGinniss (iain.mcginniss@onedrum.com)
* @author OneDrum Ltd. * @author OneDrum Ltd.
*/ */
class ChannelFutureAggregator implements ChannelFutureListener { public class ChannelFutureAggregator implements ChannelFutureListener {
private final ChannelFuture aggregateFuture; private final ChannelFuture aggregateFuture;
private final Set<ChannelFuture> pendingFutures; private Set<ChannelFuture> pendingFutures;
public ChannelFutureAggregator(ChannelFuture aggregateFuture) { public ChannelFutureAggregator(ChannelFuture aggregateFuture) {
this.aggregateFuture = aggregateFuture; this.aggregateFuture = aggregateFuture;
pendingFutures = new HashSet<ChannelFuture>();
} }
public void addFuture(ChannelFuture future) { public void addFuture(ChannelFuture future) {
pendingFutures.add(future); synchronized(this) {
if (pendingFutures == null) {
pendingFutures = new HashSet<ChannelFuture>();
}
pendingFutures.add(future);
}
future.addListener(this); future.addListener(this);
} }
@Override @Override
public synchronized void operationComplete(ChannelFuture future) public void operationComplete(ChannelFuture future)
throws Exception { throws Exception {
if (future.isCancelled()) { if (future.isCancelled()) {
// TODO: what should the correct behaviour be when a fragment is cancelled? // TODO: what should the correct behaviour be when a fragment is cancelled?
@ -56,17 +58,24 @@ class ChannelFutureAggregator implements ChannelFutureListener {
return; return;
} }
pendingFutures.remove(future); synchronized (this) {
if (!future.isSuccess()) { if (pendingFutures == null) {
aggregateFuture.setFailure(future.getCause()); aggregateFuture.setSuccess();
for (ChannelFuture pendingFuture: pendingFutures) { } else {
pendingFuture.cancel(); pendingFutures.remove(future);
if (!future.isSuccess()) {
aggregateFuture.setFailure(future.getCause());
for (ChannelFuture pendingFuture: pendingFutures) {
pendingFuture.cancel();
}
} else {
if (pendingFutures.isEmpty()) {
aggregateFuture.setSuccess();
}
}
} }
return;
} }
if (pendingFutures.isEmpty()) {
aggregateFuture.setSuccess();
}
} }
} }

View File

@ -32,8 +32,6 @@ import java.util.EventListener;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public interface ChannelFutureListener extends EventListener { public interface ChannelFutureListener extends EventListener {
@ -41,7 +39,7 @@ public interface ChannelFutureListener extends EventListener {
* A {@link ChannelFutureListener} that closes the {@link Channel} which is * A {@link ChannelFutureListener} that closes the {@link Channel} which is
* associated with the specified {@link ChannelFuture}. * associated with the specified {@link ChannelFuture}.
*/ */
static ChannelFutureListener CLOSE = new ChannelFutureListener() { ChannelFutureListener CLOSE = new ChannelFutureListener() {
@Override @Override
public void operationComplete(ChannelFuture future) { public void operationComplete(ChannelFuture future) {
future.getChannel().close(); future.getChannel().close();
@ -52,7 +50,7 @@ public interface ChannelFutureListener extends EventListener {
* A {@link ChannelFutureListener} that closes the {@link Channel} when the * A {@link ChannelFutureListener} that closes the {@link Channel} when the
* operation ended up with a failure or cancellation rather than a success. * operation ended up with a failure or cancellation rather than a success.
*/ */
static ChannelFutureListener CLOSE_ON_FAILURE = new ChannelFutureListener() { ChannelFutureListener CLOSE_ON_FAILURE = new ChannelFutureListener() {
@Override @Override
public void operationComplete(ChannelFuture future) { public void operationComplete(ChannelFuture future) {
if (!future.isSuccess()) { if (!future.isSuccess()) {

View File

@ -38,8 +38,6 @@ package org.jboss.netty.channel;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev: 2080 $, $Date: 2010-01-26 18:04:19 +0900 (Tue, 26 Jan 2010) $
*/ */
public interface ChannelFutureProgressListener extends ChannelFutureListener { public interface ChannelFutureProgressListener extends ChannelFutureListener {

View File

@ -206,8 +206,6 @@ import org.jboss.netty.channel.group.ChannelGroup;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.landmark * @apiviz.landmark
* @apiviz.exclude ^org\.jboss\.netty\.handler\..*$ * @apiviz.exclude ^org\.jboss\.netty\.handler\..*$
*/ */
@ -227,13 +225,12 @@ public interface ChannelHandler {
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @version $Rev$, $Date$
*/ */
@Inherited @Inherited
@Documented @Documented
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public @interface Sharable { @interface Sharable {
// no value // no value
} }
} }

View File

@ -120,8 +120,6 @@ package org.jboss.netty.channel;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.owns org.jboss.netty.channel.ChannelHandler * @apiviz.owns org.jboss.netty.channel.ChannelHandler
*/ */
public interface ChannelHandlerContext { public interface ChannelHandlerContext {

View File

@ -23,8 +23,6 @@ package org.jboss.netty.channel;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.hidden * @apiviz.hidden
*/ */
public class ChannelHandlerLifeCycleException extends RuntimeException { public class ChannelHandlerLifeCycleException extends RuntimeException {
@ -35,7 +33,6 @@ public class ChannelHandlerLifeCycleException extends RuntimeException {
* Creates a new exception. * Creates a new exception.
*/ */
public ChannelHandlerLifeCycleException() { public ChannelHandlerLifeCycleException() {
super();
} }
/** /**

View File

@ -31,7 +31,6 @@ import org.jboss.netty.util.internal.ConcurrentIdentityWeakKeyHashMap;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @version $Rev$, $Date$
* *
* @apiviz.stereotype utility * @apiviz.stereotype utility
*/ */

View File

@ -204,8 +204,6 @@ import org.jboss.netty.handler.ssl.SslHandler;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.landmark * @apiviz.landmark
* @apiviz.composedOf org.jboss.netty.channel.ChannelHandlerContext * @apiviz.composedOf org.jboss.netty.channel.ChannelHandlerContext
* @apiviz.owns org.jboss.netty.channel.ChannelHandler * @apiviz.owns org.jboss.netty.channel.ChannelHandler

View File

@ -23,8 +23,6 @@ package org.jboss.netty.channel;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.hidden * @apiviz.hidden
*/ */
public class ChannelPipelineException extends ChannelException { public class ChannelPipelineException extends ChannelException {
@ -35,7 +33,6 @@ public class ChannelPipelineException extends ChannelException {
* Creates a new instance. * Creates a new instance.
*/ */
public ChannelPipelineException() { public ChannelPipelineException() {
super();
} }
/** /**

View File

@ -35,8 +35,6 @@ import org.jboss.netty.bootstrap.ConnectionlessBootstrap;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.has org.jboss.netty.channel.ChannelPipeline oneway - - creates * @apiviz.has org.jboss.netty.channel.ChannelPipeline oneway - - creates
*/ */
public interface ChannelPipelineFactory { public interface ChannelPipelineFactory {

View File

@ -26,8 +26,6 @@ package org.jboss.netty.channel;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.uses org.jboss.netty.channel.ChannelPipeline - - sends events upstream * @apiviz.uses org.jboss.netty.channel.ChannelPipeline - - sends events upstream
*/ */
public interface ChannelSink { public interface ChannelSink {

View File

@ -76,8 +76,6 @@ import java.net.SocketAddress;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public enum ChannelState { public enum ChannelState {
/** /**
@ -100,5 +98,5 @@ public enum ChannelState {
* Represents a {@link Channel}'s {@link Channel#getInterestOps() interestOps} * Represents a {@link Channel}'s {@link Channel#getInterestOps() interestOps}
* property * property
*/ */
INTEREST_OPS; INTEREST_OPS
} }

View File

@ -27,8 +27,6 @@ package org.jboss.netty.channel;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.has org.jboss.netty.channel.ChannelState * @apiviz.has org.jboss.netty.channel.ChannelState
*/ */
public interface ChannelStateEvent extends ChannelEvent { public interface ChannelStateEvent extends ChannelEvent {

View File

@ -87,8 +87,6 @@ import org.jboss.netty.handler.execution.ExecutionHandler;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.exclude ^org\.jboss\.netty\.handler\..*$ * @apiviz.exclude ^org\.jboss\.netty\.handler\..*$
*/ */
public interface ChannelUpstreamHandler extends ChannelHandler { public interface ChannelUpstreamHandler extends ChannelHandler {

View File

@ -50,8 +50,6 @@ import org.jboss.netty.util.internal.ConversionUtil;
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @apiviz.landmark * @apiviz.landmark
*
* @version $Rev$, $Date$
*/ */
public class Channels { public class Channels {

View File

@ -23,8 +23,6 @@ package org.jboss.netty.channel;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public interface ChildChannelStateEvent extends ChannelEvent { public interface ChildChannelStateEvent extends ChannelEvent {

View File

@ -26,8 +26,6 @@ import org.jboss.netty.logging.InternalLoggerFactory;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public abstract class CompleteChannelFuture implements ChannelFuture { public abstract class CompleteChannelFuture implements ChannelFuture {

View File

@ -28,22 +28,12 @@ import org.jboss.netty.util.internal.ConversionUtil;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*
*/ */
public class DefaultChannelConfig implements ChannelConfig { public class DefaultChannelConfig implements ChannelConfig {
private volatile ChannelBufferFactory bufferFactory = HeapChannelBufferFactory.getInstance(); private volatile ChannelBufferFactory bufferFactory = HeapChannelBufferFactory.getInstance();
private volatile int connectTimeoutMillis = 10000; // 10 seconds private volatile int connectTimeoutMillis = 10000; // 10 seconds
/**
* Creates a new instance.
*/
public DefaultChannelConfig() {
super();
}
@Override @Override
public void setOptions(Map<String, Object> options) { public void setOptions(Map<String, Object> options) {
for (Entry<String, Object> e: options.entrySet()) { for (Entry<String, Object> e: options.entrySet()) {

View File

@ -34,8 +34,6 @@ import org.jboss.netty.util.internal.DeadLockProofWorker;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public class DefaultChannelFuture implements ChannelFuture { public class DefaultChannelFuture implements ChannelFuture {

View File

@ -32,9 +32,6 @@ import org.jboss.netty.logging.InternalLoggerFactory;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*
*/ */
public class DefaultChannelPipeline implements ChannelPipeline { public class DefaultChannelPipeline implements ChannelPipeline {
@ -48,13 +45,6 @@ public class DefaultChannelPipeline implements ChannelPipeline {
private final Map<String, DefaultChannelHandlerContext> name2ctx = private final Map<String, DefaultChannelHandlerContext> name2ctx =
new HashMap<String, DefaultChannelHandlerContext>(4); new HashMap<String, DefaultChannelHandlerContext>(4);
/**
* Creates a new empty pipeline.
*/
public DefaultChannelPipeline() {
super();
}
@Override @Override
public Channel getChannel() { public Channel getChannel() {
return channel; return channel;
@ -692,7 +682,7 @@ public class DefaultChannelPipeline implements ChannelPipeline {
private void checkDuplicateName(String name) { private void checkDuplicateName(String name) {
if (name2ctx.containsKey(name)) { if (name2ctx.containsKey(name)) {
throw new IllegalArgumentException("Duplicate handler name."); throw new IllegalArgumentException("Duplicate handler name: " + name);
} }
} }
@ -824,7 +814,6 @@ public class DefaultChannelPipeline implements ChannelPipeline {
private static final class DiscardingChannelSink implements ChannelSink { private static final class DiscardingChannelSink implements ChannelSink {
DiscardingChannelSink() { DiscardingChannelSink() {
super();
} }
@Override @Override

View File

@ -22,9 +22,6 @@ import static org.jboss.netty.channel.Channels.*;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*
*/ */
public class DefaultChildChannelStateEvent implements ChildChannelStateEvent { public class DefaultChildChannelStateEvent implements ChildChannelStateEvent {

View File

@ -24,9 +24,6 @@ import org.jboss.netty.util.internal.StackTraceSimplifier;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*
*/ */
public class DefaultExceptionEvent implements ExceptionEvent { public class DefaultExceptionEvent implements ExceptionEvent {

View File

@ -27,21 +27,12 @@ import org.jboss.netty.channel.socket.ServerSocketChannelConfig;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public class DefaultServerChannelConfig implements ChannelConfig { public class DefaultServerChannelConfig implements ChannelConfig {
private volatile ChannelPipelineFactory pipelineFactory; private volatile ChannelPipelineFactory pipelineFactory;
private volatile ChannelBufferFactory bufferFactory = HeapChannelBufferFactory.getInstance(); private volatile ChannelBufferFactory bufferFactory = HeapChannelBufferFactory.getInstance();
/**
* Creates a new instance.
*/
public DefaultServerChannelConfig() {
super();
}
@Override @Override
public void setOptions(Map<String, Object> options) { public void setOptions(Map<String, Object> options) {
for (Entry<String, Object> e: options.entrySet()) { for (Entry<String, Object> e: options.entrySet()) {

View File

@ -22,8 +22,6 @@ import static org.jboss.netty.channel.Channels.*;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public class DefaultWriteCompletionEvent implements WriteCompletionEvent { public class DefaultWriteCompletionEvent implements WriteCompletionEvent {

View File

@ -20,9 +20,6 @@ package org.jboss.netty.channel;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*
*/ */
public class DownstreamChannelStateEvent implements ChannelStateEvent { public class DownstreamChannelStateEvent implements ChannelStateEvent {

View File

@ -24,9 +24,6 @@ import org.jboss.netty.util.internal.StringUtil;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*
*/ */
public class DownstreamMessageEvent implements MessageEvent { public class DownstreamMessageEvent implements MessageEvent {

View File

@ -24,8 +24,6 @@ package org.jboss.netty.channel;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public interface ExceptionEvent extends ChannelEvent { public interface ExceptionEvent extends ChannelEvent {

View File

@ -22,8 +22,6 @@ package org.jboss.netty.channel;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public class FailedChannelFuture extends CompleteChannelFuture { public class FailedChannelFuture extends CompleteChannelFuture {

View File

@ -56,7 +56,6 @@ import org.jboss.netty.util.ExternalResourceReleasable;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @version $Rev: 2080 $, $Date: 2010-01-26 18:04:19 +0900 (Tue, 26 Jan 2010) $
*/ */
public interface FileRegion extends ExternalResourceReleasable { public interface FileRegion extends ExternalResourceReleasable {

View File

@ -22,8 +22,6 @@ package org.jboss.netty.channel;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public class FixedReceiveBufferSizePredictor implements public class FixedReceiveBufferSizePredictor implements
ReceiveBufferSizePredictor { ReceiveBufferSizePredictor {

View File

@ -22,8 +22,6 @@ package org.jboss.netty.channel;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public class FixedReceiveBufferSizePredictorFactory implements public class FixedReceiveBufferSizePredictorFactory implements
ReceiveBufferSizePredictorFactory { ReceiveBufferSizePredictorFactory {

View File

@ -30,7 +30,6 @@ package org.jboss.netty.channel;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @version $Rev$, $Date$
*/ */
public interface LifeCycleAwareChannelHandler extends ChannelHandler { public interface LifeCycleAwareChannelHandler extends ChannelHandler {
void beforeAdd(ChannelHandlerContext ctx) throws Exception; void beforeAdd(ChannelHandlerContext ctx) throws Exception;

View File

@ -27,8 +27,6 @@ import java.net.SocketAddress;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public interface MessageEvent extends ChannelEvent { public interface MessageEvent extends ChannelEvent {

View File

@ -32,9 +32,6 @@ import org.jboss.netty.buffer.ChannelBuffer;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*
*/ */
public interface ReceiveBufferSizePredictor { public interface ReceiveBufferSizePredictor {

View File

@ -21,8 +21,6 @@ package org.jboss.netty.channel;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.has org.jboss.netty.channel.ReceiveBufferSizePredictor oneway - - creates * @apiviz.has org.jboss.netty.channel.ReceiveBufferSizePredictor oneway - - creates
*/ */
public interface ReceiveBufferSizePredictorFactory { public interface ReceiveBufferSizePredictorFactory {

View File

@ -24,7 +24,6 @@ import org.jboss.netty.channel.socket.ServerSocketChannel;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @version $Rev$, $Date$
*/ */
public interface ServerChannel extends Channel { public interface ServerChannel extends Channel {
// This is a tag interface. // This is a tag interface.

View File

@ -21,8 +21,6 @@ package org.jboss.netty.channel;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* *
* @version $Rev$, $Date$
*
* @apiviz.has org.jboss.netty.channel.ServerChannel oneway - - creates * @apiviz.has org.jboss.netty.channel.ServerChannel oneway - - creates
*/ */
public interface ServerChannelFactory extends ChannelFactory { public interface ServerChannelFactory extends ChannelFactory {

View File

@ -52,8 +52,6 @@ import java.net.SocketAddress;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public class SimpleChannelDownstreamHandler implements ChannelDownstreamHandler { public class SimpleChannelDownstreamHandler implements ChannelDownstreamHandler {
@ -61,7 +59,6 @@ public class SimpleChannelDownstreamHandler implements ChannelDownstreamHandler
* Creates a new instance. * Creates a new instance.
*/ */
public SimpleChannelDownstreamHandler() { public SimpleChannelDownstreamHandler() {
super();
} }
/** /**

View File

@ -73,8 +73,6 @@ import org.jboss.netty.logging.InternalLoggerFactory;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public class SimpleChannelHandler implements ChannelUpstreamHandler, ChannelDownstreamHandler { public class SimpleChannelHandler implements ChannelUpstreamHandler, ChannelDownstreamHandler {
@ -85,7 +83,6 @@ public class SimpleChannelHandler implements ChannelUpstreamHandler, ChannelDown
* Creates a new instance. * Creates a new instance.
*/ */
public SimpleChannelHandler() { public SimpleChannelHandler() {
super();
} }
/** /**

View File

@ -53,8 +53,6 @@ import org.jboss.netty.logging.InternalLoggerFactory;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public class SimpleChannelUpstreamHandler implements ChannelUpstreamHandler { public class SimpleChannelUpstreamHandler implements ChannelUpstreamHandler {
@ -65,7 +63,6 @@ public class SimpleChannelUpstreamHandler implements ChannelUpstreamHandler {
* Creates a new instance. * Creates a new instance.
*/ */
public SimpleChannelUpstreamHandler() { public SimpleChannelUpstreamHandler() {
super();
} }
/** /**

View File

@ -33,9 +33,6 @@ import org.jboss.netty.util.internal.ConversionUtil;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*
*/ */
public class StaticChannelPipeline implements ChannelPipeline { public class StaticChannelPipeline implements ChannelPipeline {

View File

@ -22,8 +22,6 @@ package org.jboss.netty.channel;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public class SucceededChannelFuture extends CompleteChannelFuture { public class SucceededChannelFuture extends CompleteChannelFuture {

View File

@ -22,9 +22,6 @@ import static org.jboss.netty.channel.Channels.*;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*
*/ */
public class UpstreamChannelStateEvent implements ChannelStateEvent { public class UpstreamChannelStateEvent implements ChannelStateEvent {

View File

@ -26,9 +26,6 @@ import org.jboss.netty.util.internal.StringUtil;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*
*/ */
public class UpstreamMessageEvent implements MessageEvent { public class UpstreamMessageEvent implements MessageEvent {

View File

@ -24,8 +24,6 @@ package org.jboss.netty.channel;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public interface WriteCompletionEvent extends ChannelEvent { public interface WriteCompletionEvent extends ChannelEvent {
/** /**

View File

@ -90,7 +90,6 @@ import org.jboss.netty.util.CharsetUtil;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @version $Rev$, $Date$
* *
* @apiviz.landmark * @apiviz.landmark
* @apiviz.has org.jboss.netty.channel.group.ChannelGroupFuture oneway - - returns * @apiviz.has org.jboss.netty.channel.group.ChannelGroupFuture oneway - - returns

View File

@ -110,7 +110,6 @@ import org.jboss.netty.handler.execution.ExecutionHandler;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @version $Rev$, $Date$
* *
* @apiviz.owns org.jboss.netty.channel.group.ChannelGroupFutureListener - - notifies * @apiviz.owns org.jboss.netty.channel.group.ChannelGroupFutureListener - - notifies
*/ */

View File

@ -25,8 +25,6 @@ import java.util.EventListener;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public interface ChannelGroupFutureListener extends EventListener { public interface ChannelGroupFutureListener extends EventListener {

View File

@ -21,7 +21,6 @@ import java.util.NoSuchElementException;
/** /**
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @version $Rev$, $Date$
*/ */
final class CombinedIterator<E> implements Iterator<E> { final class CombinedIterator<E> implements Iterator<E> {
@ -59,8 +58,7 @@ final class CombinedIterator<E> implements Iterator<E> {
@Override @Override
public E next() { public E next() {
try { try {
E e = currentIterator.next(); return currentIterator.next();
return e;
} catch (NoSuchElementException e) { } catch (NoSuchElementException e) {
if (currentIterator == i1) { if (currentIterator == i1) {
currentIterator = i2; currentIterator = i2;

View File

@ -37,7 +37,6 @@ import org.jboss.netty.util.internal.ConcurrentHashMap;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @version $Rev$, $Date$
* *
* @apiviz.landmark * @apiviz.landmark
*/ */

View File

@ -38,8 +38,6 @@ import org.jboss.netty.util.internal.DeadLockProofWorker;
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev$, $Date$
*/ */
public class DefaultChannelGroupFuture implements ChannelGroupFuture { public class DefaultChannelGroupFuture implements ChannelGroupFuture {

View File

@ -20,29 +20,35 @@ import java.io.OutputStream;
import java.net.SocketAddress; import java.net.SocketAddress;
/** /**
* A {@link java.net.SocketAddress} implementation holding an {@link java.io.InputStream} and an {@link java.io.OutputStream} instance used as * A {@link java.net.SocketAddress} implementation holding an
* "remote" address to connect to with a {@link IOStreamChannel}. * {@link java.io.InputStream} and an {@link java.io.OutputStream} instance used
* as "remote" address to connect to with a {@link IOStreamChannel}.
* *
* @author Daniel Bimschas * @author Daniel Bimschas
* @author Dennis Pfisterer * @author Dennis Pfisterer
*/ */
public class IOStreamAddress extends SocketAddress { public class IOStreamAddress extends SocketAddress {
private final InputStream inputStream; /**
*
*/
private static final long serialVersionUID = -4382415449059935960L;
private final OutputStream outputStream; private final InputStream inputStream;
public IOStreamAddress(final InputStream inputStream, final OutputStream outputStream) { private final OutputStream outputStream;
this.inputStream = inputStream; public IOStreamAddress(final InputStream inputStream, final OutputStream outputStream) {
this.outputStream = outputStream;
}
public InputStream getInputStream() { this.inputStream = inputStream;
return inputStream; this.outputStream = outputStream;
} }
public OutputStream getOutputStream() { public InputStream getInputStream() {
return outputStream; return inputStream;
} }
public OutputStream getOutputStream() {
return outputStream;
}
} }

View File

@ -15,59 +15,59 @@
*/ */
package org.jboss.netty.channel.iostream; package org.jboss.netty.channel.iostream;
import org.jboss.netty.channel.*; import org.jboss.netty.channel.*;
import java.net.SocketAddress; import java.net.SocketAddress;
/** /**
* A channel to an {@link java.io.InputStream} and an {@link java.io.OutputStream}. * A channel to an {@link java.io.InputStream} and an
* {@link java.io.OutputStream}.
* *
* @author Daniel Bimschas * @author Daniel Bimschas
* @author Dennis Pfisterer * @author Dennis Pfisterer
*/ */
public class IOStreamChannel extends AbstractChannel { public class IOStreamChannel extends AbstractChannel {
IOStreamChannel(final ChannelFactory factory, final ChannelPipeline pipeline, final ChannelSink sink) { IOStreamChannel(final ChannelFactory factory, final ChannelPipeline pipeline, final ChannelSink sink) {
super(null, factory, pipeline, sink); super(null, factory, pipeline, sink);
} }
@Override @Override
public ChannelConfig getConfig() { public ChannelConfig getConfig() {
return ((IOStreamChannelSink) getPipeline().getSink()).getConfig(); return ((IOStreamChannelSink) getPipeline().getSink()).getConfig();
} }
@Override @Override
public boolean isBound() { public boolean isBound() {
return ((IOStreamChannelSink) getPipeline().getSink()).isBound(); return ((IOStreamChannelSink) getPipeline().getSink()).isBound();
} }
@Override @Override
public boolean isConnected() { public boolean isConnected() {
return ((IOStreamChannelSink) getPipeline().getSink()).isConnected(); return ((IOStreamChannelSink) getPipeline().getSink()).isConnected();
} }
@Override @Override
public SocketAddress getLocalAddress() { public SocketAddress getLocalAddress() {
return null; return null;
} }
@Override @Override
public SocketAddress getRemoteAddress() { public SocketAddress getRemoteAddress() {
return ((IOStreamChannelSink) getPipeline().getSink()).getRemoteAddress(); return ((IOStreamChannelSink) getPipeline().getSink()).getRemoteAddress();
} }
@Override @Override
public ChannelFuture bind(final SocketAddress localAddress) { public ChannelFuture bind(final SocketAddress localAddress) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@Override @Override
public ChannelFuture unbind() { public ChannelFuture unbind() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
void doSetClosed() { void doSetClosed() {
setClosed(); setClosed();
} }
} }

View File

@ -26,153 +26,150 @@ import java.util.concurrent.ExecutorService;
import static org.jboss.netty.channel.Channels.*; import static org.jboss.netty.channel.Channels.*;
/** /**
* A {@link org.jboss.netty.channel.ChannelSink} implementation which reads from an {@link java.io.InputStream} and * A {@link org.jboss.netty.channel.ChannelSink} implementation which reads from
* writes to an {@link java.io.OutputStream}. * an {@link java.io.InputStream} and writes to an {@link java.io.OutputStream}.
* *
* @author Daniel Bimschas * @author Daniel Bimschas
* @author Dennis Pfisterer * @author Dennis Pfisterer
*/ */
public class IOStreamChannelSink extends AbstractChannelSink { public class IOStreamChannelSink extends AbstractChannelSink {
private static class ReadRunnable implements Runnable { private static class ReadRunnable implements Runnable {
private final IOStreamChannelSink channelSink; private final IOStreamChannelSink channelSink;
public ReadRunnable(final IOStreamChannelSink channelSink) { public ReadRunnable(final IOStreamChannelSink channelSink) {
this.channelSink = channelSink; this.channelSink = channelSink;
} }
@Override @Override
public void run() { public void run() {
PushbackInputStream in = channelSink.inputStream; PushbackInputStream in = channelSink.inputStream;
while (channelSink.channel.isOpen()) { while (channelSink.channel.isOpen()) {
byte[] buf; byte[] buf;
int readBytes; int readBytes;
try { try {
int bytesToRead = in.available(); int bytesToRead = in.available();
if (bytesToRead > 0) { if (bytesToRead > 0) {
buf = new byte[bytesToRead]; buf = new byte[bytesToRead];
readBytes = in.read(buf); readBytes = in.read(buf);
} else { } else {
// peek into the stream if it was closed (value=-1) // peek into the stream if it was closed (value=-1)
int b = in.read(); int b = in.read();
if (b < 0) { if (b < 0) {
break; break;
} }
// push back the byte which was read too much // push back the byte which was read too much
in.unread(b); in.unread(b);
continue; continue;
} }
} catch (Throwable t) { } catch (Throwable t) {
if (!channelSink.channel.getCloseFuture().isDone()) { if (!channelSink.channel.getCloseFuture().isDone()) {
fireExceptionCaught(channelSink.channel, t); fireExceptionCaught(channelSink.channel, t);
} }
break; break;
} }
fireMessageReceived(channelSink.channel, ChannelBuffers.wrappedBuffer(buf, 0, readBytes)); fireMessageReceived(channelSink.channel, ChannelBuffers.wrappedBuffer(buf, 0, readBytes));
} }
// Clean up. // Clean up.
close(channelSink.channel); close(channelSink.channel);
} }
} }
private final ExecutorService executorService; private final ExecutorService executorService;
private IOStreamChannel channel; private IOStreamChannel channel;
public IOStreamChannelSink(final ExecutorService executorService) { public IOStreamChannelSink(final ExecutorService executorService) {
this.executorService = executorService; this.executorService = executorService;
} }
public boolean isConnected() { public boolean isConnected() {
return inputStream != null && outputStream != null; return inputStream != null && outputStream != null;
} }
public IOStreamAddress getRemoteAddress() { public IOStreamAddress getRemoteAddress() {
return remoteAddress; return remoteAddress;
} }
public boolean isBound() { public boolean isBound() {
return false; return false;
} }
public ChannelConfig getConfig() { public ChannelConfig getConfig() {
return config; return config;
} }
public void setChannel(final IOStreamChannel channel) { public void setChannel(final IOStreamChannel channel) {
this.channel = channel; this.channel = channel;
} }
private IOStreamAddress remoteAddress; private IOStreamAddress remoteAddress;
private OutputStream outputStream; private OutputStream outputStream;
private PushbackInputStream inputStream; private PushbackInputStream inputStream;
private ChannelConfig config = new DefaultChannelConfig(); private final ChannelConfig config = new DefaultChannelConfig();
@Override @Override
public void eventSunk(final ChannelPipeline pipeline, final ChannelEvent e) throws Exception { public void eventSunk(final ChannelPipeline pipeline, final ChannelEvent e) throws Exception {
final ChannelFuture future = e.getFuture(); final ChannelFuture future = e.getFuture();
if (e instanceof ChannelStateEvent) { if (e instanceof ChannelStateEvent) {
final ChannelStateEvent stateEvent = (ChannelStateEvent) e; final ChannelStateEvent stateEvent = (ChannelStateEvent) e;
final ChannelState state = stateEvent.getState(); final ChannelState state = stateEvent.getState();
final Object value = stateEvent.getValue(); final Object value = stateEvent.getValue();
switch (state) { switch (state) {
case OPEN: case OPEN:
if (Boolean.FALSE.equals(value)) { if (Boolean.FALSE.equals(value)) {
outputStream = null; outputStream = null;
inputStream = null; inputStream = null;
((IOStreamChannel) e.getChannel()).doSetClosed(); ((IOStreamChannel) e.getChannel()).doSetClosed();
} }
break; break;
case BOUND: case BOUND:
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
case CONNECTED: case CONNECTED:
if (value != null) { if (value != null) {
remoteAddress = (IOStreamAddress) value; remoteAddress = (IOStreamAddress) value;
outputStream = remoteAddress.getOutputStream(); outputStream = remoteAddress.getOutputStream();
inputStream = new PushbackInputStream(remoteAddress.getInputStream()); inputStream = new PushbackInputStream(remoteAddress.getInputStream());
executorService.execute(new ReadRunnable(this)); executorService.execute(new ReadRunnable(this));
future.setSuccess(); future.setSuccess();
} }
break; break;
case INTEREST_OPS: case INTEREST_OPS:
// TODO implement // TODO implement
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
} else if (e instanceof MessageEvent) { } else if (e instanceof MessageEvent) {
final MessageEvent event = (MessageEvent) e; final MessageEvent event = (MessageEvent) e;
if (event.getMessage() instanceof ChannelBuffer) { if (event.getMessage() instanceof ChannelBuffer) {
final ChannelBuffer buffer = (ChannelBuffer) event.getMessage(); final ChannelBuffer buffer = (ChannelBuffer) event.getMessage();
buffer.readBytes(outputStream, buffer.readableBytes()); buffer.readBytes(outputStream, buffer.readableBytes());
outputStream.flush(); outputStream.flush();
future.setSuccess(); future.setSuccess();
} else { } else {
throw new IllegalArgumentException( throw new IllegalArgumentException("Only ChannelBuffer objects are supported to be written onto the IOStreamChannelSink! " + "Please check if the encoder pipeline is configured correctly.");
"Only ChannelBuffer objects are supported to be written onto the IOStreamChannelSink! " }
+ "Please check if the encoder pipeline is configured correctly." }
); }
}
}
}
} }

View File

@ -39,7 +39,6 @@ import org.jboss.netty.util.internal.ThreadLocalBoolean;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @version $Rev$, $Date$
*/ */
final class DefaultLocalChannel extends AbstractChannel implements LocalChannel { final class DefaultLocalChannel extends AbstractChannel implements LocalChannel {
@ -59,7 +58,16 @@ final class DefaultLocalChannel extends AbstractChannel implements LocalChannel
volatile LocalAddress localAddress; volatile LocalAddress localAddress;
volatile LocalAddress remoteAddress; volatile LocalAddress remoteAddress;
DefaultLocalChannel(LocalServerChannel parent, ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink, DefaultLocalChannel pairedChannel) { static DefaultLocalChannel create(LocalServerChannel parent,
ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink,
DefaultLocalChannel pairedChannel) {
DefaultLocalChannel instance = new DefaultLocalChannel(parent, factory, pipeline, sink,
pairedChannel);
fireChannelOpen(instance);
return instance;
}
private DefaultLocalChannel(LocalServerChannel parent, ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink, DefaultLocalChannel pairedChannel) {
super(parent, factory, pipeline, sink); super(parent, factory, pipeline, sink);
this.pairedChannel = pairedChannel; this.pairedChannel = pairedChannel;
config = new DefaultChannelConfig(); config = new DefaultChannelConfig();
@ -73,7 +81,6 @@ final class DefaultLocalChannel extends AbstractChannel implements LocalChannel
} }
}); });
fireChannelOpen(this);
} }
@Override @Override
@ -96,7 +103,7 @@ final class DefaultLocalChannel extends AbstractChannel implements LocalChannel
return state.get() == ST_CONNECTED; return state.get() == ST_CONNECTED;
} }
final void setBound() throws ClosedChannelException { void setBound() throws ClosedChannelException {
if (!state.compareAndSet(ST_OPEN, ST_BOUND)) { if (!state.compareAndSet(ST_OPEN, ST_BOUND)) {
switch (state.get()) { switch (state.get()) {
case ST_CLOSED: case ST_CLOSED:
@ -107,7 +114,7 @@ final class DefaultLocalChannel extends AbstractChannel implements LocalChannel
} }
} }
final void setConnected() { void setConnected() {
if (state.get() != ST_CLOSED) { if (state.get() != ST_CLOSED) {
state.set(ST_CONNECTED); state.set(ST_CONNECTED);
} }

View File

@ -24,7 +24,6 @@ import org.jboss.netty.channel.ChannelSink;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @version $Rev$, $Date$
* *
* @apiviz.landmark * @apiviz.landmark
*/ */
@ -41,7 +40,7 @@ public class DefaultLocalClientChannelFactory implements LocalClientChannelFacto
@Override @Override
public LocalChannel newChannel(ChannelPipeline pipeline) { public LocalChannel newChannel(ChannelPipeline pipeline) {
return new DefaultLocalChannel(null, this, pipeline, sink, null); return DefaultLocalChannel.create(null, this, pipeline, sink, null);
} }
/** /**

View File

@ -30,19 +30,28 @@ import org.jboss.netty.channel.DefaultServerChannelConfig;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @version $Rev$, $Date$
*/ */
final class DefaultLocalServerChannel extends AbstractServerChannel final class DefaultLocalServerChannel extends AbstractServerChannel implements
implements LocalServerChannel { LocalServerChannel {
final ChannelConfig channelConfig; final ChannelConfig channelConfig;
final AtomicBoolean bound = new AtomicBoolean(); final AtomicBoolean bound = new AtomicBoolean();
volatile LocalAddress localAddress; volatile LocalAddress localAddress;
DefaultLocalServerChannel(ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink) { static DefaultLocalServerChannel create(ChannelFactory factory,
ChannelPipeline pipeline, ChannelSink sink) {
DefaultLocalServerChannel instance =
new DefaultLocalServerChannel(factory, pipeline, sink);
fireChannelOpen(instance);
return instance;
}
private DefaultLocalServerChannel(ChannelFactory factory,
ChannelPipeline pipeline, ChannelSink sink) {
super(factory, pipeline, sink); super(factory, pipeline, sink);
channelConfig = new DefaultServerChannelConfig(); channelConfig = new DefaultServerChannelConfig();
fireChannelOpen(this);
} }
@Override @Override
@ -57,7 +66,7 @@ final class DefaultLocalServerChannel extends AbstractServerChannel
@Override @Override
public LocalAddress getLocalAddress() { public LocalAddress getLocalAddress() {
return isBound()? localAddress : null; return isBound() ? localAddress : null;
} }
@Override @Override

View File

@ -24,7 +24,6 @@ import org.jboss.netty.channel.ChannelSink;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @version $Rev$, $Date$
* *
* @apiviz.landmark * @apiviz.landmark
*/ */
@ -32,16 +31,9 @@ public class DefaultLocalServerChannelFactory implements LocalServerChannelFacto
private final ChannelSink sink = new LocalServerChannelSink(); private final ChannelSink sink = new LocalServerChannelSink();
/**
* Creates a new instance.
*/
public DefaultLocalServerChannelFactory() {
super();
}
@Override @Override
public LocalServerChannel newChannel(ChannelPipeline pipeline) { public LocalServerChannel newChannel(ChannelPipeline pipeline) {
return new DefaultLocalServerChannel(this, pipeline, sink); return DefaultLocalServerChannel.create(this, pipeline, sink);
} }
/** /**

View File

@ -31,7 +31,6 @@ import java.net.SocketAddress;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @version $Rev$, $Date$
* *
* @apiviz.landmark * @apiviz.landmark
*/ */
@ -115,7 +114,7 @@ public final class LocalAddress extends SocketAddress implements Comparable<Loca
} }
int a = System.identityHashCode(this); int a = System.identityHashCode(this);
int b = System.identityHashCode(this); int b = System.identityHashCode(o);
if (a < b) { if (a < b) {
return -1; return -1;
} else if (a > b) { } else if (a > b) {

View File

@ -23,7 +23,6 @@ import org.jboss.netty.channel.Channel;
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @version $Rev$, $Date$
*/ */
public interface LocalChannel extends Channel { public interface LocalChannel extends Channel {
@Override @Override

View File

@ -23,7 +23,6 @@ import org.jboss.netty.util.internal.ConcurrentHashMap;
/** /**
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @version $Rev$, $Date$
*/ */
final class LocalChannelRegistry { final class LocalChannelRegistry {

Some files were not shown because too many files have changed in this diff Show More