Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jersey-dev] Incoming Coupling and Outgoing Coupling of a Service

Hi Rupinder,

I do not understand the question, but will try to answer. You can have synchronous and asynchronous services. For synchronous, the thread is provided by the servlet container (if any) and by default, for each http request a new instance of resource class is created, so possibly a new thread can process the new http request.

For asynchronous services, more threads are involved. The new threads can be spawned by the resource method code (not recommended) or can be provided by ManagedExecutorService and perform some long pending operation in background. You may either return CompletableFuture which will use the executor service (thread) to complete the operation, or you can use @Suspended annotation and resume the provided AsyncResponse in the new thread once the operation is done. See JAX-RS Spec. Section 8.2 for more details.

Did it answer your question?

Thanks,

Jan

On 03.08.2020 6:20, Rupinder Singh wrote:
Hi,
I am trying to get an answer to a question in relation to my academic research on SOA with JAX-RS as an example implementation technology. Could you help? The question is,

Can we consider a JAX-RS service as basically the main threads and explicit child thread(s), if any, of the public resource methods of its root resource class with all incoming coupling (dependencies) via service interface and all outgoing coupling emanating from these threads?

Thanks and regards
Rupinder

_______________________________________________
jersey-dev mailing list
jersey-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jersey-dev


Back to the top