]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.agent/src/main/java/org/argeo/slc/ant/spring/SpringRegister.java
1 package org
.argeo
.slc
.ant
.spring
;
4 import java
.util
.Vector
;
6 import org
.apache
.commons
.logging
.Log
;
7 import org
.apache
.commons
.logging
.LogFactory
;
8 import org
.apache
.tools
.ant
.BuildException
;
10 public class SpringRegister
extends AbstractSpringTask
{
11 private static final Log log
= LogFactory
.getLog(SpringRegister
.class);
13 private List
<BeanArg
> beans
= new Vector
<BeanArg
>();
16 public void execute() throws BuildException
{
17 for (BeanArg bean
: beans
) {
18 Object instance
= bean
.getInstance();
19 if (bean
.getAntid() != null) {
20 getProject().addReference(bean
.getAntid(), instance
);
22 if (bean
.getAntref() != null) {
24 .warn("Cannot register beans with antref (Ant reference "
25 + bean
.getAntref() + ")");
27 getProject().addReference(bean
.getBean(), instance
);
33 public BeanArg
createObject() {
34 BeanArg bean
= new BeanArg();
39 protected static class BeanArg
extends SpringArg
<Object
> {
42 public String
getAntid() {
46 public void setAntid(String antid
) {