Java multithreaded (14) mode-active Object

Source: Internet
Author: User
Active Object

Through the proxy interface, the production, cache, consumption scenarios in the cache, consumption and production part of the Independent, through the future mode return operation results to the production part.

The cache section allocates data to the performer by increasing the scheduler, where it allows the performer to switch from active to passive. You can detach threads and execute policies.

Can be load balanced by the scheduler and can route data processing policies and compensation processing when the performer is unavailable.

Applicable environment

Need to handle a variety of business according to data situation, and need some scheduling, balanced, fault-tolerant scenarios.

Sample producer

Create a request, invoke the production portion of the consumption via an interface, and obtain processing results synchronously or asynchronously based on the future.

Interface

Create a future for the request, bind the request to the future, put it into the cache, and immediately return to the future.

Scheduler

Responsible for selecting specific performers according to the policy and distributing the request based on the data situation in the request.

can be extended to separate service registration, load balancing, error handling functions.

Cache

Slightly

Consumers

The specific request performer.

This article is from the Java Technology Stack notes blog, so be sure to keep this source http://stroll.blog.51cto.com/11038467/1863298

Java multithreaded (14) mode-active Object

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.