Details
-
Type:
New Feature
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Component/s: NewComponents
-
Labels:None
-
Number of attachments :
Description
We need a toolkit that allows libraries (aka .jar files) to export resources. The resources exported would be things like dtds, schemas, images, components, component profiles etc.
Each library would have a descriptor (META-INF/spice/resources.xml) which lists the resources it exports. A sample of this may look like
<resources version="1.0">
<!-- declare some resource types -->
<type shortname="dtd" uri="http://www.w3c.org/1995/dtd"/>
<type shortname="png" uri="http://www.images-r-us.com/2000/png"/>
<type shortname="component"
uri="http://jakarta.apache.org/avalon/component/1.0"/>
<type shortname="service"
uri="http://jakarta.apache.org/avalon/service/1.0"/>
<!-- declare some instances of above resource types -->
<dtd key="assembly"
resource="/org/apache/avalon/phoenix/tools/assembly.dtd"/>
<png key="banner"
resource="/org/apache/avalon/phoenix/tools/phoenix.png"/>
<png key="built-with"
resource="/org/apache/avalon/phoenix/tools/built-with-phoenix.png"/>
<component key="kernel"
resource="org.apache.avalon.phoenix.components.kernel.DefaultKernel"/>
<service key="kernel"
resource="org.apache.avalon.phoenix.interfaces.Kernel"/>
</resources>
Each resource entry declares a single resource. Each resource has a particular type (type defined by a URI). The way that a resource is extracted from library is not specified by this toolkit.
This approach would also allow libraries to "extend" or "cascade" existing libraries. So you could replace the resource of type "component" in above config via something like (Assuming that the above descriptor was in a library named 'phoenix')
<resources extends="phoenix" version="1.0">
<type shortname="component"
uri="http://jakarta.apache.org/avalon/component/1.0"/>
<component key="kernel"
resource="org.apache.avalon.phoenix.components.kernel.DefaultKernel"/>
</resources>
Some older notes...
We will eventuall need a decent directory system for all of its resources. The directory service may include things like resources from jars and it may also include things like type information, profile information etc.
To accomodate such a system it is first necessary to classify the possible entrys. Classifications include;