org.beanlet
Annotation Type PreDestroy


@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface PreDestroy

The PreDestroy annotation is used on methods as a callback notification to signal that the beanlet instance is in the process of being removed by the container. Such methods are so-called pre-destroy methods This annotation is also supported for interceptor methods, further referred to as pre-destroy lifecycle methods.

Pre-destroy methods are typically used to release resources that the beanlet has been holding.

Method Constraints

The method on which the PreDestroy annotation is applied MUST fulfill all of the following criteria:

XML Representation

The following xml-fragment shows how to express this annotation in xml. The italic attribute of the 'pre-destroy' tag is used to identify the element to which this annotation is applied.
<beanlets xmlns="http://beanlet.org/schema/beanlet"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://beanlet.org/schema/beanlet http://beanlet.org/schema/beanlet/beanlet_1_0.xsd">
  <beanlet name="foo" type="com.acme.Foo">
    <pre-destroy method="bar"/>
  </beanlet>
</beanlets>



Copyright © 2006-2012. All Rights Reserved.