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, provides
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
buildLoader, buildShelf
isAnonimous
public 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 Storage
StorageException
public void refresh() throws StorageException
refresh
in interface Storage
StorageException
public void close() throws java.lang.Exception
public Storage buildShelf(java.lang.String shelfName) throws StorageException
buildShelf(shelfName, null)
shelfName
- StorageException
protected Loader overrideLoader(Loader currentLoader, Meta newAnnotation) throws StorageException
currentLoader
- newAnnotation
- StorageException
public boolean provides(Path path)
Provider
provides.
provides
in interface Provider
provides
in class AbstractProvider
public java.lang.Object provide(Path path)
provide
in interface Provider
provide
in class AbstractProvider
path
- protected boolean provides(java.lang.String target, Name name)
provides
in class AbstractProvider
target
- name
- protected java.lang.Object provide(java.lang.String target, Name name)
AbstractProvider
provide
in class AbstractProvider
public Meta meta()
Annotated
public boolean hasLoader(java.lang.String name)
Storage
public Loader getLoader(java.lang.String name) throws StorageException
Storage
getLoader
in interface Storage
name
- name of the loader or data set. In general is the name of
hierarchical root element for all data pointsStorageException
public boolean hasShelf(java.lang.String name)
Storage
public Storage getShelf(java.lang.String name) throws StorageException
Storage
getShelf
in interface Storage
StorageException
public java.util.Map<java.lang.String,Loader> loaders() throws StorageException
loaders
in interface Storage
StorageException
public java.util.Map<java.lang.String,Storage> shelves() throws StorageException
Storage
shelves
in interface Storage
StorageException
public Storage getParent()
Storage
public Loader buildLoader(java.lang.String shelf, Meta loaderConfig) throws StorageException
shelf
- loaderConfig
- StorageException
public boolean isRoot()
public Context getContext()
Confined
getContext
in interface Confined
Context
object.public EventLoader getDefaultEventLoader() throws StorageException
Storage
getDefaultEventLoader
in interface Storage
StorageException