CS Architecture

ContextService Architecture

Horizontal Division

Horizontally divided into three modules: Restful, Scheduler, Service

Restful Responsibilities:

  1. Encapsulate the request as httpjob and submit it to the Scheduler

Scheduler Responsibilities:

  1. Find the corresponding service through the ServiceName of the httpjob protocol to execute the job

Service Responsibilities:

  1. The module that actually executes the request logic, encapsulates the ResponseProtocol, and wakes up the wait thread in Restful

Vertical Division

Vertically divided into 4 modules: Listener, History, ContextId, Context:

Listener responsibilities:

  1. Responsible for the registration and binding of the client side (write to the database and register in the CallbackEngine)

  2. Heartbeat interface, return Array[ListenerCallback] through CallbackEngine

History Responsibilities:

Create and remove history, operate Persistence for DB persistence

ContextId Responsibilities:

Mainly docking with Persistence for ContextId creation, update and removal, etc.

Context responsibility:

  1. For removal, reset and other methods, first operate Persistence for DB persistence, and update ContextCache

  2. Encapsulate the query condition and go to the ContextSearch module to obtain the corresponding ContextKeyValue data

The steps for requesting access are as follows: CS Architecture - 图1

UML Class Diagram

CS Architecture - 图2

Scheduler thread model

Need to ensure that Restful’s thread pool is not filled

CS Architecture - 图3

The sequence diagram is as follows: CS Architecture - 图4