Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-26-2007, 09:40 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
Look-Up Method Injection and it’s usage in Spring Framework
This is the feature of the container to override abstract or concrete methods on managed beans in the container, to return the result of look up another named bean in the container. Usually lookup is done for a prototyped Bean.

Code of client class containing the method to be injected the method definition must be an abstract (or concrete).

Code:
protected abstract SimpleHelper createSimpleHelper();
In case programmer does not make method abstract Spring will override existing implementation.

Write Following Code in Bean Configuration File

Code:
<bean id="simpleHelper" class="..." singleton="false"/> <bean id="CallerBean" class="..."> <lookup-method name="createSimpleHelper" bean="SimpleHelper"/> <property> ... </property> </bean>
It is important that SimpleHelper Should be prototyped otherwise always same instance will be returned
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Look-Up Method Injection and it’s usage in Spring Framework Java Tip Java Tips 0 03-30-2008 11:09 AM
What is need of method injection Java Tip Java Tips 0 03-30-2008 11:08 AM
How to decide whether to use Setter injection or constructor injection in your code Java Tip Java Tips 0 03-29-2008 01:38 PM
What is need of method injection JavaBean Java Tips 0 09-26-2007 09:39 PM
How to decide whether to use Setter injection or constructor injection in your code JavaBean Java Tips 0 09-26-2007 09:29 PM


All times are GMT +3. The time now is 05:02 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org