Removed unnecessary volatiles from the examples
This commit is contained in:
parent
a462d0e85e
commit
0066f9c3ff
@ -53,8 +53,8 @@ import org.jboss.netty.util.CharsetUtil;
|
||||
*/
|
||||
public class HttpRequestHandler extends SimpleChannelUpstreamHandler {
|
||||
|
||||
private volatile HttpRequest request;
|
||||
private volatile boolean readingChunks;
|
||||
private HttpRequest request;
|
||||
private boolean readingChunks;
|
||||
/** Buffer that stores the response content */
|
||||
private final StringBuilder buf = new StringBuilder();
|
||||
|
||||
|
@ -32,7 +32,7 @@ import org.jboss.netty.util.CharsetUtil;
|
||||
*/
|
||||
public class HttpResponseHandler extends SimpleChannelUpstreamHandler {
|
||||
|
||||
private volatile boolean readingChunks;
|
||||
private boolean readingChunks;
|
||||
|
||||
@Override
|
||||
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
|
||||
|
@ -49,7 +49,7 @@ public class LocalTimeClientHandler extends SimpleChannelUpstreamHandler {
|
||||
LocalTimeClientHandler.class.getName());
|
||||
|
||||
// Stateful properties
|
||||
private volatile Channel channel;
|
||||
private Channel channel;
|
||||
private final BlockingQueue<LocalTimes> answer = new LinkedBlockingQueue<LocalTimes>();
|
||||
|
||||
public List<String> getLocalTimes(Collection<String> cities) {
|
||||
@ -106,10 +106,10 @@ public class LocalTimeClientHandler extends SimpleChannelUpstreamHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e)
|
||||
public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e)
|
||||
throws Exception {
|
||||
channel = e.getChannel();
|
||||
super.channelOpen(ctx, e);
|
||||
super.channelConnected(ctx, e);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -41,7 +41,7 @@ public class UptimeClientHandler extends SimpleChannelUpstreamHandler {
|
||||
|
||||
final ClientBootstrap bootstrap;
|
||||
private final Timer timer;
|
||||
private volatile long startTime = -1;
|
||||
private long startTime = -1;
|
||||
|
||||
public UptimeClientHandler(ClientBootstrap bootstrap, Timer timer) {
|
||||
this.bootstrap = bootstrap;
|
||||
|
Loading…
x
Reference in New Issue
Block a user