public class LoadableResource extends Object
| Constructor and Description |
|---|
LoadableResource(String resourceId,
LoaderService.UpdatePolicy updatePolicy,
URL fallbackLocation,
URL... locations)
Create a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getAccessCount()
Get the number of successful accesses.
|
URL |
getCachedResource()
Get the URL of the locally cached resource.
|
byte[] |
getData()
Get the resource data.
|
InputStream |
getDataStream()
Get the resource data as input stream.
|
URL |
getFallbackResource()
Return the fallback location.
|
long |
getLastLoaded()
Get the timestamp of the last succesful load.
|
int |
getLoadCount()
Get the number of active loads of this resource (InputStream).
|
List<URL> |
getRemoteResources()
Get the remote locations.
|
String |
getResourceId()
Get the resourceId.
|
Map<String,String> |
getUpdateConfig()
Access the registration config.
|
LoaderService.UpdatePolicy |
getUpdatePolicy()
Get the
LoaderService.UpdatePolicy. |
boolean |
load()
Loads the resource, first from the remote resources, if that fails from
the fallback location.
|
boolean |
loadFallback()
Try to load the resource from the faööback resources.
|
boolean |
loadRemote()
Try to load the resource from the remote locations.
|
boolean |
reset()
Explcitly override the resource wih the fallback context and resets the
load counter.
|
String |
toString() |
void |
unload()
Unloads the data.
|
public LoadableResource(String resourceId, LoaderService.UpdatePolicy updatePolicy, URL fallbackLocation, URL... locations)
resourceId - The dataId.updatePolicy - The LoaderService.UpdatePolicy, not null.fallbackLocation - teh fallback ULR, not null.locations - the remote locations, not null (but may be empty!)public boolean load()
public final String getResourceId()
public LoaderService.UpdatePolicy getUpdatePolicy()
LoaderService.UpdatePolicy.public final List<URL> getRemoteResources()
public final URL getFallbackResource()
public final URL getCachedResource()
public final int getLoadCount()
public final int getAccessCount()
public final byte[] getData()
public InputStream getDataStream()
public final long getLastLoaded()
public boolean loadRemote()
public boolean loadFallback()
public void unload()
public boolean reset() throws IOException
IOExceptionpublic Map<String,String> getUpdateConfig()
Copyright © 2012-2014 JavaMoney. All Rights Reserved.