URIs. Initial version are
loaded from the classpath, or other fallback URL.
This class is used for managing/updating/reloading of data sources, e.g. data streams for exchange rates, additional currency data, historical currency data and so on.
Note
this class is implementation specific and not part of the official JSR's API.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | LoaderService.
Callback that can be registered to be informed, when a data item was loaded/updated or resetToFallback. |
| public static enum | LoaderService.
Platform RI: The update policy defines how and when the
|
| Modifier and Type | Method and Description |
|---|---|
| public void | addLoaderListener(LoaderService.
The listener to be added l,The unique identifiers of the resource, not resourceIds)null.Add a |
| public InputStream | Returns: TheInputStream for reading the data.The unique identifier of the resource, not resourceId)null.Access the input stream of the given data resource. |
| public Set | |
| public Map | Returns: the update configuration properties, notnullthe dataId, not resourceId)nullGet the update configuration for the given dataId. |
| public LoaderService. | getUpdatePolicy(String
the resource's id, not resourceId)nullGet the |
| public boolean | Returns: true, if such a data resource is registered.The unique identifier of the resource, not resourceId)null.Allows to check if a data resource with the given dataId is registered. |
| public boolean | Returns: true if load was successful.The unique identifier of the resource, not resourceId)null.Explicitly triggers the remote loading of the registered data, regardless
of its current |
| public Future | Returns: the Future of the load task started, returns Boolean.TRUE if the load was successful (either from remote or from the fallback resource).The unique identifier of the resource, not resourceId)null.Explicitly asynchronously triggers the remote loading of the registered
data, regardless of its current |
| public boolean | Returns: true if load was successful.The unique identifier of the resource, not resourceId)null.Explicitly triggers the loading of the registered data, regardless of its
current |
| public void | registerAndLoadData(LoadDataInformation loadDataInformation)
Programmatically registers a remote resource |
| public void | registerAndLoadData(String resourceId, LoaderService.
Deprecated
|
| public void | registerData(LoadDataInformation loadDataInformation)
Programmatically registers a remote resource |
| public void | registerData(String resourceId, LoaderService.
Deprecated
|
| public void | removeLoaderListener(LoaderService.
The listener to be removed l,The unique identifier of the resource, not resourceIds)null.Remove a registered |
| public void |
| addLoaderListener | back to summary |
|---|---|
| public void addLoaderListener(LoaderService. Add a
| |
| getData | back to summary |
|---|---|
| public InputStream getData(String resourceId) throws IOException Access the input stream of the given data resource. This method is called by the modules that depend on the given data item. The method always returns the most current data, either from the classpath or the local cache, depending which flavors are available and recently updated. The method must be thread safe and can be accessed in parallel. Hereby it is possible that, when an intermediate update of the data by update occurs, that different input stream content is returned.
| |
| getResourceIds | back to summary |
|---|---|
| public Set Get a | |
| getUpdateConfiguration | back to summary |
|---|---|
| public Map Get the update configuration for the given dataId.
| |
| getUpdatePolicy | back to summary |
|---|---|
| public LoaderService. Get the
| |
| isResourceRegistered | back to summary |
|---|---|
| public boolean isResourceRegistered(String resourceId) Allows to check if a data resource with the given dataId is registered.
| |
| loadData | back to summary |
|---|---|
| public boolean loadData(String resourceId) throws IOException Explicitly triggers the remote loading of the registered data, regardless
of its current
| |
| loadDataAsync | back to summary |
|---|---|
| public Future Explicitly asynchronously triggers the remote loading of the registered
data, regardless of its current | |
| loadDataLocal | back to summary |
|---|---|
| public boolean loadDataLocal(String resourceId) Explicitly triggers the loading of the registered data, regardless of its
current
| |
| registerAndLoadData | back to summary |
|---|---|
| public void registerAndLoadData(LoadDataInformation loadDataInformation) Programmatically registers a remote resource | |
| registerAndLoadData | back to summary |
|---|---|
| public void registerAndLoadData(String resourceId, LoaderService. Deprecated
| |
| registerData | back to summary |
|---|---|
| public void registerData(LoadDataInformation loadDataInformation) Programmatically registers a remote resource | |
| registerData | back to summary |
|---|---|
| public void registerData(String resourceId, LoaderService. Deprecated
| |
| removeLoaderListener | back to summary |
|---|---|
| public void removeLoaderListener(LoaderService. Remove a registered
| |
| resetData | back to summary |
|---|---|
| public void resetData(String resourceId) throws IOException Explicitly triggers the resetToFallback (loading of the registered data from the classpath backup resource).
| |
resetData(String), loadData(String)
| Modifier and Type | Method and Description |
|---|---|
| public void | newDataLoaded(String
the resource id resourceId, InputStream the input stream for accessing the data is)Callback called from the |
| newDataLoaded | back to summary |
|---|---|
| public void newDataLoaded(String resourceId, InputStream is) Callback called from the
| |
LoaderService tries to update the local cache with newest version of
the registered data resources, accessing the configured remote
URIs. By default no remote connections are done (
UpdatePolicy#NEVER ).
| Modifier and Type | Field and Description |
|---|---|
| public static final LoaderService. | LAZY
The resource will be loaded automatically from remote only once, when accessed the first time. |
| public static final LoaderService. | NEVER
The resource will never be updated from remote, only the fallback URL will be evaluated. |
| public static final LoaderService. | ONSTARTUP
The resource will be loaded automatically from remote only once on startup. |
| public static final LoaderService. | SCHEDULED
The resource should be regularly reloaded based on a schedule. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static LoaderService. | |
| public static LoaderService. |
| LAZY | back to summary |
|---|---|
| public static final LoaderService. The resource will be loaded automatically from remote only once, when accessed the first time. | |
| NEVER | back to summary |
|---|---|
| public static final LoaderService. The resource will never be updated from remote, only the fallback URL will be evaluated. | |
| ONSTARTUP | back to summary |
|---|---|
| public static final LoaderService. The resource will be loaded automatically from remote only once on startup. | |
| SCHEDULED | back to summary |
|---|---|
| public static final LoaderService. The resource should be regularly reloaded based on a schedule. | |
| UpdatePolicy | back to summary |
|---|---|
| private UpdatePolicy() | |
| valueOf | back to summary |
|---|---|
| public static LoaderService. | |
| values | back to summary |
|---|---|
| public static LoaderService. | |