org.apache.hivemind.impl
Class ConfigurationPointImpl

java.lang.Object
  |
  +--org.apache.hivemind.impl.BaseLocatable
        |
        +--org.apache.hivemind.impl.AbstractExtensionPoint
              |
              +--org.apache.hivemind.impl.ConfigurationPointImpl
All Implemented Interfaces:
ConfigurationPoint, ExtensionPoint, Locatable, LocationHolder

public final class ConfigurationPointImpl
extends AbstractExtensionPoint
implements ConfigurationPoint

Implementation of the ConfigurationPointinterface; a container for Contributions.

Author:
Howard Lewis Ship

Constructor Summary
ConfigurationPointImpl()
           
 
Method Summary
 void addContribution(Contribution c)
           
 boolean canElementsBeMapped()
          Returns true if the elements contributed to this configuration point can be retrieved as a Map.
protected  void extendDescription(ToStringBuilder builder)
          Implemented in subclasses to provide details about subclass properties.
 int getContributionCount()
          Returns the number of contributions; it is expected that each top-level Elementin each Contributionwill convert to one element instance; the value returned is the total number of top-level elements in all contributed Extensions.
 Schema getContributionsSchema()
          Returns the Schema for contributions to the configuration point (which may be null if the point does not define a schema for contributions).
 java.util.List getElements()
          Returns the contributed elements as an unmodifiable List.
 Occurances getExpectedCount()
           
 java.util.Map getMappedElements()
          Returns the contributed elements as an unmodifiable Map.
 Schema getSchema()
           
 void setContributionsSchema(Schema schema)
           
 void setExpectedCount(Occurances occurances)
           
 void setShutdownCoordinator(ShutdownCoordinator coordinator)
           
 
Methods inherited from class org.apache.hivemind.impl.AbstractExtensionPoint
getErrorLog, getExtensionPointId, getLog, getModule, setExtensionPointId, setModule, setVisibility, toString, visibleToModule
 
Methods inherited from class org.apache.hivemind.impl.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.hivemind.internal.ExtensionPoint
getErrorLog, getExtensionPointId, getLog, getModule, visibleToModule
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Constructor Detail

ConfigurationPointImpl

public ConfigurationPointImpl()
Method Detail

extendDescription

protected void extendDescription(ToStringBuilder builder)
Description copied from class: AbstractExtensionPoint
Implemented in subclasses to provide details about subclass properties.

Specified by:
extendDescription in class AbstractExtensionPoint

getContributionCount

public int getContributionCount()
Returns the number of contributions; it is expected that each top-level Elementin each Contributionwill convert to one element instance; the value returned is the total number of top-level elements in all contributed Extensions.


addContribution

public void addContribution(Contribution c)

getExpectedCount

public Occurances getExpectedCount()

setExpectedCount

public void setExpectedCount(Occurances occurances)

getElements

public java.util.List getElements()
Returns the contributed elements as an unmodifiable List. Internally, a proxy to the real list is returned, such that the real list may not be constructed until actually needed.

Specified by:
getElements in interface ConfigurationPoint

canElementsBeMapped

public boolean canElementsBeMapped()
Description copied from interface: ConfigurationPoint
Returns true if the elements contributed to this configuration point can be retrieved as a Map. The contributions in the map are keyed on an attribute as specified by the contributions schema. Thus, as a requirement, this configuration point must have a defined schema, which in turn must support keying of all valid instances.

Specified by:
canElementsBeMapped in interface ConfigurationPoint

getMappedElements

public java.util.Map getMappedElements()
Returns the contributed elements as an unmodifiable Map. Internally, a proxy to the real map is returned, such that the real map may not be constructed until actually needed.

Specified by:
getMappedElements in interface ConfigurationPoint

getSchema

public Schema getSchema()

setContributionsSchema

public void setContributionsSchema(Schema schema)

getContributionsSchema

public Schema getContributionsSchema()
Description copied from interface: ConfigurationPoint
Returns the Schema for contributions to the configuration point (which may be null if the point does not define a schema for contributions).

Specified by:
getContributionsSchema in interface ConfigurationPoint

setShutdownCoordinator

public void setShutdownCoordinator(ShutdownCoordinator coordinator)