public abstract class AbstractStorage extends AbstractProvider implements Storage
setupLoader и overrideLoader| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_EVENT_LOADER_NAME |
protected java.util.Map<java.lang.String,Loader> |
loaders |
protected Storage |
parent |
protected java.util.Map<java.lang.String,Storage> |
shelves |
protected Meta |
storageConfig |
| Constructor and Description |
|---|
AbstractStorage(Storage parent,
java.lang.String name,
Meta annotation) |
AbstractStorage(java.lang.String name) |
AbstractStorage(java.lang.String name,
Meta annotation) |
| Modifier and Type | Method and Description |
|---|---|
Loader |
buildLoader(java.lang.String shelf,
Meta loaderConfig)
Build a loader on a specific shelf
|
Storage |
buildShelf(java.lang.String shelfName)
Create shelf with given name and inherited configuration.
|
void |
close()
Close the storage
|
Context |
getContext()
the context
|
EventLoader |
getDefaultEventLoader()
Get the default event loader for this storage
|
Loader |
getLoader(java.lang.String name)
Get the loader with given name if it is registered in this storage.
|
java.lang.String |
getName()
getName.
|
Storage |
getParent()
Get superStorage of this storage.
|
Storage |
getShelf(java.lang.String name)
Returns th shelf with given name.
|
boolean |
hasLoader(java.lang.String name)
Check if the loader with given name is registered.
|
boolean |
hasShelf(java.lang.String name)
Check if this storage has shelf with given name.
|
boolean |
isRoot() |
java.util.Map<java.lang.String,Loader> |
loaders()
return a copy of loader map
|
Meta |
meta()
Get the meta-data for this object.
|
void |
open()
Initialize this storage.
|
protected Loader |
overrideLoader(Loader currentLoader,
Meta newAnnotation)
update an annotation of loader using overriding annotation
|
java.lang.Object |
provide(Path path)
If chainpath is presented than default target is "storage".
|
protected java.lang.Object |
provide(java.lang.String target,
Name name)
Provide direct members only (no chain paths)
|
boolean |
provides(Path path)
provides.
|
protected boolean |
provides(java.lang.String target,
Name name)
If chainpath is presented than default target is "storage".
|
void |
refresh()
Refresh the state of storage
|
Envelope |
respond(Envelope message) |
java.util.Map<java.lang.String,Storage> |
shelves()
A map of all shelfs in this storage and their annotations
|
provide, providesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuildLoader, buildShelfisAnonimouspublic static final java.lang.String DEFAULT_EVENT_LOADER_NAME
protected Meta storageConfig
public AbstractStorage(Storage parent, java.lang.String name, Meta annotation)
public AbstractStorage(java.lang.String name, Meta annotation)
public AbstractStorage(java.lang.String name)
public void open() throws StorageException
open in interface StorageStorageExceptionpublic void refresh() throws StorageException
refresh in interface StorageStorageExceptionpublic void close() throws java.lang.Exception
public Storage buildShelf(java.lang.String shelfName) throws StorageException
buildShelf(shelfName, null)shelfName - StorageExceptionprotected Loader overrideLoader(Loader currentLoader, Meta newAnnotation) throws StorageException
currentLoader - newAnnotation - StorageExceptionpublic boolean provides(Path path)
Providerprovides.
provides in interface Providerprovides in class AbstractProviderpublic java.lang.Object provide(Path path)
provide in interface Providerprovide in class AbstractProviderpath - protected boolean provides(java.lang.String target, Name name)
provides in class AbstractProvidertarget - name - protected java.lang.Object provide(java.lang.String target, Name name)
AbstractProviderprovide in class AbstractProviderpublic Meta meta()
Annotatedpublic boolean hasLoader(java.lang.String name)
Storagepublic Loader getLoader(java.lang.String name) throws StorageException
StoragegetLoader in interface Storagename - name of the loader or data set. In general is the name of
hierarchical root element for all data pointsStorageExceptionpublic boolean hasShelf(java.lang.String name)
Storagepublic Storage getShelf(java.lang.String name) throws StorageException
StoragegetShelf in interface StorageStorageExceptionpublic java.util.Map<java.lang.String,Loader> loaders() throws StorageException
loaders in interface StorageStorageExceptionpublic java.util.Map<java.lang.String,Storage> shelves() throws StorageException
Storageshelves in interface StorageStorageExceptionpublic Storage getParent()
Storagepublic Loader buildLoader(java.lang.String shelf, Meta loaderConfig) throws StorageException
shelf - loaderConfig - StorageExceptionpublic boolean isRoot()
public Context getContext()
ConfinedgetContext in interface ConfinedContext object.public EventLoader getDefaultEventLoader() throws StorageException
StoragegetDefaultEventLoader in interface StorageStorageException