public abstract class ALfnEnvironment extends Object
newInstance()
Modifier | Constructor and Description |
---|---|
protected |
ALfnEnvironment()
Deprecated.
Do not use this constructor. You are not supposed to create subclasses of this class. Use
the
newInstance() method instead. |
Modifier and Type | Method and Description |
---|---|
abstract void |
addPathPrefix(String aName,
String aPathPrefix)
Adds a path prefix which maps a symbolic name onto a path prefix and vice versa.
|
abstract void |
addTileDataCodec(ILcdEarthTileDataCodec aCodec,
ELfnDataType aDataType)
Adds (registers) a codec.
|
abstract void |
close()
Closes this environment and releases all its resources.
|
abstract void |
configureDataModel(TLcdDataModel aDataModel)
Configures an additional data model on the XML encoder and decoder.
|
abstract int |
getCallbackThreadCount()
Gets the number of pooled threads to handle asynchronous callbacks from a Tile Store.
|
abstract Map<String,String> |
getPathPrefixes()
Gets an unmodifiable snapshot of the path prefixes.
|
abstract Collection<ILcdEarthTileDataCodec> |
getTileDataCodecs(ELfnDataType aDataType)
Gets the registered tile data codecs.
|
static ALfnEnvironment |
newInstance()
Creates a new environment.
|
abstract boolean |
removePathPrefixes(String... aNames)
Removes the path prefix for the given symbolic name(s).
|
abstract boolean |
removeTileDataCodec(ILcdEarthTileDataCodec aCodec,
ELfnDataType aDataType)
Removes a tile data codec.
|
abstract void |
setCallbackThreadCount(int aThreadCount)
Sets the number of pooled threads to handle asynchronous callbacks from a Tile Store.
|
protected ALfnEnvironment()
newInstance()
method instead.newInstance()
method instead.public static ALfnEnvironment newInstance()
public abstract void configureDataModel(TLcdDataModel aDataModel)
aDataModel
- a data model to be addedpublic abstract void addTileDataCodec(ILcdEarthTileDataCodec aCodec, ELfnDataType aDataType)
null
if it is not relevant.
The encoded format of the specified codec must have a MIME type as format name, f.i. image/jpeg
,
and no format class.aCodec
- the codec to be addedaDataType
- the data typepublic abstract boolean removeTileDataCodec(ILcdEarthTileDataCodec aCodec, ELfnDataType aDataType)
aCodec
- the codec to be removedaDataType
- the data type or null
if it is not relevanttrue
if a codec was removed, false
otherwisepublic abstract Collection<ILcdEarthTileDataCodec> getTileDataCodecs(ELfnDataType aDataType)
Data Type | MIME type | Comments |
---|---|---|
IMAGE | image/jpeg | Supports transparency |
IMAGE | image/png | Supports transparency |
ELEVATION | image/png | 16 bit precision, limited support for decimal values |
ELEVATION | image/tiff | Supports decimal values with 32 bits float precision |
aDataType
- the data type or null
if it is not relevantpublic abstract void close() throws IOException, InterruptedException
finalize()
.
This may happen at an undetermined time in the future, if at all.
If you have time-dependent code that relies on the environment being closed at a specific point in time, you should explicitly close it.
Closing the environment multiple times does not throw and has the same effect as closing it once.IOException
- in case of an I/O failureInterruptedException
- when the closing is interruptedpublic abstract int getCallbackThreadCount()
GetTile
operations will be handled by these threads.
These threads are named Callback-i/n
where i
is their index in the pool (offset by 1) and n
is the pool size.
When your application is slow and you see that the callback threads are fully loaded, it may be a good idea to increase their number.
The default callback thread count is 4.public abstract void setCallbackThreadCount(int aThreadCount)
aThreadCount
- the new thread countgetCallbackThreadCount()
public abstract void addPathPrefix(String aName, String aPathPrefix)
null
, a warning will be logged and it will not have been added.
The mapping of path prefixes is bidirectional, so both the name and the path prefix must be unique.
When a duplicate name or path prefix is added, it will be replaced.
Path prefixes are internally converted to their canonical forms.
Uniqueness of path prefixes is based on their canonical form.
This means for example that a path prefix "T:"
is the same as "/T:"
.
If the file for the path prefix does not exist, a warning will be logged.
Examples of supported path prefixes:
"pathPrefix"="\\SERVER\Data"
"path.prefix"="X:\Data"
"anyString"="/mnt/server/data/"
aName
- a symbolic name to replace the path prefix with, for example "my.data"
. If null
, the path prefix will be ignored and everything will behave as if the path prefix was never added.aPathPrefix
- a path prefix, denoting the local path, for example "//my/data"
. If null
, the path prefix will be ignored and everything will behave as if the pathpublic abstract boolean removePathPrefixes(String... aNames)
null
, a warning will be logged and it will not have been removed.
Removing a path prefix does not unset any system properties.aNames
- the symbolic names for which to remote the path prefix(es). May be empty but never null
.true
if at least one path prefix substitution actually existed, false
otherwisepublic abstract Map<String,String> getPathPrefixes()
"X:/my/input/data/imagery.tif"
.
On the server, the path to the input file is "/mnt/my/input/data/imagery.tif"
.
In order to make this work, path prefix substitutions need to be defined on both client and server.
For example, on the client this could be "my.input.data"
→ "/X:/my/input/data"
, while on the server it is "my.input.data"
→ "/smb/my/input/data"
.
The name needs to be same on client and server, the value is specific for each.
This substitution happens transparently to the user. On the wire, substituted paths will look like "${my.input.data}/imagery.tif"
.
By default, the map contains the path prefixes defined by system properties starting with "luciad.fusion.path.prefix"
.
For example, defining a system property "luciad.fusion.path.prefix.my.input.data=/mnt/my/input/data"
is equivalent to setting a path prefix with name "my.input.data"
and path prefix "/mnt/my/input/data"
.null