Announcement Announcement Module
No announcement yet.
In Spring 1.1.1 's reference, There was a small mistake . Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • In Spring 1.1.1 's reference, There was a small mistake .

    In SpringFramework 1.1.1 's reference, There was a small mistake in I think.
    The destroy-method attribute's value "destroy" may be the same with ExampleBean's method ,but there is a "cleanup()" method there.

    ============================================== DisposableBean / destroy-method

    Note: generally, the use of the DisposableBean marker interface can be avoided (and is discouraged since it unecessarily couples the code to Spring). A bean definition provides support for a generic destroy method to be specified. In the case of the XmlBeanFactory, this is done via the destroy-method attribute. For example, the following definition:

    <bean id="exampleInitBean" class="examples.ExampleBean" destroy-method="destroy"/>

    public class ExampleBean {
    public void cleanup() {
    // do some destruction work (like closing connection)
    Is exactly the same as:

    <bean id="exampleInitBean" class="examples.AnotherExampleBean"/>

    public class AnotherExampleBean implements DisposableBean {
    public void destroy() {
    // do some destruction work


  • #2
    Thanx! I've just fixed this.