001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.servicemix.common.packaging;
018    
019    import java.io.File;
020    import java.util.List;
021    
022    /**
023     * Provides a interface that components can implement, if they implement this
024     * interface and expose the name of the analyzer in their Maven Project Object
025     * Model then the tooling can use this to analyze a Service Unit for the
026     * component during packaging to generate the consumes and provides elements for
027     * the service unit's jbi.xml
028     * 
029     * @author Philip Dodds
030     * @version $Revision: 426415 $
031     * @since 3.0
032     * 
033     * @see Consumes, {@link Consumes}
034     * @see Provides, {@link Provides}
035     */
036    public interface ServiceUnitAnalyzer {
037    
038            /**
039             * Initializes the analyzer based on the root directory of an exploded
040             * service unit
041             * 
042             * @param explodedServiceUnitRoot
043             */
044            public void init(File explodedServiceUnitRoot);
045    
046            /**
047             * Returns a list of Consumes representing the service unit being analyzed
048             * 
049             * @return A list of Consumes
050             */
051            public List getConsumes();
052    
053            /**
054             * Returns a list of Provides representing the service unit being analyzed
055             * 
056             * @return A list of provides
057             */
058            public List getProvides();
059    
060    }