public class FilesystemMetadataResolver extends AbstractReloadingMetadataResolver
AbstractReloadingMetadataResolver.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 AbstractReloadingMetadataResolver.getMaxRefreshDelay()
is used. If that number is smaller than the
min refresh delay then AbstractReloadingMetadataResolver.getMinRefreshDelay()
is used. Otherwise the calculated refresh delay multiplied by
AbstractReloadingMetadataResolver.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.AbstractBatchMetadataResolver.BatchEntityBackingStore
AbstractMetadataResolver.EntityBackingStore
Constructor and Description |
---|
FilesystemMetadataResolver(File metadata)
Constructor.
|
FilesystemMetadataResolver(Timer backgroundTaskTimer,
File metadata)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doDestroy()
Performs component specific destruction logic.
|
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.
|
protected void |
setMetadataFile(File file)
Sets the file from which metadata is read.
|
protected void |
validateMetadataFile(File file)
Validate the basic properties of the specified metadata file, for example that it exists;
that it is a file; and that it is readable.
|
computeNextRefreshDelay, getExpirationTime, getLastRefresh, getLastUpdate, getMaxRefreshDelay, getMinRefreshDelay, getNextRefresh, getRefreshDelayFactor, initMetadataResolver, inputstreamToByteArray, postProcessMetadata, processCachedMetadata, processNewMetadata, processNonExpiredMetadata, processPreExpiredMetadata, refresh, setCacheSourceMetadata, setMaxRefreshDelay, setMinRefreshDelay, setRefreshDelayFactor, unmarshallMetadata
createNewBackingStore, getBackingStore, getCachedFilteredMetadata, getCachedOriginalMetadata, isCacheSourceMetadata, iterator, preProcessNewMetadata, resolve
doInitialize, filterMetadata, getMetadataFilter, getParserPool, getUnmarshallerFactory, indexEntityDescriptor, isFailFastInitialization, isRequireValidMetadata, isValid, lookupEntityID, lookupIndexedEntityID, preProcessEntitiesDescriptor, preProcessEntityDescriptor, releaseMetadataDOM, removeByEntityID, resolveSingle, setBackingStore, setFailFastInitialization, setMetadataFilter, setParserPool, setRequireValidMetadata, unmarshallMetadata
setId
getId
destroy, initialize, isDestroyed, isInitialized
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMetadataFilter, isRequireValidMetadata, setMetadataFilter, setRequireValidMetadata
resolve, resolveSingle
getId
forEach, spliterator
public FilesystemMetadataResolver(@Nonnull File metadata) throws ResolverException
metadata
- the metadata fileResolverException
- this exception is no longer thrownpublic FilesystemMetadataResolver(@Nullable Timer backgroundTaskTimer, @Nonnull File metadata) throws ResolverException
metadata
- the metadata filebackgroundTaskTimer
- timer used to refresh metadata in the backgroundResolverException
- this exception is no longer thrownprotected void setMetadataFile(@Nonnull File file) throws ResolverException
file
- path to the metadata fileResolverException
- this exception is no longer thrownprotected void doDestroy()
doDestroy
in class AbstractReloadingMetadataResolver
protected String getMetadataIdentifier()
getMetadataIdentifier
in class AbstractReloadingMetadataResolver
protected byte[] fetchMetadata() throws ResolverException
fetchMetadata
in class AbstractReloadingMetadataResolver
ResolverException
- thrown if there is a problem fetching the metadataprotected void validateMetadataFile(@Nonnull File file) throws ResolverException
file
- the file to evaluateResolverException
- if file does not pass basic properties required of a metadata fileCopyright © 2016 JBoss by Red Hat. All rights reserved.