Expresso 5-6

com.jcorporate.expresso.kernel.internal
Class ContainerImplBase

java.lang.Object
  extended bycom.jcorporate.expresso.kernel.internal.ContainerImplBase
All Implemented Interfaces:
ComponentContainer
Direct Known Subclasses:
DefaultContainerImpl

public abstract class ContainerImplBase
extends Object
implements ComponentContainer

This class provides a basic implementation of the ComponentContainer interface. the majority of the information such as how container references are stored are implemented by the subclass

Since:
Expresso 5.1
Version:
$Revision: 1.6 $ on $Date: 2004/11/17 20:48:16 $
Author:
Michael Rimov

Constructor Summary
ContainerImplBase()
           
 
Method Summary
abstract  void addComponent(ExpressoComponent newComponent)
          To register the component for control by the Component Manager.
 void destroyContainer()
          Called when the container is to be destroyed
abstract  Map getChildComponents()
          Retrieves a list of instances of all contained ExpressoComponents.
 Containable getContainerComponent()
          Return the 'wrapped' container ExpressoComponent.
 ComponentContainer getParentContainer()
          Return the parent container
abstract  void installComponent(ExpressoComponent newComponent, InstallationOptions installOptions, InstallLog log)
          Install a component into the system.
abstract  boolean isComponentExists(String componentName)
          Query the container to see if a particular service name is installed in the system
abstract  ExpressoComponent locateComponent(String componentName)
          Locates an Expresso Service for use by a client.
abstract  void removeComponent(String componentName)
          Removes a component from this container.
 void setContainerComponent(Containable newComponent)
          Sets the nested component.
 void setParentContainer(ComponentContainer newParent)
          Set the parent container of this container
abstract  void uninstallComponent(String componentName, InstallationOptions installOptions, InstallLog log)
          Uninstalls the component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainerImplBase

public ContainerImplBase()
Method Detail

locateComponent

public abstract ExpressoComponent locateComponent(String componentName)
Locates an Expresso Service for use by a client.

Specified by:
locateComponent in interface ComponentContainer
Parameters:
componentName - the name of the service to locate.
Returns:
ExpressoService.
Throws:
IllegalArgumentException - if the service cannot be found.
IllegalStateException - if the service exists, but is not in a 'runnable' state due to some configuration error or other unforeseen issue.

isComponentExists

public abstract boolean isComponentExists(String componentName)
Query the container to see if a particular service name is installed in the system

Specified by:
isComponentExists in interface ComponentContainer
Parameters:
componentName - the name of the component to query for.
Returns:
true if the service is installed and running.

addComponent

public abstract void addComponent(ExpressoComponent newComponent)
To register the component for control by the Component Manager. This will in essense transfer the control of ther service to the Component Manager. This will often be called by the Configuration Bootstrap system.

Specified by:
addComponent in interface ComponentContainer
Parameters:
newComponent - the component to install

removeComponent

public abstract void removeComponent(String componentName)
Removes a component from this container.

Specified by:
removeComponent in interface ComponentContainer
Parameters:
componentName - The name of the component to remove.

installComponent

public abstract void installComponent(ExpressoComponent newComponent,
                                      InstallationOptions installOptions,
                                      InstallLog log)
Install a component into the system. If newComponent implements installable then it shall be installed. After that, the component is added.

Specified by:
installComponent in interface ComponentContainer
Parameters:
newComponent - An instance of the component to install.
log - a Logger-like interface to a component tha records the process of the installation including any errors, etc.
installOptions - the installation options

uninstallComponent

public abstract void uninstallComponent(String componentName,
                                        InstallationOptions installOptions,
                                        InstallLog log)
Uninstalls the component. If the component implements installable then it shall be uninstalled. After that, it shall be removed.

Specified by:
uninstallComponent in interface ComponentContainer
Parameters:
componentName - the name of the component to uninstall
log - a Logger-like interface to a component tha records the process of the installation including any errors, etc.
installOptions - the Installation Options bean

getChildComponents

public abstract Map getChildComponents()
Retrieves a list of instances of all contained ExpressoComponents. Use this for iterating through the components of a current 'context'. Do not attempt to modify the map given. Either add or remove a component through the addComponent or removeComponent methods.

Specified by:
getChildComponents in interface ComponentContainer
Returns:
Read only map of the components.

destroyContainer

public void destroyContainer()
Description copied from interface: ComponentContainer
Called when the container is to be destroyed

Specified by:
destroyContainer in interface ComponentContainer

getContainerComponent

public Containable getContainerComponent()
Return the 'wrapped' container ExpressoComponent.

Specified by:
getContainerComponent in interface ComponentContainer
Returns:
Containable

setContainerComponent

public void setContainerComponent(Containable newComponent)
Sets the nested component. This is usually called by the system factory.

Specified by:
setContainerComponent in interface ComponentContainer
Parameters:
newComponent - the component that is the 'container' for this implementation

getParentContainer

public ComponentContainer getParentContainer()
Return the parent container

Specified by:
getParentContainer in interface ComponentContainer
Returns:
ContainerImpl interface

setParentContainer

public void setParentContainer(ComponentContainer newParent)
Set the parent container of this container

Specified by:
setParentContainer in interface ComponentContainer
Parameters:
newParent - the new Parent Container

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.