7.1.3.1. Components

A service component is defined in the configuration.xml file by using <component> element.

There is only one required information when defining a service - the service implementation class, specified using <type>

Every component has a <key> that identifies it. If not explicitly set, a key defaults to the value of <type>. If the key is loaded as a class, the Class or String object will be used as a key.

The usual approach is to specify an interface as a key.

Example 7.1. Example of service component configuration:



<?xml version="1.0" encoding="ISO-8859-1"?>
<configuration
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd
                          http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
      xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
   <component>
      <key>org.exoplatform.services.database.HibernateService</key>
      <type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>

      ...

   </component>
</configuration>
      

Copyright ©2012. All rights reserved. eXo Platform SAS