]> source.dussan.org Git - archiva.git/commitdiff
PR: MRM-101
authorEdwin L. Punzalan <epunzalan@apache.org>
Tue, 14 Mar 2006 02:43:06 +0000 (02:43 +0000)
committerEdwin L. Punzalan <epunzalan@apache.org>
Tue, 14 Mar 2006 02:43:06 +0000 (02:43 +0000)
Removed ProxyManagerFactory

git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@385717 13f79535-47bb-0310-9956-ffa450edef68

maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/ProxyManagerFactory.java [deleted file]
maven-repository-proxy/src/test/java/org/apache/maven/repository/proxy/DefaultProxyManagerTest.java
maven-repository-proxy/src/test/java/org/apache/maven/repository/proxy/LegacyProxyManagerTest.java

diff --git a/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/ProxyManagerFactory.java b/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/ProxyManagerFactory.java
deleted file mode 100644 (file)
index 2a52fcd..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.apache.maven.repository.proxy;
-
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import org.apache.maven.repository.proxy.configuration.ProxyConfiguration;
-import org.codehaus.plexus.PlexusConstants;
-import org.codehaus.plexus.PlexusContainer;
-import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
-import org.codehaus.plexus.context.Context;
-import org.codehaus.plexus.context.ContextException;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
-
-/**
- * Factory class for creating ProxyManager instances.  The usage of a factory ensures that the created instance will
- * have the necessary configuration
- *
- * @author Edwin Punzalan
- * @plexus.component role="org.apache.maven.repository.proxy.ProxyManagerFactory"
- */
-public class ProxyManagerFactory
-    implements Contextualizable
-{
-    public static String ROLE = "org.apache.maven.repository.proxy.ProxyManagerFactory";
-
-    private PlexusContainer container;
-
-    /**
-     * Used to create a ProxyManager instance of a certain type with a configuration to base its behavior
-     *
-     * @param proxy_type The ProxyManager repository type
-     * @param config     The ProxyConfiguration to describe the behavior of the proxy instance
-     * @return The ProxyManager instance of type proxy_type with ProxyConfiguration config
-     * @throws ComponentLookupException when the factory fails to create the ProxyManager instance
-     */
-    public ProxyManager getProxyManager( String proxy_type, ProxyConfiguration config )
-        throws ComponentLookupException
-    {
-        ProxyManager proxy = (ProxyManager) container.lookup( ProxyManager.ROLE );
-        config.setLayout( proxy_type );
-        proxy.setConfiguration( config );
-        return proxy;
-    }
-
-    /**
-     * @see org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable#contextualize(org.codehaus.plexus.context.Context)
-     */
-    public void contextualize( Context context )
-        throws ContextException
-    {
-        container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
-    }
-}
index 85958007001043a85c8b6d3df7b61ac480605c7f..f3f8b27ba518958f0510a9295d84e865e7e14eba 100644 (file)
@@ -39,8 +39,9 @@ public class DefaultProxyManagerTest
     {
         super.setUp();
 
-        ProxyManagerFactory factory = (ProxyManagerFactory) container.lookup( ProxyManagerFactory.ROLE );
-        proxy = factory.getProxyManager( "default", getTestConfiguration() );
+        proxy = (ProxyManager) container.lookup( ProxyManager.ROLE );
+
+        proxy.setConfiguration( getTestConfiguration() );
     }
 
     public void testExceptions()
index 5e22689084fffb448c083844ee8f2f62447a6d2e..768e505b88ee88ec2527150f117e9615b1e15005 100644 (file)
@@ -39,8 +39,9 @@ public class LegacyProxyManagerTest
     {
         super.setUp();
 
-        ProxyManagerFactory factory = (ProxyManagerFactory) container.lookup( ProxyManagerFactory.ROLE );
-        proxy = factory.getProxyManager( "legacy", getTestConfiguration() );
+        proxy = (ProxyManager) container.lookup( ProxyManager.ROLE );
+
+        proxy.setConfiguration( getTestConfiguration() );
     }
 
     public void testExceptions()