org.atmosphere.nettosphere
Class ChannelWriter

java.lang.Object
  extended by org.atmosphere.cpr.AsyncIOWriterAdapter
      extended by org.atmosphere.cpr.AtmosphereInterceptorWriter
          extended by org.atmosphere.nettosphere.ChannelWriter
All Implemented Interfaces:
org.atmosphere.cpr.AsyncIOWriter
Direct Known Subclasses:
ChunkedWriter, StreamWriter

public abstract class ChannelWriter
extends org.atmosphere.cpr.AtmosphereInterceptorWriter


Field Summary
protected  org.jboss.netty.channel.Channel channel
           
protected static byte[] CHUNK_DELIMITER
           
protected  AtomicBoolean doneProcessing
           
protected static String END
           
protected static byte[] ENDCHUNK
           
protected  boolean keepAlive
           
protected  long lastWrite
           
protected static org.slf4j.Logger logger
           
protected  org.atmosphere.util.ByteArrayAsyncWriter transformCacheBuffer
           
protected  boolean writeHeader
           
 
Fields inherited from class org.atmosphere.cpr.AtmosphereInterceptorWriter
filters, reversedFilters
 
Constructor Summary
ChannelWriter(org.jboss.netty.channel.Channel channel, boolean writeHeader, boolean keepAlive)
           
 
Method Summary
abstract  org.atmosphere.cpr.AsyncIOWriter asyncWrite(org.atmosphere.cpr.AtmosphereResponse response, byte[] data, int offset, int length)
           
protected  String constructStatusAndHeaders(org.atmosphere.cpr.AtmosphereResponse response, int contentLength)
           
 boolean isClosed()
           
 long lastTick()
           
protected  byte[] transform(org.atmosphere.cpr.AtmosphereResponse response, byte[] b, int offset, int length)
           
 org.atmosphere.cpr.AsyncIOWriter write(org.atmosphere.cpr.AtmosphereResponse response, byte[] data)
           
 org.atmosphere.cpr.AsyncIOWriter write(org.atmosphere.cpr.AtmosphereResponse response, byte[] data, int offset, int length)
           
 org.atmosphere.cpr.AsyncIOWriter write(org.atmosphere.cpr.AtmosphereResponse response, String data)
           
 org.atmosphere.cpr.AsyncIOWriter writeError(org.atmosphere.cpr.AtmosphereResponse response, int errorCode, String message)
           
 
Methods inherited from class org.atmosphere.cpr.AtmosphereInterceptorWriter
close, filters, flush, interceptor, invokeInterceptor, redirect, writeReady
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.slf4j.Logger logger

END

protected static final String END

CHUNK_DELIMITER

protected static final byte[] CHUNK_DELIMITER

ENDCHUNK

protected static final byte[] ENDCHUNK

channel

protected final org.jboss.netty.channel.Channel channel

doneProcessing

protected final AtomicBoolean doneProcessing

transformCacheBuffer

protected final org.atmosphere.util.ByteArrayAsyncWriter transformCacheBuffer

writeHeader

protected final boolean writeHeader

lastWrite

protected long lastWrite

keepAlive

protected boolean keepAlive
Constructor Detail

ChannelWriter

public ChannelWriter(org.jboss.netty.channel.Channel channel,
                     boolean writeHeader,
                     boolean keepAlive)
Method Detail

isClosed

public boolean isClosed()

writeError

public org.atmosphere.cpr.AsyncIOWriter writeError(org.atmosphere.cpr.AtmosphereResponse response,
                                                   int errorCode,
                                                   String message)
                                            throws IOException
Specified by:
writeError in interface org.atmosphere.cpr.AsyncIOWriter
Overrides:
writeError in class org.atmosphere.cpr.AtmosphereInterceptorWriter
Throws:
IOException

write

public org.atmosphere.cpr.AsyncIOWriter write(org.atmosphere.cpr.AtmosphereResponse response,
                                              String data)
                                       throws IOException
Specified by:
write in interface org.atmosphere.cpr.AsyncIOWriter
Overrides:
write in class org.atmosphere.cpr.AtmosphereInterceptorWriter
Throws:
IOException

write

public org.atmosphere.cpr.AsyncIOWriter write(org.atmosphere.cpr.AtmosphereResponse response,
                                              byte[] data)
                                       throws IOException
Specified by:
write in interface org.atmosphere.cpr.AsyncIOWriter
Overrides:
write in class org.atmosphere.cpr.AtmosphereInterceptorWriter
Throws:
IOException

transform

protected byte[] transform(org.atmosphere.cpr.AtmosphereResponse response,
                           byte[] b,
                           int offset,
                           int length)
                    throws IOException
Throws:
IOException

write

public org.atmosphere.cpr.AsyncIOWriter write(org.atmosphere.cpr.AtmosphereResponse response,
                                              byte[] data,
                                              int offset,
                                              int length)
                                       throws IOException
Specified by:
write in interface org.atmosphere.cpr.AsyncIOWriter
Overrides:
write in class org.atmosphere.cpr.AtmosphereInterceptorWriter
Throws:
IOException

lastTick

public long lastTick()

constructStatusAndHeaders

protected String constructStatusAndHeaders(org.atmosphere.cpr.AtmosphereResponse response,
                                           int contentLength)

asyncWrite

public abstract org.atmosphere.cpr.AsyncIOWriter asyncWrite(org.atmosphere.cpr.AtmosphereResponse response,
                                                            byte[] data,
                                                            int offset,
                                                            int length)
                                                     throws IOException
Throws:
IOException


Copyright © 2014. All Rights Reserved.