net.israfil.micro.container
Interface Container

All Known Subinterfaces:
AutoWiringAdaptableContainer
All Known Implementing Classes:
AbstractContainer, DefaultAutoWiringAdaptableContainer

public interface Container

A container for components that will satisfy requests if the component is available. How these component requests are satisfied are implementation dependent, as well as how inter-component dependencies are resolved.

Author:
Christian Edward Gruber

Method Summary
 java.lang.Object getComponent(java.lang.Object key)
          Returns the component named by the key if it is available, or null if no such component is available.
 boolean hasComponent(java.lang.Object key)
          Returns true if the Component is available and prepared.
 boolean isRunning()
          Returns true if the container has been started, and false if it has not been started.
 void start()
          Begin the lifecycle of the container, after which components should be accessible.
 

Method Detail

hasComponent

boolean hasComponent(java.lang.Object key)
Returns true if the Component is available and prepared. It throws a ContainerNotStarted runtime exception if the this method is used before the container is started. This method must be implemented by implementors of Container in a thread-safe and reentrant way.


getComponent

java.lang.Object getComponent(java.lang.Object key)
Returns the component named by the key if it is available, or null if no such component is available. It throws a ContainerNotStarted runtime exception if this method is used before the container is started. This method must be implemented by implementors of Container in a thread-safe and reentrant way.


start

void start()
Begin the lifecycle of the container, after which components should be accessible. Implementors should stop any component registration as of the start() call. Subsequent start() calls should be ignored.


isRunning

boolean isRunning()
Returns true if the container has been started, and false if it has not been started.



Copyright © 2008. All Rights Reserved.