@WebService
public class ExampleWS {
public synchronized void doSomething() {
;
}
public synchronized void doSomethingElse() {
;
}
}
By doing this, you eliminate the possibility of parallel or concurrent handling of incoming requests. In order to support concurrent processing, you can mark the web service class as thread scoped by using the @ThreadScope annotation.
import org.jvnet.jax_ws_commons.thread_scope.ThreadScope;
@WebService
@ThreadScope
public class ExampleWS {
public synchronized void doSomething() {
;
}
public synchronized void doSomethingElse() {
;
}
}
The added annotation will force the container to create a new instance of the web service class for every thread (ie. every request). Instances will not be shared by threads.
No comments:
Post a Comment