java - how to set lookup-method programatically in spring -


i creating spring bean @ runtime , want hookup lookup-method property in it, please me out how can achieved.

edit 1: below helper class

public class commonhelper implements methodreplacer{    @override public object reimplement(object arg0, method arg1, object[] arg2)         throws throwable {     //replaced logic     return null; } 

and configured bean in spring.xml

now, below creating bean @ runtime , also, have injected 1 property able retrieve, so, how can set "replaced-method" particular bean?

reference link http://java.dzone.com/articles/method-injection-spring

genericbeandefinition beandefinition = new genericbeandefinition();     beandefinition.setbeanclass(testclass.class);     beandefinition.setlazyinit(false);     beandefinition.setabstract(false);     beandefinition.setautowirecandidate(true);      beandefinition.setpropertyvalues(new mutablepropertyvalues().add("str", "getyest"));      registry.registerbeandefinition("dynamicbean", beandefinition);      object bean = appcontext.getbean("dynamicbean"); 


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -