org.apache.hivemind.definition
Interface ContributionContext

All Superinterfaces:
ConstructionContext

public interface ContributionContext
extends ConstructionContext

Context for execution of a Contribution. Allows to manipulate a configuration from a Contribution. The new contribution can be merged with the existing configuration data or the data may be changed or replaced.

Author:
Huegen

Method Summary
 java.lang.Object getConfigurationData()
           
 ConfigurationPoint getConfigurationPoint()
           
 void mergeContribution(java.lang.Object contributionData)
          Merges contribution data with the data already provided by other contributions.
 void setConfigurationData(java.lang.Object data)
          Replaces all configuration data with data.
 
Methods inherited from interface org.apache.hivemind.definition.ConstructionContext
containsService, getConfiguration, getDefiningModule, getRegistry, getService, getService
 

Method Detail

getConfigurationPoint

ConfigurationPoint getConfigurationPoint()
Returns:
the configuration point that is currently constructed

getConfigurationData

java.lang.Object getConfigurationData()
Returns:
the configuration data already provided by other contributions that were processed before. Null, if no data has be contributed before.

setConfigurationData

void setConfigurationData(java.lang.Object data)
Replaces all configuration data with data. Overrides data provided by other contributions so should only be called when getConfigurationData() returns null.

Parameters:
data - the data

mergeContribution

void mergeContribution(java.lang.Object contributionData)
Merges contribution data with the data already provided by other contributions. Automatic merging works for standard collections only. Handles the case that no data has been provided before (getConfigurationData() returns null)

Parameters:
contributionData - the data to merge. Must be compatible with the type of the configuration.


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.