|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectStatic
Setup
public final class Setup
A central place where to perform initialization and shutdown of all Geotk services.
Users are not required to perform explicit initialization and shutdown for most services
(except a few cases like World File Image Readers), since services are automatically
discovered when needed (using ServiceLoader) and disposed on JVM termination (using
shutdown hook). However the above-cited mechanism is not
sufficient when an application is undeployed and re-deployed in a JEE environment without
restarting the JVM. For example the Geotk Image I/O
plugins needs to be deregistered
during the undeploy phase before they get
registered again during the
re-deploy phase. Explicit invocations of initialize(Properties) and
shutdown() methods can improve the system stability in such cases.
The amount of works performed by this class depends on the modules available in the classpath.
The table below lists the work performed by current implementation. Users wanting more control
can perform those tasks themselves instead than relying on the methods defined in this
Setup class.
| Module | Methods invoked by initialize(Properties) |
Work done by shutdown() |
|---|---|---|
geotk-utility |
|
|
geotk-coverage |
Remove from the JAI OperationRegistry every
plugins defined in any org.geotoolkit package.
|
|
geotk-coverageio |
Remove from IIORegistry every plugins defined in any org.geotoolkit package.
|
|
geotk-coverageio-netcdf |
|
NetcdfDataset.shutdown().
|
Note on system preferences
In current implementation, invoking initialize(Properties)
with a property entry platform=server also disable the usage of
system preferences. This is a temporary
workaround for the JDK 6 behavior on Unix system, which display "WARNING: Couldn't flush
system prefs" if the etc/.java directory has not been created during the Java
installation process.
This workaround may be removed in a future version if JDK 7 uses its new java.nio.file
package for performing a better work with system preferences.
| utility/geotk-utility (download) | View source code for this class |
| Method Summary | |
|---|---|
static void |
initialize(Properties properties)
Performs the initialization of all Geotk services. |
static void |
showControlPanel()
Shows the Swing Graphical User Interface for configuring the Geotk library. |
static void |
shutdown()
Shutdowns all Geotk services. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
@Configuration
public static void initialize(Properties properties)
throws IllegalStateException
shutdown() has not been invoked, then
every calls after the first method call are ignored.
The properties map allows some control on the initialization process. Current
implementation recognizes the entries listed in the table below. Any entry not listed
in this table are silently ignored.
| Key | Valid values | Default | Meaning |
|---|---|---|---|
platform |
server|desktop |
desktop |
Whatever the library is run for a desktop application or a server. |
netcdfCacheLimit |
Positive integer | 0 | Maximum number of elements in the NetCDF cache (0 for no cache). |
force |
true|false |
false |
If true, attempt a re-initialization after a shutdown. |
properties - Optional set of properties controlling the initialization process,
or null.
IllegalStateException - If the Geotk library has been shutdown
and the given properties map doesn't contain a force=true entry.@Configuration public static void shutdown()
initialize(Properties) method has never been invoked.
The Geotk library should not be used anymore after this method call.
public static void showControlPanel()
throws UnsupportedOperationException
geotk-setup module to be present on the classpath.
Users can also display the same GUI from the command line by running the following
command in the shell (replace SNAPSHOT by the actual Geotk version number):
java -jar geotk-setup-SNAPSHOT.jar
UnsupportedOperationException - if the geotk-setup module is not on the classpath.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||