org.apache.avalon.fortress.impl.lookup
Class FortressServiceManager

java.lang.Object
  extended by org.apache.avalon.fortress.impl.lookup.FortressServiceManager
All Implemented Interfaces:
org.apache.avalon.framework.service.ServiceManager

public class FortressServiceManager
extends java.lang.Object
implements org.apache.avalon.framework.service.ServiceManager

This is the Default ServiceManager for the Container. It provides a very simple abstraction, and makes it easy for the Container to manage the references.

Version:
CVS $Revision: 1.22 $ $Date: 2004/03/13 17:57:59 $
Author:
Avalon Development Team

Nested Class Summary
private static class FortressServiceManager.Lookup
           
 
Field Summary
private  org.apache.avalon.fortress.Container m_container
           
private  org.apache.avalon.framework.service.ServiceManager m_parent
           
private  java.util.Map m_used
           
 
Constructor Summary
FortressServiceManager(org.apache.avalon.fortress.Container container, org.apache.avalon.framework.service.ServiceManager parent)
          This constructor is for a ContainerComponentManager with a parent ComponentLocator
 
Method Summary
 boolean hasService(java.lang.String role)
           
 java.lang.Object lookup(java.lang.String role)
           
private  FortressServiceManager.Lookup parseRole(java.lang.String role)
           
 void release(java.lang.Object component)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_container

private final org.apache.avalon.fortress.Container m_container

m_used

private final java.util.Map m_used

m_parent

private final org.apache.avalon.framework.service.ServiceManager m_parent
Constructor Detail

FortressServiceManager

public FortressServiceManager(org.apache.avalon.fortress.Container container,
                              org.apache.avalon.framework.service.ServiceManager parent)
                       throws java.lang.NullPointerException
This constructor is for a ContainerComponentManager with a parent ComponentLocator

Parameters:
container - the impl
parent - the parent service manager
Throws:
java.lang.NullPointerException - if the supplied impl is null
Method Detail

lookup

public java.lang.Object lookup(java.lang.String role)
                        throws org.apache.avalon.framework.service.ServiceException
Specified by:
lookup in interface org.apache.avalon.framework.service.ServiceManager
Throws:
org.apache.avalon.framework.service.ServiceException

hasService

public boolean hasService(java.lang.String role)
Specified by:
hasService in interface org.apache.avalon.framework.service.ServiceManager

release

public void release(java.lang.Object component)
Specified by:
release in interface org.apache.avalon.framework.service.ServiceManager

parseRole

private FortressServiceManager.Lookup parseRole(java.lang.String role)