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.definition;
016    
017    import java.util.Collection;
018    
019    import org.apache.hivemind.ClassResolver;
020    import org.apache.hivemind.Location;
021    
022    /**
023     * Defines a module of a {@link RegistryDefinition}. 
024     * A module has its own namespace in which configuration points and service
025     * points are defined.
026     * It can provide extension to extension points in other modules.
027     * 
028     * @author Huegen
029     */
030    public interface ModuleDefinition
031    {
032        /**
033         * @return  the id of the module. It can contain dots.
034         */
035        public String getId();
036        
037        /**
038         * @return  the {@link ClassResolver} used to resolve all classes referenced from 
039         *          elements inside this module.
040         */
041        public ClassResolver getClassResolver();
042    
043        /** 
044         * @return the location of the module
045         */
046        public Location getLocation();
047    
048        /**
049         * Returns the name of the package to search for class names within. By default, the package
050         * name will match the module id.
051         */
052        public String getPackageName();
053    
054        /**
055         * Returns a service point that is identified by its id.
056         * @param id  the service point id (unqualified, without module id)
057         * @return the service point definition
058         */
059        public ServicePointDefinition getServicePoint(String id);
060    
061        /**
062         * @return  all {@link ServicePointDefinition service points} defined in this module
063         */
064        public Collection getServicePoints();
065    
066        /**
067         * Returns a configuration point that is identified by its id.
068         * @param id  the configuration point id (unqualified, without module id)
069         * @return the configuration point definition
070         */
071        public ConfigurationPointDefinition getConfigurationPoint(String id);
072    
073        /**
074         * @return  all {@link ConfigurationPointDefinition configuration points} defined in this module
075         */
076        public Collection getConfigurationPoints();
077    
078        /**
079         * @return  the ids of all modules this module depends on
080         */
081        public Collection getDependencies();
082        
083        /**
084         * @return  all {@link ImplementationDefinition implementations} contained in this module
085         */
086        public Collection getImplementations();
087    
088        /**
089         * @return  all {@link InterceptorDefinition interceptors} contained in this module
090         */
091        public Collection getInterceptors();
092    
093        /**
094         * @return  all {@link ContributionDefinition contributions}  contained in this module.
095         */
096        public Collection getContributions();
097    
098        /**
099         * @return  all {@link ConfigurationParserDefinition parsers}  contained in this module
100         */
101        public Collection getConfigurationParsers();
102    
103    }