[jboss-user] [JBossWS] - Use of PostCreate in JaxWS WebService implementation class

adinn do-not-reply at jboss.com
Mon Jul 28 12:28:03 EDT 2008


JSR 109 appears (to me at least) to suggest that the @PostCreate and @PreDestroy annotations can be used to annotate lifecycle methods of either an EJB or a POJO, so long as the EJB/POJO is tagged with a WebService annotation. Here is the relevant text from version 1.2

anonymous wrote : 
  | 5.3.2.4.2.1   The optional @PostConstruct or @PreDestroy annotations
  |     A       Service Implementation Bean may use javax.annotation.PostConstruct or javax.annotation.PreDestroy annotation on methods for lifecycle event callbacks. The methods annotated with javax.annotation.PostConstruct or javax.annotation.PreDestroy annotation allow the web container to notify a Service Implementation Bean instance of impending changes in its state. The bean may use the notification to prepare its internal state for the transition. If the bean implements methods that are annotated with javax.annotation.PostConstruct or javax.annotation.PreDestroy annotations then the container is required to call them in the manner described below.
  |   . . .
  | 

This is all subsumed under section 5.3.2.4 'Web container programming model' and is distinct from the case described in section 5.2.3.3 'EJB container programming model' which is why I take it to be referring to use of POJOs annotated with @WebService.

I tried to use this feature in a service implementation class running under JBossWS Native 3.0.2 on AS 5.0.0.CR1 and the life cycle methods were not invoked. Is this because

 I am reading JSR 109 wrong
I am reading JSR 109 correct but JBossWS Native 3.0.2 does not (yet) implement lifecycle methods
I am reading JSR 109 correct and JBossWS Native 3.0.2 does implement lifecycle methods but there is a bug
small print may apply 
 
Any clarification would be most gratefully received

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4167118#4167118

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4167118



More information about the jboss-user mailing list