1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 */ 19 20 package org.apache.geronimo.gshell.artifact; 21 22 import org.apache.geronimo.gshell.artifact.transfer.TransferListener; 23 24 import java.util.Collection; 25 26 /** 27 * Provides resolution of artifacts. 28 * 29 * @version $Rev: 721786 $ $Date: 2008-11-30 09:23:05 +0100 (Sun, 30 Nov 2008) $ 30 */ 31 public interface ArtifactResolver 32 { 33 /** 34 * Install a transfer listener. 35 */ 36 void setTransferListener(TransferListener listener); 37 38 /** 39 * Resolve a request. 40 */ 41 Result resolve(Request request) throws Failure; 42 43 /** 44 * Artifact resolution request. 45 */ 46 class Request 47 { 48 /** 49 * Artifact filter. 50 */ 51 public ArtifactFilter filter; 52 53 /** 54 * Originating artifact. 55 */ 56 public Artifact artifact; 57 58 /** 59 * Dependency artifacts. 60 */ 61 public Collection<Artifact> artifacts; 62 } 63 64 /** 65 * Artifact resolution result. 66 */ 67 class Result 68 { 69 /** 70 * Resolved artifacts. 71 */ 72 public Collection<Artifact> artifacts; 73 } 74 75 /** 76 * Artifact resolution failure. 77 */ 78 class Failure 79 extends Exception 80 { 81 private static final long serialVersionUID = 1; 82 83 public Failure(final String msg) { 84 super(msg); 85 } 86 87 public Failure(final String msg, final Throwable cause) { 88 super(msg, cause); 89 } 90 91 public Failure(final Throwable cause) { 92 super(cause); 93 } 94 95 public Failure() { 96 super(); 97 } 98 } 99 }