Problem

What are default components, and how are they used?

Solution

At deployment time, a component instance can be marked in the CDB as the default component of its type.

For example, the standard CDB entry for the identifier archive, which ships with ACS in $ACSDATA/config/defaultCDB/CDB/MACI/Components/Components.xml, is

<_ Name="IDENTIFIER_ARCHIVE"
   Code="alma.archive.helpers.IdentifierHelper"
   Type="IDL:alma/xmlstore/Identifier:1.0"
   Container="frodoContainer"
   Default="true"
/>

In the running system, a client can obtain this instance of the identifier archive, without having to know the instance name IDENTIFIER_ARCHIVE. It only has to provide the type code (IDL:alma/xmlstore/Identifier:1.0) that is independent of any particular deployment configuration.

Advantages:

  1. client code does not need to have an instance name hard-coded or configured as a start parameter. This is useful whenever the client does not require a particular instance of a component, but any instance will do.
    In the case of the identifier archive, the Java container uses the default instance to obtain unique IDs.
  2. when only the requested component type matters, the ACS Manager is free to return any instance of that component type, which allows for load balancing.

Use the method getDefaultComponent(String componentIDLType) from the ZLegacy/ACS.ContainerServices interface to take advantage of this feature.

-- HeikoSommer - 17 Feb 2004