How do I use the @PreDestroy annotation in EJB 3.0?

Byron Tymvios

You will firstly need to import javax.annotation.PreDestroy before you can use the annotation. Then annotate a method with @PreDestroy

@PreDestroy
public void preDestroy(){
    //Place your pre destruction code here
}
A @PreDestroy annotated method will execute directly after the @Remove method has finished executing and before the bean instance is removed by the container. After this method has executed the bean can be garbage collected.

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact