I have the following Bean which I would like to have autowired in another class:
@Scope("job")
@Component
public class PublicCompanyHolder {
private List<File> publicCompanyList;
public List<File> getPublicCompanyList() {
return publicCompanyList;
}
public void setPublicCompanyList(List<File> publicCompanyList) {
this.publicCompanyList = publicCompanyList;
}
}
My Spring config looks like :
<bean id="publicCompanyHolder" class="com.sample.bean.PublicCompanyHolder" >
<property name="publicCompanyList" ref="publicCompanyList" />
</bean>
<bean id="publicCompanyList" class="java.util.List" />
Is this the right way to do it.In another class by simply saying:
@Autowired
private PublicCompanyHolder publicCompanyHolder;
I would like to use the class.Please let me know.