I have a set of statements to be executed repeatedly every time a web method is called with a new service.I tried writing in the constructor but, the constructor gets invoked only once when the server starts. Instead, I need the set of stmts to be executed each time a Service is created at the client.
A:
You're looking for @PostConstruct:
@javax.annotation.PostConstruct
public void postConstruct(){
// initialization code
}
A method annotated with @PostConstruct is called by the container once after the bean is instantiated.
EDIT: I think, I misunderstood your question. You're probably looking for interceptors as suggested by djna, i.e., javax.ejb.Interceptors
annotation. You can find a good introduction here (as soon as maintenance of java.net is over).
janko
2009-08-24 11:43:57
thanks for ur reply!
Ajay
2009-08-24 14:28:21