|
From: Bing R. <br...@cc...> - 2005-09-21 16:22:45
|
Hi Dave,=20 Working at the getBean() (I assume you meant this method) level is too = high that I cannot control the creation of dependent objects. For instance, = if bean a depends on bean b, which is actually a web session-scoped bean, overriding getBean() for "a" does not allow me easily set b on a. By the time a is created, a new instance of b is already injected into a. I = then need to introspect a to find out b and replace it. Not quite efficient = and easy.=20 It might work, but I'd like to find out a cleaner solution.=20 Thanks. Bing =B7=A2=BC=FE=C8=CB: = spr...@li... [mailto:spr...@li...] = =B4=FA=B1=ED David Hewitt =B7=A2=CB=CD=CA=B1=BC=E4: 2005=C4=EA9=D4=C221=C8=D5 23:04 =CA=D5=BC=FE=C8=CB: spr...@li... =D6=F7=CC=E2: RE: [Springframework-developer] customized BeanFactory Bing, What's wrong with using a standard FactoryBean to do this? Your (non-singleton) FactoryBean could take the value-binding expression parameter, evaluate it when getObject() is called and the result would = then be injected into your property as normal. Its less terse, but is there any reason why this wouldn't work? Dave Hewitt > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...] On = Behalf > Of Bing Ran > Sent: 21 September 2005 13:08 > To: spr...@li... > Subject: Re: [Springframework-developer] customized BeanFactory >=20 > Thanks Steve. Unfortunately the way that the > PropertyPlaceHolderBeanfactory > Works does not meet my need. What I'd like to have is a repeatable > interpretation of an injected value each time the bean (a prototype) = is > created, rather than the one-time post-processing. What I'm doing is > actually part of my effort to replace the bean management facility of = JSF > with what I'm doing on top of Spring (see http://jacn.sf.net). I need = the > ability to re-evaluate a JSF value-binding expression such as > #{param.user_name}, which binds to a parameter in the http request, = which > of > course is different every time a new request comes in. >=20 > Any insight into this? >=20 > Bing >=20 >=20 > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: = spr...@li... > [mailto:spr...@li...] = =B4=FA=B1=ED Steven > Devijver > =B7=A2=CB=CD=CA=B1=BC=E4: 2005=C4=EA9=D4=C221=C8=D5 17:47 > =CA=D5=BC=FE=C8=CB: spr...@li... > =D6=F7=CC=E2: Re: [Springframework-developer] customized BeanFactory >=20 > Bing, >=20 > You can implement a BeanFactoryPostProcessor to do that. Have a look > at the code of PropertyPlaceholderConfigurer. This class inspects > bean definitions and replaces ${key} with property values loaded from > property files. BeanFactoryPostProcessors are recognized by the bean > factory and applied automatically. >=20 > Steven Devijver > Senior consultant > @ Interface21 > ste...@in... >=20 >=20 >=20 > On 21 Sep 2005, at 04:20, Bing Ran wrote: >=20 >=20 > > I'm implementing my own BeanFactory as a subclass of > > DefaultListableBeanFactory. What I want to do is to reinterpret > > injected > > values on a bean, such as the <value>#{param.userName}</value> part > > in the > > bean definition: > > > > <bean ...> > > <property name=3D"a"> <value>#{param.userName}</value></property> > > </bean> > > > > I'd like to set the value from another source (such as in JSF > > context) at > > the time the bean is instantiated. Any tips how my code can get a > > chance to > > re-interpret the dependency? > > > > Thanks! > > > > Bing Ran > > > > > > > > > > ------------------------------------------------------- > > SF.Net email is sponsored by: > > Tame your development challenges with Apache's Geronimo App Server. > > Download > > it for free - -and be entered to win a 42" plasma tv or your very = own > > Sony(tm)PSP. Click here to play: = http://sourceforge.net/geronimo.php > > _______________________________________________ > > Springframework-developer mailing list > > Spr...@li... > > = https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > > >=20 >=20 >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. > Download > it for free - -and be entered to win a 42" plasma tv or your very own > Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer >=20 >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. > Download > it for free - -and be entered to win a 42" plasma tv or your very own > Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer >=20 > = ________________________________________________________________________ > This e-mail has been scanned for all viruses by Star. The > service is powered by MessageLabs. For more information on a proactive > anti-virus service working around the clock, around the globe, visit: > http://www.star.net.uk > = ________________________________________________________________________ ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. = Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |