001    package org.apache.maven.plugin;
002    
003    /*
004     * Licensed to the Apache Software Foundation (ASF) under one
005     * or more contributor license agreements.  See the NOTICE file
006     * distributed with this work for additional information
007     * regarding copyright ownership.  The ASF licenses this file
008     * to you under the Apache License, Version 2.0 (the
009     * "License"); you may not use this file except in compliance
010     * with the License.  You may obtain a copy of the License at
011     *
012     *   http://www.apache.org/licenses/LICENSE-2.0
013     *
014     * Unless required by applicable law or agreed to in writing,
015     * software distributed under the License is distributed on an
016     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017     * KIND, either express or implied.  See the License for the
018     * specific language governing permissions and limitations
019     * under the License.
020     */
021    
022    import java.util.List;
023    
024    import org.apache.maven.model.Plugin;
025    import org.apache.maven.plugin.descriptor.PluginDescriptor;
026    import org.sonatype.aether.RepositorySystemSession;
027    import org.sonatype.aether.repository.RemoteRepository;
028    
029    /**
030     * Caches raw plugin descriptors. A raw plugin descriptor is a descriptor that has just been extracted from the plugin
031     * artifact and does not contain any runtime specific data. The cache must not be used for descriptors that hold runtime
032     * data like the plugin realm. <strong>Warning:</strong> This is an internal utility interface that is only public for
033     * technical reasons, it is not part of the public API. In particular, this interface can be changed or deleted without
034     * prior notice.
035     * 
036     * @since 3.0
037     * @author Benjamin Bentmann
038     */
039    public interface PluginDescriptorCache
040    {
041    
042        /**
043         * A cache key.
044         */
045        interface Key
046        {
047            // marker interface for cache keys
048        }
049    
050        Key createKey( Plugin plugin, List<RemoteRepository> repositories, RepositorySystemSession session );
051    
052        void put( Key key, PluginDescriptor pluginDescriptor );
053    
054        PluginDescriptor get( Key key );
055    
056        void flush();
057    
058    }