Annotation Type PostConstruct

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=""
  <beanlet name="foo" type="com.acme.Foo">
    <post-construct method="bar"/>

Copyright © 2006-2012. All Rights Reserved.