001    // Copyright 2007 The Apache Software Foundation
002    //
003    // Licensed under the Apache License, Version 2.0 (the "License");
004    // you may not use this file except in compliance with the License.
005    // You may obtain a copy of the License at
006    //
007    //     http://www.apache.org/licenses/LICENSE-2.0
008    //
009    // Unless required by applicable law or agreed to in writing, software
010    // distributed under the License is distributed on an "AS IS" BASIS,
011    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012    // See the License for the specific language governing permissions and
013    // limitations under the License.
014    
015    package org.apache.hivemind.impl;
016    
017    import org.apache.hivemind.ErrorHandler;
018    import org.apache.hivemind.definition.RegistryDefinition;
019    
020    /**
021     * A registry provider contributes module definitions to a {@link RegistryDefinition}.
022     * It must be implemented to participate in the registry autoloading mechanism
023     * triggered by {@link RegistryBuilder#autoDetectModules()} and described in 
024     * {@link RegistryProviderAutoDetector}.
025     * The implementations must have a no arguments constructor.
026     * 
027     * @author Achim Huegen
028     */
029    public interface RegistryProvider
030    {
031        /**
032         * Called during the registry definition phase, before the registry is constructed.
033         * New module definitions can be added to the registry and existing can be altered.
034         * 
035         * @param registryDefinition  the registry definition 
036         * @param errorHandler  an error handler to call when errors occur.
037         */
038        public void process(RegistryDefinition registryDefinition, ErrorHandler errorHandler);
039        
040    }