|
Size: 1835
Comment:
|
← Revision 4 as of 2009-09-20 23:16:38 ⇥
Size: 1837
Comment: converted to 1.6 markup
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 19: | Line 19: |
| see [http://avalon.apache.org/framework/api/org/apache/avalon/framework/service/ServiceManager.html javadocs] for more detailed information. | see [[http://avalon.apache.org/framework/api/org/apache/avalon/framework/service/ServiceManager.html|javadocs]] for more detailed information. |
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(x) |
Returns |
ECM |
Fortress |
Phoenix |
Merlin |
Comments |
org.my.project.MyService |
|
|
|
|
|
|
org.my.project.MyService |
either 'serviceOne' or 'serviceTwo' |
|
|
|
|
|
org.my.project.MyServiceSelector |
|
|
|
|
|
|
org.my.project.MyService/serviceOne |
serviceOne |
|
|
|
|
|
org.my.project.MyService/serviceTwo |
serviceTwo |
|
|
|
|
|
serviceOne |
serviceOne |
|
|
|
|
|
serviceTwo |
serviceTwo |
|
|
|
|
|
org.my.project.MyService[] |
java.util.List(?) |
|
|
|
|
A list of all the implementations |
org.my.project.MyService{} |
java.util.Map |
|
|
|
|
A Map of all implemenations with their aliases as keys |