|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IComponentsRepository
A component repository provides component meta data and resources to the z2 runtime. In other words: Component repositories define the system's view of the world.
This interface must be implemented by a component repository in order to register at IComponentsManager.registerRepository(int, IComponentsRepository).
Component repository must be registered at meaningful times, preferrably early in the startup process, to make sure components will be found by others when queried.
Component Repositories are prioritized and form a chain of responsibilities, given the repository with the higher priority preference over other ones with lower prio. In particular, a repository of higher priority is fully responsible of delegating calls to lower prio repositories.
The following table lists priorities of common component repositories:
| Repository | priority |
|---|---|
| dev | 750 |
| l1 | 500 |
Note that resources from repositories may be provided on-demand. Clients must call the retrieve(String) method
to make sure component resources are available locally as files.
Component descriptors however should be made available without possibly unrequired resource downloads, as the system
will use the descriptors to implement component queries (see findComponents(X)).
Typically component repositories are structured in a two-level hierarchy comprising of a project name, i.e. some human-managable taxonomy
uniquely identifying and separating namespaces, like com.zfabrik.aproject or org.apache.log4j, and a
component name that separates technical components within the project.
For example, a project holding a web application will typically also hold a Java component and maybe a data source definition. In that case, the structure within the repository may look like this (not showing other sibling projects):
myproject/
datasource.properties
java/
z.properties
src.api/...
src.impl/...
web/
z.properties
WebContent/
WEB-INF/
web.xml
index.jsp
In this case, components may be declared as simple property sets, e.g. myproject/datasource or as more complex components
featuring a folder structure like myproject/web.
This is a commonly implemented structure. Component repository implementations may however chose different storage structures for
component properties and component hierarchies.
| Field Summary | |
|---|---|
static java.lang.String |
COMPONENT_REPO_IMPLEMENTATION
component repository implementations should add this property to component properties when providing a component descriptor so that the runtime can declare dependeny on the repository implementation component when providing a component resource. |
| Method Summary | |
|---|---|
java.util.Collection<java.lang.String> |
findComponents(X propertyExpression)
find all components satisfying a query condition |
IComponentDescriptor |
getComponent(java.lang.String component)
retrieves a component descriptor. |
long |
getRevision(java.lang.String componentName)
return the most current revision of the component as available by the provider. |
java.io.File |
retrieve(java.lang.String name)
retrieve a package or a component's resources in executable representation. |
| Field Detail |
|---|
static final java.lang.String COMPONENT_REPO_IMPLEMENTATION
| Method Detail |
|---|
long getRevision(java.lang.String componentName)
throws java.io.IOException
java.io.IOException
java.util.Collection<java.lang.String> findComponents(X propertyExpression)
throws java.io.IOException
java.io.IOExceptionIComponentDescriptor getComponent(java.lang.String component)
java.io.File retrieve(java.lang.String name)
throws java.io.IOException
the - naming scheme follows the package and component naming scheme. A missing component specification (as tail)
indicates that package global resources are supposed to be retrieved
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||