Skip to content

Commit

Permalink
Initial rough pass at Netty 4 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
oxtoacart committed Aug 7, 2013
1 parent 5067718 commit 64bf1d5
Show file tree
Hide file tree
Showing 52 changed files with 733 additions and 689 deletions.
20 changes: 11 additions & 9 deletions Netty_4_Upgrade_Notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@ http://docs.jboss.org/netty/3.2/api/

Relevant Changes
----------------
1. ServerBootstrap no longer takes a ServerSocketChannelFactory in its constructor. We used to use this to configure the thread pools. Looks like EventLoopGroup or its relatives are the place to look.
* ServerBootstrap no longer takes a ServerSocketChannelFactory in its constructor. We used to use this to configure the thread pools. Looks like EventLoopGroup or its relatives are the place to look.

2. Same thing as #1 is true for ClientSocketChannelFactory.
* Same thing as #1 is true for ClientSocketChannelFactory.

3. ChannelPipelineFactory is gone. Looks like one uses .childHandler() with a ChannelInitializer instead.
* ChannelPipelineFactory is gone. Looks like one uses .childHandler() with a ChannelInitializer instead.

4. What's up with ThreadRenamingRunnable in DefaultHttpProxyServer?
* What's up with ThreadRenamingRunnable in DefaultHttpProxyServer?

5. DefaultChannelGroup?
* DefaultChannelGroup?

6. SimpleChannelUpstreamHandler -> SimpleChanneInboundHandler
* SimpleChannelUpstreamHandler -> SimpleChanneInboundHandler

7. InterestOps is gone - what does this mean to setReadable() and channelInterestChanged() ?
* InterestOps is gone - what does this mean to setReadable() and channelInterestChanged() ?

8. channelOpened() -> channelRegistered() ?
* channelOpened() -> channelRegistered() ?

9. channelClosed() -> channelDeregistered() ?
* channelClosed() -> channelDeregistered() ?

* IdleStateHandler no longer users Timer
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
<version>3.6.5.Final</version>
<artifactId>netty-all</artifactId>
<version>4.0.6.Final</version>
<scope>compile</scope>
</dependency>

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/littleshoot/proxy/CachedHttpChunks.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.littleshoot.proxy;

import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.handler.codec.http.HttpChunk;
import io.netty.buffer.ChannelBuffer;
import io.netty.channel.Channel;
import io.netty.handler.codec.http.HttpChunk;

/**
* Interface for classes that fetch HTTP chunks from a cache. This is tricky
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/littleshoot/proxy/CachedHttpResponse.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.littleshoot.proxy;

import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.ChannelFutureListener;
import io.netty.buffer.ChannelBuffer;
import io.netty.channel.ChannelFutureListener;

/**
* HTTP response object stored in the cache.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/littleshoot/proxy/ChainProxyManager.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.littleshoot.proxy;

import org.jboss.netty.handler.codec.http.HttpRequest;
import io.netty.handler.codec.http.HttpRequest;

/**
* Interface for classes that manage chain proxies.
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/littleshoot/proxy/DefaultCachedHttpChunks.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.littleshoot.proxy;

import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelFutureListener;
import org.jboss.netty.handler.codec.http.HttpChunk;
import org.jboss.netty.handler.codec.http.HttpRequest;
import io.netty.buffer.ChannelBuffer;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.handler.codec.http.HttpChunk;
import io.netty.handler.codec.http.HttpRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.littleshoot.proxy;

import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.ChannelFutureListener;
import io.netty.buffer.ChannelBuffer;
import io.netty.channel.ChannelFutureListener;

/**
* Default implementation for storing HTTP response data in the cache.
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/littleshoot/proxy/DefaultHttpFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import java.util.Arrays;
import java.util.Collection;

import org.jboss.netty.handler.codec.http.HttpRequest;
import org.jboss.netty.handler.codec.http.HttpResponse;
import io.netty.handler.codec.http.HttpRequest;
import io.netty.handler.codec.http.HttpResponse;

/**
* Default implementation of a class for processing HTTP request rules.
Expand Down
Loading

0 comments on commit 64bf1d5

Please sign in to comment.