Service Defintion

The org.apache.avalon.meta.info.ServiceDefinition class describes a type of service. It suppliments the classic Java interface with a version identifier and attributes. A ServiceDefintion may be referenced by multiple components that will typically suppliment the defintion in terms of additional attributes. References to a ServiceDefintion concern a component type declaration of depedencies, service access points, lifestyle extension ability, and lifestyle extension depedencies.

An instance of ServiceDescriptor is created using a ServiceBuilder. The following code fragment shows the creation of new ServiceBuilder and the creation of a ServiceDefinition using the builder.

  //
  // create the builder
  //

  ServiceBuilder builder = new ServiceBuilder();
  builder.enableLogging( m_loger );

  //
  // create the service defintion
  //

  ServiceDefinition defintion = builder.build( this.class() );

XML Schema


  <!--
  Example of a service defintion.
  -->

  <service>

    <!--
    Declaration of a service version.
    -->

    <version>3.2</version>
    
    <attributes>

      <!--
      Attribute declarations included in a service defintion
      are independent of a particular service implementation.
      -->

      <attribute key="a-key" value="a-value"/>

    </attributes>

  </service>