oups missed to add files

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1128406 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2011-05-27 17:30:30 +00:00
parent 789083836c
commit 9c81940d21
3 changed files with 105 additions and 0 deletions

View File

@ -0,0 +1,43 @@
package org.apache.maven.archiva.proxy;
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
import org.apache.commons.lang.StringUtils;
import org.apache.maven.wagon.Wagon;
import org.springframework.stereotype.Service;
import javax.inject.Inject;
/**
* @author Olivier Lamy
* * @since 1.4
*/
@Service( "wagonFactory" )
public class DefaultWagonFactory
implements WagonFactory
{
private PlexusSisuBridge plexusSisuBridge;
@Inject
public DefaultWagonFactory( PlexusSisuBridge plexusSisuBridge )
{
this.plexusSisuBridge = plexusSisuBridge;
}
public Wagon getWagon( String protocol )
throws WagonFactoryException
{
try
{
// with sisu inject bridge hint is file or http
// so remove wagon#
protocol = StringUtils.remove( protocol, "wagon#" );
return plexusSisuBridge.lookup( Wagon.class, protocol );
}
catch ( PlexusSisuBridgeException e )
{
throw new WagonFactoryException( e.getMessage(), e );
}
}
}

View File

@ -0,0 +1,14 @@
package org.apache.maven.archiva.proxy;
/**
* @author Olivier Lamy
* @since 1.4
*/
public class WagonFactoryException
extends Exception
{
public WagonFactoryException( String message, Throwable e )
{
super( message, e );
}
}

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you 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.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd"
default-lazy-init="true">
<context:annotation-config/>
<context:component-scan base-package="org.apache.archiva.metadata.repository"/>
<alias name="archivaConfiguration#mock" alias="archivaConfiguration#default"/>
<alias name="archivaConfiguration#mock" alias="archivaConfiguration"/>
<bean name="scheduler" class="org.codehaus.redback.components.scheduler.DefaultScheduler">
<property name="properties">
<props>
<prop key="org.quartz.scheduler.instanceName">scheduler1</prop>
<prop key="org.quartz.threadPool.class">org.quartz.simpl.SimpleThreadPool</prop>
<prop key="org.quartz.threadPool.threadCount">1</prop>
<prop key="org.quartz.threadPool.threadPriority">4</prop>
<prop key="org.quartz.jobStore.class">org.quartz.simpl.RAMJobStore</prop>
</props>
</property>
</bean>
</beans>