The Avalon ServiceManager

The ServiceManager is part of the Avalon Framework. It replaces the deprecated ComponentManager used in ECM. The basic interface is as follows:

package org.apache.avalon.framework.service;

public interface ServiceManager
{

    Object lookup( String key ) throws ServiceException;

    boolean hasService( String key );

    void release( Object object );
}

see javadocs for more detailed information.

Supported Lookup Conventions

Given:

   Service Interface = org.my.project.MyService
   MyService.ROLE = "org.my.project.MyService"
   Service Implementation #1 = org.my.project.impl.ServiceImplOne
   Service Implementation #1 Alias = "serviceOne"
   Service Implementation #2 = org.my.project.impl.ServiceImplTwo
   Service Implementation #2 Alias = "serviceTwo"

lookup(error)

Returns

ECM

Fortress

Phoenix

Merlin

Comments

org.my.project.MyService

ServiceSelector

(tick)

 

 

 

 

org.my.project.MyService

either 'serviceOne' or 'serviceTwo'

 

(tick)

(tick)

(tick)

 

org.my.project.MyServiceSelector

ServiceSelector

(tick)

(tick)

(tick)

 

 

org.my.project.MyService/serviceOne

serviceOne

 

(tick)

 

 

 

org.my.project.MyService/serviceTwo

serviceTwo

 

(tick)

 

 

 

serviceOne

serviceOne

 

(tick)

(tick)

(tick)

 

serviceTwo

serviceTwo

 

(tick)

(tick)

(tick)

 

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="628002c0-3065-44e8-abae-145d02c8496d"><ac:plain-text-body><![CDATA[

org.my.project.MyService[]

java.util.List(question)

 

 

(tick)

 

A list of all the implementations

]]></ac:plain-text-body></ac:structured-macro>

org.my.project.MyService

java.util.Map

 

 

(tick)

 

A Map of all implemenations with their aliases as keys

  • No labels