public class PictureTilingComponent extends DefaultComponent implements PictureTilingService
Modifier and Type | Field and Description |
---|---|
static String |
BLOB_PROPERTY_EP |
protected Map<String,String> |
blobProperties |
protected static Map<String,PictureTilingCacheInfo> |
cache |
protected static PictureTiler |
defaultTiler |
static String |
ENV_PARAMETERS_EP |
protected static Map<String,String> |
envParameters |
protected static Thread |
gcThread |
static String |
IMAGES_TO_CONVERT_EP |
protected List<ImageToConvertDescriptor> |
imagesToConvert |
protected static List<String> |
inprocessTiles |
lastModified
Constructor and Description |
---|
PictureTilingComponent() |
Modifier and Type | Method and Description |
---|---|
void |
activate(ComponentContext context)
Activates the component.
|
PictureTiles |
completeTiles(PictureTiles existingTiles,
int xCenter,
int yCenter) |
protected PictureTiles |
computeTiles(ImageInfo input,
String outputDirPath,
int tileWidth,
int tileHeight,
int maxTiles,
int xCenter,
int yCenter,
long lastModificationTime,
boolean fullGeneration) |
void |
deactivate(ComponentContext context)
Deactivates the component.
|
protected String |
defaultWorkingDirPath() |
static void |
endGC() |
Map<String,String> |
getBlobProperties() |
String |
getBlobProperty(String docType) |
String |
getBlobProperty(String docType,
String defaultValue) |
static Map<String,PictureTilingCacheInfo> |
getCache() |
protected PictureTiler |
getDefaultTiler() |
static Map<String,String> |
getEnv() |
static String |
getEnvValue(String paramName) |
static String |
getEnvValue(String paramName,
String defaultValue) |
protected String |
getExtension(Blob blob) |
PictureTiles |
getTiles(ImageResource resource,
int tileWidth,
int tileHeight,
int maxTiles) |
PictureTiles |
getTiles(ImageResource resource,
int tileWidth,
int tileHeight,
int maxTiles,
int xCenter,
int yCenter,
boolean fullGeneration) |
protected PictureTiles |
getTilesWithSync(ImageResource resource,
int tileWidth,
int tileHeight,
int maxTiles,
int xCenter,
int yCenter,
boolean fullGeneration) |
protected String |
getWorkingDirPath() |
protected String |
getWorkingDirPathForRessource(ImageResource resource) |
protected boolean |
needToConvert(Blob blob) |
protected String |
normalizeWorkingDirPath(String path) |
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
removeCacheEntry(ImageResource resource) |
static void |
setDefaultTiler(PictureTiler tiler) |
static void |
setEnvValue(String paramName,
String paramValue) |
void |
setWorkingDirPath(String path) |
static void |
startGC() |
protected void |
transferAndConvert(Blob blob,
File file) |
protected void |
transferBlob(Blob blob,
File file) |
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
getAdapter, getLastModified, registerExtension, setLastModified, setModifiedNow, start, stop, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicationStarted, getApplicationStartedOrder
public static final String ENV_PARAMETERS_EP
public static final String BLOB_PROPERTY_EP
public static final String IMAGES_TO_CONVERT_EP
protected static Map<String,PictureTilingCacheInfo> cache
protected static List<String> inprocessTiles
protected static PictureTiler defaultTiler
protected static Map<String,String> envParameters
protected Map<String,String> blobProperties
protected List<ImageToConvertDescriptor> imagesToConvert
public PictureTilingComponent()
public void activate(ComponentContext context)
Component
This method is called by the runtime when a component is activated.
activate
in interface Component
activate
in class DefaultComponent
context
- the runtime contextpublic static void startGC()
public static void endGC()
public void deactivate(ComponentContext context)
Component
This method is called by the runtime when a component is deactivated.
deactivate
in interface Component
deactivate
in class DefaultComponent
context
- the runtime contextpublic static Map<String,PictureTilingCacheInfo> getCache()
protected String getWorkingDirPath()
protected String defaultWorkingDirPath()
protected String normalizeWorkingDirPath(String path)
public void setWorkingDirPath(String path)
setWorkingDirPath
in interface PictureTilingService
protected String getWorkingDirPathForRessource(ImageResource resource)
public PictureTiles getTiles(ImageResource resource, int tileWidth, int tileHeight, int maxTiles)
getTiles
in interface PictureTilingService
public PictureTiles completeTiles(PictureTiles existingTiles, int xCenter, int yCenter)
completeTiles
in interface PictureTilingService
public PictureTiles getTiles(ImageResource resource, int tileWidth, int tileHeight, int maxTiles, int xCenter, int yCenter, boolean fullGeneration)
getTiles
in interface PictureTilingService
protected PictureTiles getTilesWithSync(ImageResource resource, int tileWidth, int tileHeight, int maxTiles, int xCenter, int yCenter, boolean fullGeneration)
protected void transferBlob(Blob blob, File file) throws IOException
IOException
protected boolean needToConvert(Blob blob)
protected String getExtension(Blob blob)
protected void transferAndConvert(Blob blob, File file) throws IOException
IOException
protected PictureTiles computeTiles(ImageInfo input, String outputDirPath, int tileWidth, int tileHeight, int maxTiles, int xCenter, int yCenter, long lastModificationTime, boolean fullGeneration)
protected PictureTiler getDefaultTiler()
public static void setDefaultTiler(PictureTiler tiler)
public static String getEnvValue(String paramName)
public static String getEnvValue(String paramName, String defaultValue)
public static void setEnvValue(String paramName, String paramValue)
public Map<String,String> getBlobProperties()
getBlobProperties
in interface PictureTilingService
public String getBlobProperty(String docType)
getBlobProperty
in interface PictureTilingService
public String getBlobProperty(String docType, String defaultValue)
getBlobProperty
in interface PictureTilingService
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
public void removeCacheEntry(ImageResource resource)
removeCacheEntry
in interface PictureTilingService
Copyright © 2017 Nuxeo. All rights reserved.