|
From: <jue...@we...> - 2004-07-08 09:44:05
|
I recommend BeanNameAware too, if you just want to become aware of the = bean name.=20 For general post-processing of a newly created bean instance, you could = define a BeanPostProcessor in the context, which will automatically = intercept all beans that this context creates: http://www.springframework.org/docs/api/org/springframework/beans/factory= /config/BeanPostProcessor.html Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Chistophe Vanfleteren Sent: Thursday, July 08, 2004 11:26 AM To: spr...@li... Subject: Re: [Springframework-developer] Intercepting bean creation? On Thursday 08 July 2004 11:12, Mason, Ross wrote: > Hi, > I create a lot of different types of object in an applicationContext, = all > of which have a name property i.e. > > <bean id=3D"jmsConnector" = className=3D"org.mule.providers.jms.JmsConnector"> > <property name=3D"name"><value>jmsConnector</value></property> > </bean> > > I don't like having to include the name property if there is a chance = I > could use the bean id instead. Is there any way I can uniformly = intercept > bean creation in the context so that straight after the constructor is > called I can get hold of the bean id and set it on my object? > > I can't wait until the applicationContext is configured and then set = the > names as some objects have a collection of other objects which are = keyed > against the name. > You could implement BeanNameAware: <http://www.springframework.org/docs/api/org/springframework/beans/factor= y/BeanNameAware.html> --=20 Kind regards, Christophe Vanfleteren ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 -=20 digital self defense, top technical experts, no vendor pitches,=20 unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |