package com.cv.spring.autowire.annotation;
import java.util.HashSet;
import java.util.Set;
import javax.inject.Inject;
import org.apache.log4j.Logger;
/**
* @author Chandra Vardhan
*
*/
public class PoeticJugg extends Jugg {
private final static Logger LOGGER = Logger.getLogger(PoeticJugg.class);
int beanBags;
public int getBeanBags() {
return beanBags;
}
public void setBeanBags(int beanBags) {
this.beanBags = beanBags;
}
private Poem poem2;
private Lesson lesson;
private Summary summary;
private Set<Knife> knives;
@Inject
public PoeticJugg(Provider<Knife> knifeProvider, Poem poem2) {
this.poem2 = poem2;
knives = new HashSet<Knife>();
for (int i = 0; i < 5; i++) {
knives.add(knifeProvider.get());
}
}
private PoeticJugg() {
}
private PoeticJugg(Poem poem2) {
super();
LOGGER.info("1-args cons.....");
this.poem2 = poem2;
}
private PoeticJugg(Poem poem2, int beanBags) {
super(beanBags);
this.beanBags = beanBags;
LOGGER.info("2-args cons.....");
LOGGER.info("Poem " + poem2);
this.poem2 = poem2;
}
private PoeticJugg(Poem poem2, Lesson lesson, int beanBags) {
super(beanBags);
LOGGER.info("3-args cons.....");
LOGGER.info("Poem " + poem2 + ", Lesson" + lesson);
this.poem2 = poem2;
this.lesson = lesson;
}
// @Inject
private PoeticJugg(Poem poem2, Lesson lesson, Summary summary, int beanBags) {
super(beanBags);
LOGGER.info("4-args cons.....");
LOGGER.info("Poem " + poem2 + ", Lesson" + lesson + ", Summary"
+ summary);
this.poem2 = poem2;
this.lesson = lesson;
this.summary = summary;
}
public Poem getPoem() {
return poem2;
}
public void setPoem(Poem poem2) {
this.poem2 = poem2;
}
public void perform() {
super.perform();
LOGGER.info("while reciting....");
poem2.recite();
}
} |
No comments:
Post a Comment