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