KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > definition > ContributionContext


1 // Copyright 2007 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.hivemind.definition;
16
17 import org.apache.hivemind.internal.ConfigurationPoint;
18
19 /**
20  * Context for execution of a {@link Contribution}.
21  *
22  * Allows to manipulate a configuration from a {@link Contribution}.
23  * The new contribution can be merged with the existing configuration data or
24  * the data may be changed or replaced.
25  *
26  * @author Huegen
27  */

28 public interface ContributionContext extends ConstructionContext
29 {
30     /**
31      * @return the configuration point that is currently constructed
32      */

33     public ConfigurationPoint getConfigurationPoint();
34     
35     /**
36      * @return the configuration data already provided by other contributions that were processed before.
37      * Null, if no data has be contributed before.
38      */

39     public Object JavaDoc getConfigurationData();
40     
41     /**
42      * Replaces all configuration data with <code>data</code>. Overrides data provided by other contributions
43      * so should only be called when getConfigurationData() returns null.
44      *
45      * @param data the data
46      */

47     public void setConfigurationData(Object JavaDoc data);
48     
49     /**
50      * Merges contribution data with the data already provided by other contributions.
51      * Automatic merging works for standard collections only.
52      * Handles the case that no data has been provided before (getConfigurationData() returns null)
53      *
54      * @param contributionData the data to merge. Must be compatible with the type of the configuration.
55      */

56     public void mergeContribution(Object JavaDoc contributionData);
57 }
58
Popular Tags