P
- type of ParameterProvider's parameterpublic class CachingImageStreamer<P> extends Object implements ImageStreamer<P>
Constructor and Description |
---|
CachingImageStreamer(info.magnolia.cms.core.HierarchyManager hm,
CachingStrategy<P> cachingStrategy,
ImageStreamer<P> delegate) |
Modifier and Type | Method and Description |
---|---|
protected info.magnolia.cms.core.NodeData |
fetchFromCache(ImageGenerator<ParameterProvider<P>> generator,
ParameterProvider<P> parameterProvider)
Gets the binary property (NodeData) for the appropriate image, ready to be served,
or null if the image should be regenerated.
|
protected info.magnolia.cms.core.NodeData |
generateAndStore(ImageGenerator<ParameterProvider<P>> generator,
ParameterProvider<P> parameterProvider) |
protected void |
serve(info.magnolia.cms.core.NodeData binary,
OutputStream out) |
void |
serveImage(ImageGenerator<ParameterProvider<P>> generator,
ParameterProvider<P> params,
OutputStream out)
Generates an image (if deemed necessary) with the given ImageGenerator and Parameters, streams it to
the given OutputStream.
|
public CachingImageStreamer(info.magnolia.cms.core.HierarchyManager hm, CachingStrategy<P> cachingStrategy, ImageStreamer<P> delegate)
public void serveImage(ImageGenerator<ParameterProvider<P>> generator, ParameterProvider<P> params, OutputStream out) throws IOException, ImagingException
ImageStreamer
serveImage
in interface ImageStreamer<P>
IOException
ImagingException
protected info.magnolia.cms.core.NodeData fetchFromCache(ImageGenerator<ParameterProvider<P>> generator, ParameterProvider<P> parameterProvider)
protected void serve(info.magnolia.cms.core.NodeData binary, OutputStream out) throws IOException
IOException
protected info.magnolia.cms.core.NodeData generateAndStore(ImageGenerator<ParameterProvider<P>> generator, ParameterProvider<P> parameterProvider) throws IOException, ImagingException
IOException
ImagingException
Copyright © 2016 Magnolia International Ltd.. All rights reserved.