a peek into my MIND

November 16, 2009

Spring injecting prototype bean into a singleton bean

Filed under: Java — Bharat Kondeti @ 10:50 pm

I came across a scenario when in I had to inject a prototype bean into a singleton bean, in essence I needed a new instance of the bean every time a method is called on the singleton bean.

This can be achieved with something called “method injection”, which is a feature in Spring.

More information can be found in the spring documentation.


Leave a Comment »

No comments yet.

RSS feed for comments on this post.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at WordPress.com.

%d bloggers like this: