Expresso 5-5-0

com.jcorporate.expresso.kernel
Interface Containable

All Superinterfaces:
ExpressoComponent, Serializable
All Known Subinterfaces:
RootContainerInterface
All Known Implementing Classes:
ContainerComponentBase, RootContainer

public interface Containable
extends ExpressoComponent

Containable is partially 'marker interface' much like java.lang.Serialiable. If a class implements Containable then the Expresso Runtime wraps it with a ComponentContainer interface. This way the Container implementation is fully pluggable without any of the components knowing about the implementation of their containers.

You use get/setContainerImplementation to get the container implementation that then allows you to navigate the heirarchy of components and component containers.

Since:
Expresso 5.1
Version:
$Revision: 1.4 $ on $Date: 2003/05/17 05:45:29 $
Author:
Michael Rimov

Method Summary
 ComponentContainer getContainerImplementation()
          Retrieves the actual container implementation
 ExpressoComponent locateComponent(String componentName)
          Convenience method for Container clients.
 void setContainerImplementation(ComponentContainer newContainer)
          Sets the marker to the ComponentContainer (which has a 1:1 instance mapping with Containable).
 
Methods inherited from interface com.jcorporate.expresso.kernel.ExpressoComponent
getMetaData, getParent, setParent
 

Method Detail

setContainerImplementation

public void setContainerImplementation(ComponentContainer newContainer)
Sets the marker to the ComponentContainer (which has a 1:1 instance mapping with Containable). This is often called by the actual implementation of the ComponentContainer.

Parameters:
newContainer - a ComponentCo

getContainerImplementation

public ComponentContainer getContainerImplementation()
Retrieves the actual container implementation

Returns:
ComponentContainer

locateComponent

public ExpressoComponent locateComponent(String componentName)

Convenience method for Container clients. Recommended Implementation:

ExpressoComponent getComponent(String componentName) {
   return this.getContainerImplementation().getComponent(componentName); }

Typical usage from an ExpressoComponent.

This example gets the default Data Context for a component within the context

DataContext default = (DataContext)this.getParent().locateComponent("default");

Parameters:
componentName - The name of the component to retrieve
Returns:
an ExpressoComponent or null if the specified name doesn't exist

Expresso 5-5-0

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