org.beanlet
Annotation Type PostConstruct


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

The PostConstruct annotation is used on a method that needs to be executed after dependency injection is done to perform any initialization. Such methods are so-called post construct methods. This annotation is also supported for interceptor methods, further referred to as post-construct lifecycle methods.

PostConstruct methods are invoked by the container before beanlet instances are put into service. The post-construct method is called even if the class does not request any resources to be injected. The beanlet instance is not put into service if an exception is thrown by this method.

Method Constraints

Only one method can be marked with this annotation. The method on which the PostConstruct 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 'post-construct' 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">
    <post-construct method="bar"/>
  </beanlet>
</beanlets>



Copyright © 2006-2012. All Rights Reserved.