Class FSComponentExtRepositoryDB<FSCRC extends FSCRDBComponent>
java.lang.Object
com.zfabrik.components.provider.util.FSComponentExtRepositoryDB<FSCRC>
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
FSComponentRepositoryDB
public abstract class FSComponentExtRepositoryDB<FSCRC extends FSCRDBComponent>
extends Object
implements Serializable
A utility for component repository implementers. This helps implementing the index
of components provided and query functionality (see
IComponentsRepository.findComponents(X)
as well as
a simple query cache.
This class is not thread safe.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final long
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Clear the "find" cache.protected abstract FSCRC
createSyntheticComponent
(String componentName) Create a synthetic component without any particular properties yet.protected boolean
Decides whether a component should be allowed to be found by repos down the priority chain.boolean
findComponents
(X propertyExpression) Find locally in this DB (see alsoIComponentsRepository.findComponents(X)
int
Stats of "find" cache.int
Stats of "find" cache.int
Stats of "find" cache.getComponentsOfModule
(String moduleName) Gets all components of a given modulegets the modules read-onlylong
getRevision
(String cn) Gets rev of local componentboolean
hasComponentModule
(String componentName) Checks whether this DB has the named component's moduleint
hashCode()
boolean
Checks whether this DB has the modulestatic String
Extracts module name from component name (i.e.void
putComponent
(String componentName, FSCRC c) Adds a component, updates modules set.void
removeComponent
(String componentName) Remove a componentvoid
removeModule
(String moduleName) Remove a complete module
-
Field Details
-
FIND_CACHE_SIZE
public static final int FIND_CACHE_SIZE- See Also:
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
-
Constructor Details
-
FSComponentExtRepositoryDB
public FSComponentExtRepositoryDB() -
FSComponentExtRepositoryDB
-
-
Method Details
-
clearCache
protected void clearCache()Clear the "find" cache. -
getCacheHits
public int getCacheHits()Stats of "find" cache. -
getCacheQueries
public int getCacheQueries()Stats of "find" cache. -
getCacheSize
public int getCacheSize()Stats of "find" cache. -
delegate
Decides whether a component should be allowed to be found by repos down the priority chain. Defaults to not delegate if the component's module was found here and to delegate otherwise.- Parameters:
componentName
-
-
findComponents
Find locally in this DB (see alsoIComponentsRepository.findComponents(X)
- Parameters:
propertyExpression
-- Throws:
IOException
-
getRevision
Gets rev of local component- Parameters:
cn
-
-
getComponents
-
putComponent
Adds a component, updates modules set. -
createSyntheticComponent
Create a synthetic component without any particular properties yet. This is used for filling synthetic components, e.g. links to an existing component during alias expansion. -
removeComponent
Remove a component -
removeModule
Remove a complete module -
hasModule
Checks whether this DB has the module -
hasComponentModule
Checks whether this DB has the named component's module -
getModules
gets the modules read-only -
getComponentsOfModule
Gets all components of a given module -
moduleOf
Extracts module name from component name (i.e. the "/" separated prefix) -
hashCode
public int hashCode() -
equals
-