org.apache.myfaces.trinidadinternal.image.cache
Class FileSystemImageCache

java.lang.Object
  extended by org.apache.myfaces.trinidadinternal.image.cache.FileSystemImageCache
All Implemented Interfaces:
ImageConstants, ImageProvider

public class FileSystemImageCache
extends java.lang.Object
implements ImageProvider, ImageConstants

FileSystemImageCache is an ImageProvider implementation which caches images on the file system. Since the FileSystemImageCache are fairly expensive objects to create, FileSystemImageCache instances are shared across applications in the same VM. Clients can access the shared FileSystemImageCache instance for a particular file system cache location via the getSharedCache method.

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/image/cache/FileSystemImageCache.java#0 $) $Date: 10-nov-2005.19:06:06 $
Author:
The Oracle ADF Faces Team
See Also:
ImageProvider

Field Summary
static java.lang.String BLOCK_IMAGE_GENERATION
           
 
Fields inherited from interface org.apache.myfaces.trinidadinternal.image.ImageConstants
ACCESS_KEY_KEY, BACKGROUND_KEY, BORDER_COLOR_KEY, BUTTON_BOTTOM_BACKGROUND_ICON_KEY, BUTTON_END_ICON_KEY, BUTTON_START_ICON_KEY, BUTTON_TOP_BACKGROUND_ICON_KEY, COLORIZED_ICON_NAME, COMPOSITE_BUTTON_NAME, DARK_ACCENT_COLOR_KEY, DARK_COLOR_KEY, DIRECTION_KEY, DISABLED_BACKGROUND_KEY, DISABLED_FONT_KEY, DISABLED_FOREGROUND_KEY, DISABLED_KEY, ENCODING_TYPE_KEY, END_ROUNDED_KEY, FLIPPED_ICON_NAME, FONT_KEY, FOREGROUND_KEY, HEIGHT_RESPONSE_KEY, IMAGE_MAP_AREAS_RESPONSE_KEY, IMAGE_PROVIDER_PROPERTY, LAF_KEY, LOOK_AND_FEEL_ID_KEY, NAME_KEY, SELECTED_BACKGROUND_KEY, SELECTED_FONT_KEY, SELECTED_FOREGROUND_KEY, SELECTED_KEY, SOURCE_INPUT_STREAM_PROVIDER_KEY, SOURCE_KEY, START_ROUNDED_KEY, SURROUNDING_COLOR_KEY, TABS_KEY, TECATE_NAMESPACE, TEXT_ANTIALIAS_KEY, TEXT_KEY, VERSION_KEY, WIDTH_RESPONSE_KEY
 
Constructor Summary
protected FileSystemImageCache(java.lang.String realPath)
          Creates a FileSystemImageCache.
 
Method Summary
 ImageProviderResponse getImage(ImageContext context, ImageProviderRequest request)
          Implementation of ImageCache.getImage().
static ImageProvider getSharedCache(java.lang.String realPath)
          Returns a shared cache instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLOCK_IMAGE_GENERATION

public static final java.lang.String BLOCK_IMAGE_GENERATION
See Also:
Constant Field Values
Constructor Detail

FileSystemImageCache

protected FileSystemImageCache(java.lang.String realPath)
Creates a FileSystemImageCache. Clients should use getSharedCache() to obtain FileSystemImageCache instances.

Parameters:
realPath - The real path of the root directory of the cache. If the specified path does not exist and can not be created, and IllegalArgumentException is thrown.
Method Detail

getSharedCache

public static ImageProvider getSharedCache(java.lang.String realPath)
Returns a shared cache instance.

Parameters:
realPath - The real path of the root directory of the cache. If the specified path does not exist and can not be created, and IllegalArgumentException is thrown.
Returns:
Returns an ImageProvider instance which can be used to obtain cached images.

getImage

public ImageProviderResponse getImage(ImageContext context,
                                      ImageProviderRequest request)
Implementation of ImageCache.getImage().

Specified by:
getImage in interface ImageProvider
Parameters:
context - The context object
request - The request object is used to accesss the properties of the requested image.
Returns:
Returns an ImageProviderResponse object which indicates the location of the image, among other information.
See Also:
ImageProvider.getImage(org.apache.myfaces.trinidadinternal.image.ImageContext, org.apache.myfaces.trinidadinternal.image.ImageProviderRequest)


Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.