import { DistributedSystemArray } from "./DistributedSystemArray"; import { DistributedSystem } from "./DistributedSystem"; import { MediatorSystem } from "../parallel/MediatorSystem"; import { InvokeHistory } from "../slave/InvokeHistory"; /** * Mediator of Distributed Processing System. * * The {@link DistributedSystemArrayMediator} class be a master for its slave systems, and be a slave to its master * system at the same time. This {@link DistributedSystemArrayMediator} be a master system, containing and managing * {@link DistributedSystem} objects, which represent distributed slave systems, by extending * {@link DistributedSystemArray} class. Also, be a slave system through {@link getMediator mediator} object, which is * derived from the {@link SlaveSystem} class. * * As a master, you can specify this {@link DistributedSystemArrayMediator} class to be a master server accepting * slave clients or a master client to connecting slave servers. Even both of them is possible. Extends one * of them below and overrides abstract factory method(s) creating the child {@link DistributedSystem} object. * * - {@link DistributedClientArrayMediator}: A server accepting {@link DistributedSystem distributed clients}. * - {@link DistributedServerArrayMediator}: A client connecting to {@link DistributedServer distributed servers}. * - {@link DistributedServerClientArrayMediator}: Both of them. Accepts {@link DistributedSystem distributed clients} and * connects to {@link DistributedServer distributed servers} at the same time. * * As a slave, you can specify this {@link DistributedSystemArrayMediator} to be a client slave connecting to master * server or a server slave accepting master client by overriding the {@link createMediator} method. * Overrides the {@link createMediator createMediator()} method and return one of them: * * - A client slave connecting to master server: * - {@link MediatorClient} * - {@link MediatorWebClient} * - {@link MediatorSharedWorkerClient} * - A server slave accepting master client: * - {@link MediatorServer} * - {@link MediatorWebServer} * - {@link MediatorDedicatedWorkerServer} * - {@link MediatorSharedWorkerServer} * * #### [Inherited] {@link DistributedSystemArray} * @copydoc DistributedSystemArray */ export declare abstract class DistributedSystemArrayMediator extends DistributedSystemArray { /** * @hidden */ private mediator_; /** * Default Constructor. */ constructor(); /** * Factory method creating a {@link MediatorSystem} object. * * The {@link createMediator createMediator()} is an abstract method creating the {@link MediatorSystem} object. * * You know what? this {@link DistributedSystemArrayMediator} class be a master for its slave systems, and be a * slave to its master system at the same time. The {@link MediatorSystem} object makes it possible; be a slave * system. This {@link createMediator} determines specific type of the {@link MediatorSystem}. * * Overrides the {@link createMediator createMediator()} method to create and return one of them following which * protocol and which type of remote connection (server or client) will be used: * * - A client slave connecting to master server: * - {@link MediatorClient} * - {@link MediatorWebClient} * - {@link MediatorSharedWorkerClient} * - A server slave accepting master client: * - {@link MediatorServer} * - {@link MediatorWebServer} * - {@link MediatorDedicatedWorkerServer} * - {@link MediatorSharedWorkerServer} * * @return A newly created {@link MediatorSystem} object. */ protected abstract createMediator(): MediatorSystem; /** * Start mediator. * * If the {@link getMediator mediator} is a type of server, then opens the server accepting master client. * Otherwise, the {@link getMediator mediator} is a type of client, then connects the master server. */ protected startMediator(): void; /** * Get {@link MediatorSystem} object. * * When you need to send an {@link Invoke} message to the master system of this * {@link DistributedSystemArrayMediator}, then send to the {@link MediatorSystem} through this * {@link getMediator}. * * ```typescript * this.getMediator().sendData(...); * ``` * * @return The {@link MediatorSystem} object. */ getMediator(): MediatorSystem; /** * @hidden */ protected _Complete_history(history: InvokeHistory): boolean; }