@Beta public class InMemorySchemaSourceCache<T extends SchemaSourceRepresentation> extends AbstractSchemaSourceCache<T> implements AutoCloseable
| Modifier | Constructor and Description |
|---|---|
protected |
InMemorySchemaSourceCache(SchemaSourceRegistry consumer,
Class<T> representation,
com.google.common.cache.CacheBuilder<Object,Object> builder) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static <R extends SchemaSourceRepresentation> |
createSoftCache(SchemaSourceRegistry consumer,
Class<R> representation) |
static <R extends SchemaSourceRepresentation> |
createSoftCache(SchemaSourceRegistry consumer,
Class<R> representation,
long lifetime,
TimeUnit units) |
com.google.common.util.concurrent.FluentFuture<? extends T> |
getSource(SourceIdentifier sourceIdentifier)
Returns a representation a for supplied YANG source identifier.
|
protected void |
offer(T source)
Offer a schema source in requested representation for caching.
|
register, schemaSourceEncountered, schemaSourceRegistered, schemaSourceUnregisteredprotected InMemorySchemaSourceCache(SchemaSourceRegistry consumer, Class<T> representation, com.google.common.cache.CacheBuilder<Object,Object> builder)
public static <R extends SchemaSourceRepresentation> InMemorySchemaSourceCache<R> createSoftCache(SchemaSourceRegistry consumer, Class<R> representation)
public static <R extends SchemaSourceRepresentation> InMemorySchemaSourceCache<R> createSoftCache(SchemaSourceRegistry consumer, Class<R> representation, long lifetime, TimeUnit units)
public com.google.common.util.concurrent.FluentFuture<? extends T> getSource(SourceIdentifier sourceIdentifier)
SchemaSourceProviderMissingSchemaSourceException.
MissingSchemaSourceException.
In either case the returned representation is required to report a non-null
revision in the SourceIdentifier returned from
SchemaSourceRepresentation.getIdentifier().
Implementations are not required to provide constant behavior in time, notably this different invocation of this method may produce different results.
getSource in interface SchemaSourceProvider<T extends SchemaSourceRepresentation>sourceIdentifier - source identifierprotected void offer(T source)
AbstractSchemaSourceCacheAbstractSchemaSourceCache.register(SourceIdentifier).offer in class AbstractSchemaSourceCache<T extends SchemaSourceRepresentation>source - schema sourcepublic void close()
close in interface AutoCloseableCopyright © 2019 OpenDaylight. All rights reserved.