* 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 Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*
* @apiviz.landmark
* @apiviz.has org.jboss.netty.group.ChannelGroupFuture oneway - - returns
*/
public interface ChannelGroup extends Set<Channel>, Comparable<ChannelGroup> {
String getName();

View File

@ -30,6 +30,9 @@ import java.util.concurrent.ConcurrentMap;
* @author The Netty Project (netty-dev@lists.jboss.org)
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*
* @apiviz.landmark
* @apiviz.has org.jboss.netty.group.ChannelGroup oneway - - creates
*/
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 Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*
* @apiviz.owns org.jboss.netty.group.ChannelGroupFutureListener - - notifies
*/
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
* channels and perform bulk operations on them.
*
* @apiviz.exclude ^java
* @apiviz.exclude \.(Abstract|Default).*$
*/
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 Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*
* @apiviz.exclude
*/
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 Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/
public class DefaultHttpMessage implements HttpMessage {
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 Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/
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 Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/
public class DefaultHttpResponse extends DefaultHttpMessage implements HttpResponse {
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 Andy Taylor (andy.taylor@jboss.org)
* @version $Rev$, $Date$
*/
class HttpCodecUtil {
//space ' '

View File

@ -24,6 +24,7 @@ package org.jboss.netty.handler.codec.http;
/**
* @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org)
* @version $Rev$, $Date$
*/
public class HttpHeaders {
public static final String HOST = "Host";
@ -43,6 +44,4 @@ public class HttpHeaders {
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 Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/
public interface HttpMessage {
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 Andy Taylor (andy.taylor@jboss.org)
* @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(
"^\\s*(\\S+)\\s+(\\S+)\\s+(.*)\\s*$");
@ -49,7 +50,14 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDec
private ChannelBuffer content;
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_HEADER,
READ_CONTENT,
@ -59,14 +67,14 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDec
READ_CRLF,;
}
private ResponseState nextState;
private State nextState;
protected HttpMessageDecoder() {
super(ResponseState.READ_INITIAL);
super(State.READ_INITIAL);
}
@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) {
case READ_INITIAL: {
readInitial(buffer);
@ -111,7 +119,7 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDec
return reset();
}
else {
checkpoint(ResponseState.READ_CHUNKED_CONTENT);
checkpoint(State.READ_CHUNKED_CONTENT);
}
}
case READ_CHUNKED_CONTENT: {
@ -136,7 +144,7 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDec
message.setContent(content);
content = null;
nextState = null;
checkpoint(ResponseState.READ_INITIAL);
checkpoint(State.READ_INITIAL);
return message;
}
@ -145,8 +153,8 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDec
content = ChannelBuffers.dynamicBuffer(chunkSize);
}
content.writeBytes(buffer, chunkSize);
nextState = ResponseState.READ_CHUNK_SIZE;
checkpoint(ResponseState.READ_CRLF);
nextState = State.READ_CHUNK_SIZE;
checkpoint(State.READ_CRLF);
}
private void readFixedLengthContent(ChannelBuffer buffer) {
@ -183,15 +191,15 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDec
System.out.println(n + ": " + v);
}
}
ResponseState nextState;
State nextState;
if (message.getContentLength() >= 0) {
nextState = ResponseState.READ_FIXED_LENGTH_CONTENT;
nextState = State.READ_FIXED_LENGTH_CONTENT;
}
else if (message.isChunked()) {
nextState = ResponseState.READ_CHUNK_SIZE;
nextState = State.READ_CHUNK_SIZE;
}
else {
nextState = ResponseState.READ_CONTENT;
nextState = State.READ_CONTENT;
}
checkpoint(nextState);
}

View File

@ -40,6 +40,7 @@ import org.jboss.netty.channel.SimpleChannelHandler;
* @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/
@ChannelPipelineCoverage("one")
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 Andy Taylor (andy.taylor@jboss.org)
* @version $Rev$, $Date$
*
* @apiviz.exclude
*/
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 Andy Taylor (andy.taylor@jboss.org)
* @version $Rev$, $Date$
*
* @see QueryStringEncoder
* @see QueryStringDecoder
*/
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 Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/
public class HttpRequestDecoder extends HttpMessageDecoder {
@Override
protected void readInitial(ChannelBuffer buffer) throws Exception{
String line = readIntoCurrentLine(buffer);
checkpoint(ResponseState.READ_HEADER);
checkpoint(State.READ_HEADER);
String[] split = splitInitial(line);
message = new DefaultHttpRequest(
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 Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/
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 Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/
public interface HttpResponse extends HttpMessage {
HttpResponseStatus getStatus();

View File

@ -29,12 +29,13 @@ import org.jboss.netty.buffer.ChannelBuffer;
* @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/
public class HttpResponseDecoder extends HttpMessageDecoder {
@Override
protected void readInitial(ChannelBuffer buffer) {
String line = readIntoCurrentLine(buffer);
checkpoint(ResponseState.READ_HEADER);
checkpoint(State.READ_HEADER);
String[] split = splitInitial(line);
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 Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/
public class HttpResponseEncoder extends HttpMessageEncoder {
@Override

View File

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

View File

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

View File

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