rabbit.handler
Class JavaImageHandler
java.lang.Object
rabbit.handler.BaseHandler
rabbit.handler.ImageHandlerBase
rabbit.handler.JavaImageHandler
- All Implemented Interfaces:
- Handler, HandlerFactory, AsyncListener, BlockListener, BlockSentListener, HttpHeaderSentListener
public class JavaImageHandler
- extends ImageHandlerBase
This image handler uses standard java imageio to convert images
into low quality jpegs.
- Author:
- Robert Olofsson
Fields inherited from class rabbit.handler.BaseHandler |
cacheChannel, clientHandle, con, content, entry, mayCache, mayFilter, request, response, size, tlh, totalRead |
Constructor Summary |
JavaImageHandler()
For creating the factory. |
JavaImageHandler(Connection con,
TrafficLoggerHandler tlh,
HttpHeader request,
BufferHandle clientHandle,
HttpHeader response,
ResourceSource content,
boolean mayCache,
boolean mayFilter,
long size,
SProperties config,
boolean doConvert,
int minSizeToConvert,
long maxImageSize)
Create a new ImageHandler for the given request. |
Methods inherited from class rabbit.handler.ImageHandlerBase |
addCache, changesContentSize, checkFileType, closeStreams, convertImage, finish, getConfig, getDoConvert, getMinSizeToConvert, handle, mayCacheFromSize, mayRestrictCacheSize, readImage, removeCache, setDoConvert, tryconvert |
Methods inherited from class rabbit.handler.BaseHandler |
blockSent, bufferRead, deleteFile, failed, finishData, finishedRead, getLogger, httpHeaderSent, mayTransfer, prepare, prepareStream, send, sendHeader, setPartialContent, timeout, writeCache |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JavaImageHandler
public JavaImageHandler()
- For creating the factory.
JavaImageHandler
public JavaImageHandler(Connection con,
TrafficLoggerHandler tlh,
HttpHeader request,
BufferHandle clientHandle,
HttpHeader response,
ResourceSource content,
boolean mayCache,
boolean mayFilter,
long size,
SProperties config,
boolean doConvert,
int minSizeToConvert,
long maxImageSize)
- Create a new ImageHandler for the given request.
- Parameters:
con
- the Connection handling the request.request
- the actual request made.clientHandle
- the client side buffer.response
- the actual response.content
- the resource.mayCache
- May we cache this request?mayFilter
- May we filter this request?size
- the size of the data beeing handled.
getNewInstance
public Handler getNewInstance(Connection con,
TrafficLoggerHandler tlh,
HttpHeader header,
BufferHandle bufHandle,
HttpHeader webHeader,
ResourceSource content,
boolean mayCache,
boolean mayFilter,
long size)
- Description copied from interface:
HandlerFactory
- Get a new Handler for the given request made.
- Specified by:
getNewInstance
in interface HandlerFactory
- Overrides:
getNewInstance
in class BaseHandler
- Parameters:
con
- the Connection handling the request.tlh
- the Traffic logger handler.header
- the request.bufHandle
- the client side buffer handle (may contain the next request).webHeader
- the response.content
- the resource.mayCache
- if the handler may cache the response.mayFilter
- if the handler may filter the response.size
- the Size of the data beeing handled (-1 = unknown length).
internalConvertImage
protected ImageHandlerBase.ImageConversionResult internalConvertImage(String entryName)
throws IOException
- Description copied from class:
ImageHandlerBase
- Perform the actual image conversion.
- Specified by:
internalConvertImage
in class ImageHandlerBase
- Parameters:
entryName
- the filename of the cache entry to use.
- Throws:
IOException
setup
public void setup(SProperties prop)
- Description copied from interface:
HandlerFactory
- setup the handler factory.
- Specified by:
setup
in interface HandlerFactory
- Overrides:
setup
in class ImageHandlerBase