public class FilesystemMetadataProvider extends AbstractReloadingMetadataProvider
AbstractReloadingMetadataProvider.getMaxRefreshDelay()
value is used. Otherwise, the earliest refresh interval of the metadata file is checked
by looking for the earliest of all the validUntil attributes and cacheDuration attributes. If that refresh interval
is larger than the max refresh delay then AbstractReloadingMetadataProvider.getMaxRefreshDelay()
is used. If that number is smaller than the
min refresh delay then AbstractReloadingMetadataProvider.getMinRefreshDelay()
is used. Otherwise the calculated refresh delay multiplied by
AbstractReloadingMetadataProvider.getRefreshDelayFactor()
is used. By using this factor, the provider will attempt to be refresh before the
cache actually expires, allowing a some room for error and recovery. Assuming the factor is not exceedingly close to
1.0 and a min refresh delay that is not overly large, this refresh will likely occur a few times before the cache
expires.ObservableMetadataProvider.Observer
unmarshallerFactory
コンストラクタと説明 |
---|
FilesystemMetadataProvider(File metadata)
Constructor.
|
FilesystemMetadataProvider(Timer backgroundTaskTimer,
File metadata)
Constructor.
|
修飾子とタイプ | メソッドと説明 |
---|---|
void |
destroy()
Destroys the metadata provider and frees any resources current held by it.
|
protected byte[] |
fetchMetadata()
Fetches metadata from a source.
|
protected String |
getMetadataIdentifier()
Gets an identifier which may be used to distinguish this metadata in logging statements.
|
boolean |
maintainExpiredMetadata()
推奨されていません。
use
BaseMetadataProvider.requireValidMetadata() instead |
void |
setMaintainExpiredMetadata(boolean maintain)
推奨されていません。
|
protected void |
setMetadataFile(File file)
Sets the file from which metadata is read.
|
computeNextRefreshDelay, doGetMetadata, doInitialization, getExpirationTime, getLastRefresh, getLastUpdate, getMaxRefreshDelay, getMinRefreshDelay, getNextRefresh, getRefreshDelayFactor, inputstreamToByteArray, postProcessMetadata, processCachedMetadata, processNewMetadata, processNonExpiredMetadata, processPreExpiredMetadata, refresh, setMaxRefreshDelay, setMinRefreshDelay, setRefreshDelayFactor, unmarshallMetadata
emitChangeEvent, getObservers
clearDescriptorIndex, doGetEntitiesDescriptor, doGetEntityDescriptor, doGetRole, doGetRole, filterMetadata, getEntitiesDescriptor, getEntitiesDescriptorByName, getEntityDescriptor, getEntityDescriptorById, getEntityDescriptorById, getMetadata, getParserPool, getRole, getRole, initialize, isFailFastInitialization, isInitialized, isValid, releaseMetadataDOM, setFailFastInitialization, setInitialized, setParserPool, unmarshallMetadata
getMetadataFilter, requireValidMetadata, setMetadataFilter, setRequireValidMetadata
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEntitiesDescriptor, getEntityDescriptor, getMetadata, getMetadataFilter, getRole, getRole, requireValidMetadata, setMetadataFilter, setRequireValidMetadata
public FilesystemMetadataProvider(File metadata) throws MetadataProviderException
metadata
- the metadata fileMetadataProviderException
- thrown if the given file path is null, does not exist, does not represent a
file, or if the metadata can not be parsedpublic FilesystemMetadataProvider(Timer backgroundTaskTimer, File metadata) throws MetadataProviderException
metadata
- the metadata filebackgroundTaskTimer
- timer used to refresh metadata in the backgroundMetadataProviderException
- thrown if the given file path is null, does not exist, does not represent a
file, or if the metadata can not be parsedprotected void setMetadataFile(File file) throws MetadataProviderException
file
- path to the metadata fileMetadataProviderException
- thrown if the file does not exist or is not a readable filepublic boolean maintainExpiredMetadata()
BaseMetadataProvider.requireValidMetadata()
insteadpublic void setMaintainExpiredMetadata(boolean maintain)
BaseMetadataProvider.setRequireValidMetadata(boolean)
insteadmaintain
- whether cached metadata should be discarded if it expires and can not be refreshed.public void destroy()
destroy
クラス内 AbstractReloadingMetadataProvider
protected String getMetadataIdentifier()
getMetadataIdentifier
クラス内 AbstractReloadingMetadataProvider
protected byte[] fetchMetadata() throws MetadataProviderException
fetchMetadata
クラス内 AbstractReloadingMetadataProvider
MetadataProviderException
- thrown if there is a problem fetching the metadataCopyright © 2012. All Rights Reserved.