vendredi 3 avril 2015

Spring init method with parameters issue

so I'm learning spring dependency injection and have come around with an issue.I've two classes...one is the Run class and the other is Builders class.The Builders class has a static method abc that accepts multiple parameters and returns an object of type Run. It looks something like this:



public class Run{
private final Check check;

public Run(Check check){
this.check = check;

}
public Check getCheck() {
return check;
}
}

public class Builders {
public static Run abc(multiple arguments) {
Check check = ProxyImplClass.createCheck(multiple arguments);
return new Run(check);
}
}


I need to call the below mentioned statement only once on application startup.


Run run = Builders.abc (....accepts multiple parameters....);


How do I do that using the spring xml?If some changes are required in the class files, then please mention that too as I'm quite new to this Spring framework.


Note:....multiple parameters inside the abc method only signifies that the method takes multiple parameters.


Aucun commentaire:

Enregistrer un commentaire