org.gvsig.tools
The Tools library is an important part of gvSIG. It provides a number of utilities and services which support the other modules in gvSIG. The main functionality provided by this library relates to:
- Registration of extension points
- Initialisation of libraries
- Utilities for the separation of the API and implementation (Registration of APIs, registration of implementations for the APIs, registration of SPI service providers or localisation of an API implementation)
- Monitoring of Tasks
Although these are the most important services the library provides, it also provides other tools that can be considered structural to the application. These include:
- Disposables
- Interfaces for managing Observers-observables
- Interfaces for managing visitors
- Definition of data types
- Base interfaces for evaluators
- Object Persistence
Tip
You can find more detailed information on how the library mechanism works in gvSIG at org.gvsig.tools.library, on the use of locators you can consult org.gvsig.tools.locator, and for managers you can find documentation at org.gvsig.tools.service.
We will focus now on three basic concepts that are repeated throughout the code that we see, and that are linked to utilities that enable a strict separation of the API from the implementation:
- Libraries. These are pieces of code normally associated with a jar that provides a functionality. Each of these libraries must be a class that implements the Library interface, usually extending the AbstractLibrary class. They have methods for initialising the library that are invoked when it is loaded.
- Managers. These components provide functionality to the application, acting as an agent for the various services offered by the library and for their configuration. Acts as a singleton, since in the application there is usually only one instance of each of these components. Libraries will have one or more of these according to their logic.
- Locators. This is a utility that allows you to register implementations of managers for a given library, and to retrieve the manager implementation of a specific API.
These three components play a major role whenever we want to use or create new components, as they are the devices that allow us to access different parts of gvSIG