]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.support.aether/src/main/java/org/argeo/slc/aether/spring/RemoteRepositoryFactory.java
Working indexation (artifact, jar, osgi) in repo
[gpl/argeo-slc.git] / runtime / org.argeo.slc.support.aether / src / main / java / org / argeo / slc / aether / spring / RemoteRepositoryFactory.java
1 package org.argeo.slc.aether.spring;
2
3 import org.sonatype.aether.repository.RemoteRepository;
4 import org.springframework.beans.factory.BeanNameAware;
5 import org.springframework.beans.factory.FactoryBean;
6
7 /** Simplifies the definition of a remote factory using Spring */
8 public class RemoteRepositoryFactory implements BeanNameAware, FactoryBean {
9 private String beanName;
10 private String id;
11 private String url;
12 private String type = "default";
13
14 public Object getObject() throws Exception {
15 return new RemoteRepository(id != null ? id : beanName, type, url);
16 }
17
18 public Class<?> getObjectType() {
19 return RemoteRepository.class;
20 }
21
22 public boolean isSingleton() {
23 return true;
24 }
25
26 public void setBeanName(String name) {
27 this.beanName = name;
28
29 }
30
31 public void setId(String id) {
32 this.id = id;
33 }
34
35 public void setUrl(String url) {
36 this.url = url;
37 }
38
39 public void setType(String type) {
40 this.type = type;
41 }
42
43 }