* APIviz tagging

* Added missing @version tags
This commit is contained in:
Trustin Lee 2008-12-03 09:00:29 +00:00
parent 748c169ee2
commit a30c36d8e2
25 changed files with 66 additions and 17 deletions

View File

@ -32,6 +32,9 @@ import org.jboss.netty.channel.Channel;
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Trustin Lee (tlee@redhat.com) * @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$ * @version $Rev$, $Date$
*
* @apiviz.landmark
* @apiviz.has org.jboss.netty.group.ChannelGroupFuture oneway - - returns
*/ */
public interface ChannelGroup extends Set<Channel>, Comparable<ChannelGroup> { public interface ChannelGroup extends Set<Channel>, Comparable<ChannelGroup> {
String getName(); String getName();

View File

@ -30,6 +30,9 @@ import java.util.concurrent.ConcurrentMap;
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Trustin Lee (tlee@redhat.com) * @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$ * @version $Rev$, $Date$
*
* @apiviz.landmark
* @apiviz.has org.jboss.netty.group.ChannelGroup oneway - - creates
*/ */
public class ChannelGroupFactory { public class ChannelGroupFactory {

View File

@ -32,6 +32,8 @@ import org.jboss.netty.channel.ChannelFuture;
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Trustin Lee (tlee@redhat.com) * @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$ * @version $Rev$, $Date$
*
* @apiviz.owns org.jboss.netty.group.ChannelGroupFutureListener - - notifies
*/ */
public interface ChannelGroupFuture extends Iterable<ChannelFuture>{ public interface ChannelGroupFuture extends Iterable<ChannelFuture>{

View File

@ -24,5 +24,8 @@
/** /**
* A global channel registry which helps a user maintain the list of open * A global channel registry which helps a user maintain the list of open
* channels and perform bulk operations on them. * channels and perform bulk operations on them.
*
* @apiviz.exclude ^java
* @apiviz.exclude \.(Abstract|Default).*$
*/ */
package org.jboss.netty.group; package org.jboss.netty.group;

View File

@ -26,6 +26,8 @@ package org.jboss.netty.handler.codec.embedder;
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Trustin Lee (tlee@redhat.com) * @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$ * @version $Rev$, $Date$
*
* @apiviz.exclude
*/ */
public class CodecEmbedderException extends RuntimeException { public class CodecEmbedderException extends RuntimeException {

View File

@ -37,6 +37,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com) * @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/ */
public class DefaultHttpMessage implements HttpMessage { public class DefaultHttpMessage implements HttpMessage {
private final static Comparator<String> caseIgnoringComparator = new CaseIgnoringComparator(); private final static Comparator<String> caseIgnoringComparator = new CaseIgnoringComparator();

View File

@ -28,6 +28,7 @@ package org.jboss.netty.handler.codec.http;
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com) * @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/ */
public class DefaultHttpRequest extends DefaultHttpMessage implements HttpRequest { public class DefaultHttpRequest extends DefaultHttpMessage implements HttpRequest {

View File

@ -27,6 +27,7 @@ package org.jboss.netty.handler.codec.http;
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com) * @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/ */
public class DefaultHttpResponse extends DefaultHttpMessage implements HttpResponse { public class DefaultHttpResponse extends DefaultHttpMessage implements HttpResponse {
private final HttpResponseStatus status; private final HttpResponseStatus status;

View File

@ -24,6 +24,7 @@ package org.jboss.netty.handler.codec.http;
/** /**
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @version $Rev$, $Date$
*/ */
class HttpCodecUtil { class HttpCodecUtil {
//space ' ' //space ' '

View File

@ -24,6 +24,7 @@ package org.jboss.netty.handler.codec.http;
/** /**
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @version $Rev$, $Date$
*/ */
public class HttpHeaders { public class HttpHeaders {
public static final String HOST = "Host"; public static final String HOST = "Host";
@ -43,6 +44,4 @@ public class HttpHeaders {
public static final String CHUNKED = "Chunked"; public static final String CHUNKED = "Chunked";
} }
} }

View File

@ -32,6 +32,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com) * @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/ */
public interface HttpMessage { public interface HttpMessage {
String getHeader(String name); String getHeader(String name);

View File

@ -37,8 +37,9 @@ import org.jboss.netty.handler.codec.replay.ReplayingDecoder;
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com) * @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/ */
public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDecoder.ResponseState> { public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDecoder.State> {
private static final Pattern INITIAL_PATTERN = Pattern.compile( private static final Pattern INITIAL_PATTERN = Pattern.compile(
"^\\s*(\\S+)\\s+(\\S+)\\s+(.*)\\s*$"); "^\\s*(\\S+)\\s+(\\S+)\\s+(.*)\\s*$");
@ -49,7 +50,14 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDec
private ChannelBuffer content; private ChannelBuffer content;
private int chunkSize; private int chunkSize;
public enum ResponseState { /**
* @author The Netty Project (netty-dev@lists.jboss.org)
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*
* @apiviz.exclude
*/
protected enum State {
READ_INITIAL, READ_INITIAL,
READ_HEADER, READ_HEADER,
READ_CONTENT, READ_CONTENT,
@ -59,14 +67,14 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDec
READ_CRLF,; READ_CRLF,;
} }
private ResponseState nextState; private State nextState;
protected HttpMessageDecoder() { protected HttpMessageDecoder() {
super(ResponseState.READ_INITIAL); super(State.READ_INITIAL);
} }
@Override @Override
protected Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer, ResponseState state) throws Exception { protected Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer, State state) throws Exception {
switch (state) { switch (state) {
case READ_INITIAL: { case READ_INITIAL: {
readInitial(buffer); readInitial(buffer);
@ -111,7 +119,7 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDec
return reset(); return reset();
} }
else { else {
checkpoint(ResponseState.READ_CHUNKED_CONTENT); checkpoint(State.READ_CHUNKED_CONTENT);
} }
} }
case READ_CHUNKED_CONTENT: { case READ_CHUNKED_CONTENT: {
@ -136,7 +144,7 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDec
message.setContent(content); message.setContent(content);
content = null; content = null;
nextState = null; nextState = null;
checkpoint(ResponseState.READ_INITIAL); checkpoint(State.READ_INITIAL);
return message; return message;
} }
@ -145,8 +153,8 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDec
content = ChannelBuffers.dynamicBuffer(chunkSize); content = ChannelBuffers.dynamicBuffer(chunkSize);
} }
content.writeBytes(buffer, chunkSize); content.writeBytes(buffer, chunkSize);
nextState = ResponseState.READ_CHUNK_SIZE; nextState = State.READ_CHUNK_SIZE;
checkpoint(ResponseState.READ_CRLF); checkpoint(State.READ_CRLF);
} }
private void readFixedLengthContent(ChannelBuffer buffer) { private void readFixedLengthContent(ChannelBuffer buffer) {
@ -183,15 +191,15 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDec
System.out.println(n + ": " + v); System.out.println(n + ": " + v);
} }
} }
ResponseState nextState; State nextState;
if (message.getContentLength() >= 0) { if (message.getContentLength() >= 0) {
nextState = ResponseState.READ_FIXED_LENGTH_CONTENT; nextState = State.READ_FIXED_LENGTH_CONTENT;
} }
else if (message.isChunked()) { else if (message.isChunked()) {
nextState = ResponseState.READ_CHUNK_SIZE; nextState = State.READ_CHUNK_SIZE;
} }
else { else {
nextState = ResponseState.READ_CONTENT; nextState = State.READ_CONTENT;
} }
checkpoint(nextState); checkpoint(nextState);
} }

View File

@ -40,6 +40,7 @@ import org.jboss.netty.channel.SimpleChannelHandler;
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com) * @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/ */
@ChannelPipelineCoverage("one") @ChannelPipelineCoverage("one")
public abstract class HttpMessageEncoder extends SimpleChannelHandler { public abstract class HttpMessageEncoder extends SimpleChannelHandler {

View File

@ -26,6 +26,9 @@ package org.jboss.netty.handler.codec.http;
* *
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @version $Rev$, $Date$
*
* @apiviz.exclude
*/ */
public enum HttpMethod { public enum HttpMethod {
/** /**

View File

@ -27,6 +27,10 @@ package org.jboss.netty.handler.codec.http;
* *
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @version $Rev$, $Date$
*
* @see QueryStringEncoder
* @see QueryStringDecoder
*/ */
public interface HttpRequest extends HttpMessage { public interface HttpRequest extends HttpMessage {

View File

@ -29,13 +29,14 @@ import org.jboss.netty.buffer.ChannelBuffer;
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com) * @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/ */
public class HttpRequestDecoder extends HttpMessageDecoder { public class HttpRequestDecoder extends HttpMessageDecoder {
@Override @Override
protected void readInitial(ChannelBuffer buffer) throws Exception{ protected void readInitial(ChannelBuffer buffer) throws Exception{
String line = readIntoCurrentLine(buffer); String line = readIntoCurrentLine(buffer);
checkpoint(ResponseState.READ_HEADER); checkpoint(State.READ_HEADER);
String[] split = splitInitial(line); String[] split = splitInitial(line);
message = new DefaultHttpRequest( message = new DefaultHttpRequest(
HttpVersion.decode(split[2]), HttpMethod.valueOf(split[0]), split[1]); HttpVersion.decode(split[2]), HttpMethod.valueOf(split[0]), split[1]);

View File

@ -31,6 +31,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com) * @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/ */
public class HttpRequestEncoder extends HttpMessageEncoder { public class HttpRequestEncoder extends HttpMessageEncoder {

View File

@ -28,6 +28,7 @@ package org.jboss.netty.handler.codec.http;
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com) * @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/ */
public interface HttpResponse extends HttpMessage { public interface HttpResponse extends HttpMessage {
HttpResponseStatus getStatus(); HttpResponseStatus getStatus();

View File

@ -29,12 +29,13 @@ import org.jboss.netty.buffer.ChannelBuffer;
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com) * @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/ */
public class HttpResponseDecoder extends HttpMessageDecoder { public class HttpResponseDecoder extends HttpMessageDecoder {
@Override @Override
protected void readInitial(ChannelBuffer buffer) { protected void readInitial(ChannelBuffer buffer) {
String line = readIntoCurrentLine(buffer); String line = readIntoCurrentLine(buffer);
checkpoint(ResponseState.READ_HEADER); checkpoint(State.READ_HEADER);
String[] split = splitInitial(line); String[] split = splitInitial(line);
message = new DefaultHttpResponse(HttpVersion.decode(split[0]), new HttpResponseStatus(Integer.valueOf(split[1]), split[2])); message = new DefaultHttpResponse(HttpVersion.decode(split[0]), new HttpResponseStatus(Integer.valueOf(split[1]), split[2]));
} }

View File

@ -31,6 +31,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com) * @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/ */
public class HttpResponseEncoder extends HttpMessageEncoder { public class HttpResponseEncoder extends HttpMessageEncoder {
@Override @Override

View File

@ -28,6 +28,9 @@ package org.jboss.netty.handler.codec.http;
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com) * @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*
* @apiviz.exclude
*/ */
public class HttpResponseStatus { public class HttpResponseStatus {

View File

@ -27,6 +27,9 @@ package org.jboss.netty.handler.codec.http;
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com) * @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*
* @apiviz.exclude
*/ */
public enum HttpVersion { public enum HttpVersion {
HTTP_1_0("HTTP/1.0"), HTTP_1_0("HTTP/1.0"),

View File

@ -30,6 +30,7 @@ import java.util.Map;
/** /**
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @version $Rev$, $Date$
*/ */
public class QueryStringDecoder { public class QueryStringDecoder {

View File

@ -29,6 +29,7 @@ import java.util.List;
/** /**
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org) * @author Andy Taylor (andy.taylor@jboss.org)
* @version $Rev$, $Date$
*/ */
public class QueryStringEncoder { public class QueryStringEncoder {

View File

@ -23,5 +23,8 @@
/** /**
* Encoder, decoder and their related message types for HTTP. * Encoder, decoder and their related message types for HTTP.
*
* @apiviz.exclude \.HttpHeaders.*$
* @apiviz.exclude \.QueryString.*$
*/ */
package org.jboss.netty.handler.codec.http; package org.jboss.netty.handler.codec.http;