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 |
Returns |
ECM |
Fortress |
Phoenix |
Merlin |
Comments |
||
|
|
|
|
|
|
|||
|
either 'serviceOne' or 'serviceTwo' |
|
|
|
|
|
||
|
|
|
|
|
|
|||
|
serviceOne |
|
|
|
|
|
||
|
serviceTwo |
|
|
|
|
|
||
|
serviceOne |
|
|
|
|
|
||
|
serviceTwo |
|
|
|
|
|
||
<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[ |
|
java.util.List |
|
|
|
|
A list of all the implementations |
]]></ac:plain-text-body></ac:structured-macro> |
|
java.util.Map |
|
|
|
|
A Map of all implemenations with their aliases as keys |