org.apache.avalon.excalibur.container
Class AbstractContainer

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLoggable
        |
        +--org.apache.avalon.excalibur.container.AbstractContainer
All Implemented Interfaces:
org.apache.avalon.framework.component.Component, Container, org.apache.avalon.framework.logger.Loggable

public abstract class AbstractContainer
extends org.apache.avalon.framework.logger.AbstractLoggable
implements Container

This contains it during execution and may provide certain facilities (like a thread per EJB etc).

Author:
Peter Donald

Fields inherited from interface org.apache.avalon.excalibur.container.Container
ROLE
 
Constructor Summary
AbstractContainer()
           
 
Method Summary
 void add(java.lang.String name, Entry entry)
          Add a component instance to container.
protected  void checkEntry(java.lang.String name, Entry entry)
           
 Entry getEntry(java.lang.String name)
          Retrieve Entry from container
protected  int getEntryCount()
           
 java.lang.String[] list()
          List all names of entries in container.
protected  java.util.Iterator listEntries()
          List all entries in container.
protected  void postAdd(java.lang.String name, Entry entry)
          This method is called after entry is added to give chance for sub-class to do some cleanup.
protected  void postRemove(java.lang.String name, Entry entry)
          This method is called after entry is removed to give chance for sub-class to do some cleanup.
protected  void preAdd(java.lang.String name, Entry entry)
          This method is called before entry is added to give chance for sub-class to veto removal.
protected  void preRemove(java.lang.String name, Entry entry)
          This method is called before entry is removed to give chance for sub-class to veto removal.
 void remove(java.lang.String name)
          Remove a component instance from container.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable
getLogger, setLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractContainer

public AbstractContainer()
Method Detail

add

public final void add(java.lang.String name,
                      Entry entry)
               throws ContainerException
Add a component instance to container.
Specified by:
add in interface Container
Parameters:
entry - the component entry

remove

public final void remove(java.lang.String name)
                  throws ContainerException
Remove a component instance from container.
Specified by:
remove in interface Container
Parameters:
name - the name of component

getEntry

public Entry getEntry(java.lang.String name)
               throws ContainerException
Retrieve Entry from container
Specified by:
getEntry in interface Container
Parameters:
name - the name of entry
Returns:
the entry

list

public final java.lang.String[] list()
List all names of entries in container.
Specified by:
list in interface Container
Returns:
the list of all entries

preAdd

protected void preAdd(java.lang.String name,
                      Entry entry)
               throws ContainerException
This method is called before entry is added to give chance for sub-class to veto removal.
Parameters:
name - the name of entry
entry - the entry
Throws:
ContainerException - to stop removal of entry

postAdd

protected void postAdd(java.lang.String name,
                       Entry entry)
This method is called after entry is added to give chance for sub-class to do some cleanup.
Parameters:
name - the name of entry
entry - the entry

preRemove

protected void preRemove(java.lang.String name,
                         Entry entry)
                  throws ContainerException
This method is called before entry is removed to give chance for sub-class to veto removal.
Parameters:
name - the name of entry
entry - the entry
Throws:
ContainerException - to stop removal of entry

postRemove

protected void postRemove(java.lang.String name,
                          Entry entry)
This method is called after entry is removed to give chance for sub-class to do some cleanup.
Parameters:
name - the name of entry
entry - the entry

listEntries

protected final java.util.Iterator listEntries()
List all entries in container.
Returns:
the list of all entries

getEntryCount

protected final int getEntryCount()

checkEntry

protected void checkEntry(java.lang.String name,
                          Entry entry)
                   throws ContainerException


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.