Resteasy JAVAX Asynchronous considerations

Source: Internet
Author: User

1. Write the Restfull interface using the Resteasy framework-note that every client request, Resteasy will create a new instance of the class for request processing (each resource file will be initialized at each request, not a single-instance model

Instead of simply calling the corresponding method in the class, the seat needs to be noted).

2.resteasy when making asynchronous processing requests, note that the thread pool, if declared in a class, is aware that it may be instantiated more than once, so thread-pool variables need to use static variables when threads are scheduled to perform asynchronous operations with threads.

The initialization of the thread pool also requires a single-instance mode operation.

2. It is no longer possible to use thread pooling to create threads that can only be manipulated using static methods. (The thread pool acquisition requires a singleton pattern, and each request initializes the Resteasy resource class)

Resteasy JAVAX Asynchronous considerations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.