Author: ogusakov Date: Tue May 5 04:22:22 2009 New Revision: 771552 URL: http://svn.apache.org/viewvc?rev=771552&view=rev Log: [MERCURY-124] - source format
Modified: maven/mercury/trunk/mercury-core/src/main/java/org/apache/maven/mercury/spi/http/client/DefaultHttpClientPool.java maven/mercury/trunk/mercury-core/src/main/java/org/apache/maven/mercury/spi/http/client/HttpClientPool.java maven/mercury/trunk/mercury-core/src/main/java/org/apache/maven/mercury/spi/http/client/HttpClientPoolException.java Modified: maven/mercury/trunk/mercury-core/src/main/java/org/apache/maven/mercury/spi/http/client/DefaultHttpClientPool.java URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-core/src/main/java/org/apache/maven/mercury/spi/http/client/DefaultHttpClientPool.java?rev=771552&r1=771551&r2=771552&view=diff ============================================================================== --- maven/mercury/trunk/mercury-core/src/main/java/org/apache/maven/mercury/spi/http/client/DefaultHttpClientPool.java (original) +++ maven/mercury/trunk/mercury-core/src/main/java/org/apache/maven/mercury/spi/http/client/DefaultHttpClientPool.java Tue May 5 04:22:22 2009 @@ -15,56 +15,46 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -*/ + */ package org.apache.maven.mercury.spi.http.client; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.concurrent.ConcurrentMap; -import org.apache.maven.mercury.artifact.api.ConfigurationException; -import org.apache.maven.mercury.crypto.pgp.PgpStreamVerifier; import org.codehaus.plexus.lang.DefaultLanguage; import org.codehaus.plexus.lang.Language; import org.mortbay.jetty.client.HttpClient; /** - * - * * @author Oleg Gusakov * @version $Id$ - * */ public class DefaultHttpClientPool implements HttpClientPool { private static final Language LANG = new DefaultLanguage( DefaultHttpClientPool.class ); - private static int _poolSize = DEFAULT_POOL_SIZE; - - private static ConcurrentLinkedQueue<HttpClient> _pool = new ConcurrentLinkedQueue<HttpClient>(); - + private static int _poolSize = DEFAULT_POOL_SIZE; + + private static ConcurrentLinkedQueue<HttpClient> _pool = new ConcurrentLinkedQueue<HttpClient>(); + public DefaultHttpClientPool() { - this( DEFAULT_POOL_SIZE); + this( DEFAULT_POOL_SIZE ); } - + public DefaultHttpClientPool( int sz ) { - for( int i=0; i<sz; i++ ) + for ( int i = 0; i < sz; i++ ) _pool.offer( new HttpClient() ); } public HttpClient getHttpClient() throws HttpClientPoolException { - if( _pool.isEmpty() ) + if ( _pool.isEmpty() ) throw new HttpClientPoolException( LANG.getMessage( "pool.empty" ) ); - + return _pool.poll(); } Modified: maven/mercury/trunk/mercury-core/src/main/java/org/apache/maven/mercury/spi/http/client/HttpClientPool.java URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-core/src/main/java/org/apache/maven/mercury/spi/http/client/HttpClientPool.java?rev=771552&r1=771551&r2=771552&view=diff ============================================================================== --- maven/mercury/trunk/mercury-core/src/main/java/org/apache/maven/mercury/spi/http/client/HttpClientPool.java (original) +++ maven/mercury/trunk/mercury-core/src/main/java/org/apache/maven/mercury/spi/http/client/HttpClientPool.java Tue May 5 04:22:22 2009 @@ -15,27 +15,25 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -*/ + */ package org.apache.maven.mercury.spi.http.client; -import org.apache.maven.mercury.artifact.api.Configurable; import org.mortbay.jetty.client.HttpClient; /** - * an abstraction to use instead actual HttpClient - * + * an abstraction to use instead actual HttpClient + * * @author Oleg Gusakov * @version $Id$ - * */ public interface HttpClientPool { public static final int DEFAULT_POOL_SIZE = 3; - + HttpClient getHttpClient() - throws HttpClientPoolException; - + throws HttpClientPoolException; + void returnHttpClient( HttpClient client ) - throws HttpClientPoolException; + throws HttpClientPoolException; } Modified: maven/mercury/trunk/mercury-core/src/main/java/org/apache/maven/mercury/spi/http/client/HttpClientPoolException.java URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-core/src/main/java/org/apache/maven/mercury/spi/http/client/HttpClientPoolException.java?rev=771552&r1=771551&r2=771552&view=diff ============================================================================== --- maven/mercury/trunk/mercury-core/src/main/java/org/apache/maven/mercury/spi/http/client/HttpClientPoolException.java (original) +++ maven/mercury/trunk/mercury-core/src/main/java/org/apache/maven/mercury/spi/http/client/HttpClientPoolException.java Tue May 5 04:22:22 2009 @@ -15,16 +15,13 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -*/ + */ package org.apache.maven.mercury.spi.http.client; /** - * - * * @author Oleg Gusakov * @version $Id$ - * */ public class HttpClientPoolException extends Exception