Package org.apache.avalon.meta.info.builder

Resources supporting the creation of a Type instance from a serialized form.

See:
          Description

Interface Summary
ServiceCreator Interface used to create a Service from a stream.
TypeCreator Simple interface used to create Type from stream.
TypeFactory Simple interface used to create Type from stream.
 

Class Summary
SerializedServiceCreator Create Service from stream made up of a serialized object.
SerializedTypeCreator Create Type from stream made up of serialized object.
ServiceBuilder A ServiceBuilder is responsible for building Service objects from Configuration objects.
TypeBuilder A TypeBuilder is responsible for building Type objects from Configuration objects.
XMLLegacyCreator Handles internalization of a legacy Phoenix XML based description of a Type from a Configuration object.
XMLServiceCreator Utility class the handles the internalization of an XML description of a service into a Service instance.
XMLTypeCreator Handles internalization of an XML based description of a Type from a Configuration object.
 

Exception Summary
BuildException Exception to indicate error building meta object.
 

Package org.apache.avalon.meta.info.builder Description

Resources supporting the creation of a Type instance from a serialized form.

External Form (XML)

Configuration instances supplied to the builder shall correspond to the Type DTD. The structure of a component-info XML document is is described below:


<!--
Example of a component meta info external XML form. 
The element contains the information required to construct an instance of
org.apache.avalon.meta.info.Type.  It includes 
information about the component type, the service it provides, and the 
services it is dependent on.
-->

<type>


  <!--
  Defintion of a single component descriptor.
  -->

  <info>

    <!-- the name of the component (character restriction appply) -->

    <name>my-component</name>

    <!-- the implementation version -->

    <version>1.2.1</version>

    <lifestyle>singleton</lifestyle>

    <!-- the set of attribibutes associated with the type
         (attribute names and values are examples only) -->

    <attributes>

       <attribute key="color" value="blue"/>
       <attribute key="speed" value="fast"/>

    </attributes>

  </info>

  <!--
  The set of logging catagories the component uses. 
  -->

  <loggers>

    <logger name="store"/>
    <logger name="store.cache"/>
    <logger name="verifier"/>

  </loggers>


  <!-- 
  Declaration of the context constraints for the compoent type. 
  The "type" attribute is the name of an interface derived from the default
  contenxt interface org.apache.avalon.framework.context.Context 
  -->

  <context type="MyContextInterface">

    <!-- 
    Declaration of an entry in a context object, the "key" is
    the key used by a component to locate the context entry,
    the "type" is the classname of value (typically an interface)
    or primative type.  The default value is java.lang.String.
    The "optional" attribute is a boolean value derived from the 
    TRUE or FALSE that indicates if the context value must be 
    provided or not (default is FALSE). 
    -->

    <entry key="base" type="java.io.File"/>
    <entry key="mode" optional="TRUE"/>

  </context>

  <!--
  Declaration of the set of services that this component is capable 
  of supplying.  Each service declarared under the services element
  may be referenced by other component info descriptions as a 
  dependecy.  A container is responsible for the assemably of 
  components based on the connection of supply components to 
  consumer components via a common service description. 
  -->

  <services>

      <!-- 
      The service type is the classname of an interface and the
      version identifier qualifes the interface version.  The 
      default version value is 1.0.
      -->

      <service>

        <reference type="SimpleService" version="3.2">

        <attributes>

           <!--
           Service type attributes go here.
           Need some relevant examples. 
           -->

        </attributes>

      </service>

  </services>


  <!-- 
  Declaration of the set of dependecies that this component type has on 
  component suppliers.  Dependency declarations define the role name 
  that the component will use to access a service via a service
  or component manager.  The service element identifies a service 
  descriptor that is publised by a potential supplier component. 
  A dependecy may be declared as optional by setting the optional 
  attribute value to TRUE.  The default value for optional is FALSE.
  -->

  <dependencies>

    <!-- 
    A dependecy declaration. In the following example the optional 
    attribute is redundant as it is equivalent to the default value
    but is included here for completness.
    -->

    <dependency optional="FALSE">

      <!-- 
      The role name that the component will use as the argument to 
      lookup. The default value is the value of the service type 
      attribute listed below.
      -->

      <role>my-transformer</role>

      <!-- 
      service reference containing the classname of the service interface
      and the version value where version defaults to 1.0 
      -->

      <reference type="org.apache.cocoon.api.Transformer" version="1.1"/>

      <!-- the set of attributes associated with the dependecy -->

      <attributes>

           <!-- 
           Service type constraints go here.
           Need some relevant examples. 
           -->

      </attributes>

    </dependency>

  </dependencies>

</type>



Copyright © Apache Software Foundation. All Rights Reserved.