org.mmbase.framework
Interface Component

All Known Implementing Classes:
BasicComponent, SearchRelateComponent

public interface Component

A component is a piece of pluggable functionality that typically has dependencies on other components. A Component bundles Blocks, Actions and Settings. Component instances can be obtained using ComponentRepository.

Since:
MMBase-1.9
Version:
$Id: Component.java 39192 2009-10-18 07:53:58Z michiel $
Author:
Michiel Meeuwissen

Method Summary
 void configure(Element element)
          Configures the component, by XML.
 Map<String,Action> getActions()
          A component may also define extra 'actions'.
 Block getBlock(String name)
          Gets a specific block.
 Collection<Block> getBlocks()
          An unmodifiable collection of all blocks associated with the component
 String getBundle()
          The baseName of the resource bundle associated with i18n messages for this component.
 Block getDefaultBlock()
          Gets the one block that is the 'default' block of this component
 Collection<Component> getDependencies()
          All (satisfied) depedencies of this Component.
 LocalizedString getDescription()
          The description can contain further information about the component, mainly to be displayed in pages about components generally.
 String getName()
          Every component has a (universally) unique name
 Setting<?> getSetting(String name)
          Retrieves a setting (a definition, not a value; for that, use Framework.getSettingValue(Setting, Parameters)) with a certain name.
 Collection<Setting<?>> getSettings()
          An unmodifiable collection of all settings associated with this component
 Collection<VirtualComponent> getUnsatisfiedDependencies()
          The unsatisfied dependencies, so this should return an empty collection.
 URI getUri()
          An URI which may identify the configuration of this Component.
 float getVersion()
          A component has a version number.
 void resolve(VirtualComponent unsatified, Component satisfied)
          Used during bootstrapping.
 

Method Detail

getName

String getName()
Every component has a (universally) unique name


getVersion

float getVersion()
A component has a version number.


getDependencies

Collection<Component> getDependencies()
All (satisfied) depedencies of this Component. See als getUnsatisfiedDependencies().


getUnsatisfiedDependencies

Collection<VirtualComponent> getUnsatisfiedDependencies()
The unsatisfied dependencies, so this should return an empty collection. Unless the framework is still initializing, because initially dependencies can be temporary added as 'unsatisfied' because perhaps this other component is simply not yet loaded. The ComponentRepository will call resolve(VirtualComponent, Component) when a dependency is satisfied after all.


resolve

void resolve(VirtualComponent unsatified,
             Component satisfied)
Used during bootstrapping. Marks an unsatisfied dependency as satisfied. Moves object from the result of getUnsatisfiedDependencies() to getDependencies().

Parameters:
unsatified - The VirtualComponent object that used to be unsatisfied
satisfied - The object representing the same component, but now as an actual Component.

getDescription

LocalizedString getDescription()
The description can contain further information about the component, mainly to be displayed in pages about components generally.


getUri

URI getUri()
An URI which may identify the configuration of this Component.


configure

void configure(Element element)
Configures the component, by XML.

Parameters:
element - A 'component' element from the 'components' XSD.

getBlocks

Collection<Block> getBlocks()
An unmodifiable collection of all blocks associated with the component


getBlock

Block getBlock(String name)
Gets a specific block. If there is no such block, then null is returned.

Parameters:
name - The name of the block. If this parameter is null, then getDefaultBlock() can be returned.

getDefaultBlock

Block getDefaultBlock()
Gets the one block that is the 'default' block of this component


getBundle

String getBundle()
The baseName of the resource bundle associated with i18n messages for this component. See ResourceBundle.getBundle(String, Locale). The framework should decorate the request with this like fmt:bundle would do before rendinger a block.


getSettings

Collection<Setting<?>> getSettings()
An unmodifiable collection of all settings associated with this component


getSetting

Setting<?> getSetting(String name)
Retrieves a setting (a definition, not a value; for that, use Framework.getSettingValue(Setting, Parameters)) with a certain name. Or null if no such setting in this component.


getActions

Map<String,Action> getActions()
A component may also define extra 'actions'.



MMBase 2.0-SNAPSHOT - null