View Javadoc

1   package org.sonatype.aether.connector.wagon;
2   
3   /*******************************************************************************
4    * Copyright (c) 2010-2011 Sonatype, Inc.
5    * All rights reserved. This program and the accompanying materials
6    * are made available under the terms of the Eclipse Public License v1.0
7    * which accompanies this distribution, and is available at
8    *   http://www.eclipse.org/legal/epl-v10.html
9    *******************************************************************************/
10  
11  import org.apache.maven.wagon.Wagon;
12  
13  /**
14   * A component to acquire and release wagon instances for uploads/downloads.
15   * 
16   * @author Benjamin Bentmann
17   */
18  public interface WagonProvider
19  {
20  
21      /**
22       * Acquires a wagon instance that matches the specified role hint. The role hint is derived from the URI scheme,
23       * e.g. "http" or "file".
24       * 
25       * @param roleHint The role hint to get a wagon for, must not be {@code null}.
26       * @return The requested wagon instance, never {@code null}.
27       * @throws Exception If no wagon could be retrieved for the specified role hint.
28       */
29      Wagon lookup( String roleHint )
30          throws Exception;
31  
32      /**
33       * Releases the specified wagon. A wagon provider may either free any resources allocated for the wagon instance or
34       * return the instance back to a pool for future use.
35       * 
36       * @param wagon The wagon to release, may be {@code null}.
37       */
38      void release( Wagon wagon );
39  
40  }