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 018 package org.apache.geronimo.kernel.repository; 019 020 import java.io.File; 021 import java.util.LinkedHashSet; 022 023 /** 024 * Provides access to things like JARs via a standard API. This is 025 * a fairly limited read-only type repository. There are additional 026 * interfaces that a Repository may implement to indicate additional 027 * capabilities. 028 * 029 * @version $Rev: 476049 $ $Date: 2006-11-16 23:35:17 -0500 (Thu, 16 Nov 2006) $ 030 */ 031 public interface Repository { 032 /** 033 * Checks whether this repository contains an entry for the specified 034 * artifact. The artifact must be fully resolved (isResolved() == true). 035 */ 036 boolean contains(Artifact artifact); 037 038 /** 039 * Gets the location on disk where the specified artifact is stored. 040 * The artifact must be fully resolved (isResolved() == true). 041 * 042 * @return The location of the artifact, or null if it is not in this 043 * repository. 044 */ 045 File getLocation(Artifact artifact); 046 047 /** 048 * Loads any dependencies for this artifact declared in 049 * META-INF/geronimo-dependency.xml within the configuration archive. This 050 * does not do anything special if the artifact is a configuration (which 051 * means it doesn't see dependencies in the ConfigurationData, etc.) so 052 * it's mainly useful for JAR-type artifacts. 053 * 054 * @param artifact A fully-resolved artifact representing the repository 055 * entry you're interested in. 056 * 057 * @return a LinkedHashSet (with elements of type Artifact) listing any 058 * dependencies declared in META-INF/geronimo-dependency.xml for the 059 * specified artifact. 060 */ 061 LinkedHashSet getDependencies(Artifact artifact); 062 }