Non-Lazy Beans and init with no arguments

5 views
Skip to first unread message

HemTalreja

unread,
Jan 27, 2010, 11:49:43 AM1/27/10
to ColdSpring-Users
In my testing today, I realized that the init method on non-lazy beans
was not getting called when no constructor arguments are needed to be
sent to the bean?


If the bean is lazy i,e, instantiated when called the init method is
getting called correctly.

Non Lazy beans are calling the init (constructor) if constructor
arguments need to be passed to the bean....

Is this by design?

Thank You
-Hem

Dennis Clark

unread,
Jan 27, 2010, 12:46:02 PM1/27/10
to coldspri...@googlegroups.com
I don't see how what you're saying is possible in ColdSpring 1.2. Its process for constructing lazy and non-lazy beans is exactly the same: the only difference is in when the construction occurs.

From the source code, the only preconditions for ColdSpring calling init() on a bean during construction are:
  1. The CFC must define an "init" method
  2. The bean definition must not use a factory bean
Is it possible that your bean definition does not meet one of the above conditions?

The presence of absence of constructor arguments do not change whether or not init is called: they only change what arguments (if any) are passed into the init call.

If you still believe that there is a problem with the construction of non-lazy beans, please provide the source for a small example so we can verify it.

Thanks,

-- Dennis


--
You received this message because you are subscribed to the Google Groups "ColdSpring-Users" group.
To post to this group, send email to coldspri...@googlegroups.com.
To unsubscribe from this group, send email to coldspring-use...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/coldspring-users?hl=en.


Brian Kotek

unread,
Feb 1, 2010, 1:28:35 PM2/1/10
to coldspri...@googlegroups.com
Agreed. Existence or lack of constructor args should have no effect on this. As Dennis mentioned, if you believe this is a bug, please create a simple example with two or three files that demonstrates the issue and send it over. Thanks.
Reply all
Reply to author
Forward
0 new messages