Scaffold interfaces and classes for pluggable monitors

This commit is contained in:
Silvano Cerza 2022-03-03 10:52:27 +01:00 committed by Alberto Iannaccone
parent 2b2ea72643
commit ebab0b226f
6 changed files with 53 additions and 0 deletions

View File

@ -275,6 +275,8 @@ import {
IDEUpdaterDialogWidget,
} from './dialogs/ide-updater/ide-updater-dialog';
import { ElectronIpcConnectionProvider } from '@theia/core/lib/electron-browser/messaging/electron-ipc-connection-provider';
import { MonitorManagerProxyClient } from '../common/monitor-manager-proxy';
import { MonitorManagerProxyClientImpl } from './monitor-manager-proxy-client-impl';
const ElementQueries = require('css-element-queries/src/ElementQueries');
@ -431,6 +433,10 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
// Serial service client to receive and delegate notifications from the backend.
bind(SerialServiceClient).to(SerialServiceClientImpl).inSingletonScope();
// Monitor manager proxy client to receive and delegate pluggable monitors
// notifications from the backend
bind(MonitorManagerProxyClient).to(MonitorManagerProxyClientImpl).inSingletonScope();
bind(WorkspaceService).toSelf().inSingletonScope();
rebind(TheiaWorkspaceService).toService(WorkspaceService);
bind(WorkspaceVariableContribution).toSelf().inSingletonScope();

View File

@ -0,0 +1,6 @@
import { injectable } from "@theia/core/shared/inversify";
import { MonitorManagerProxyClient } from "../common/monitor-manager-proxy";
@injectable()
export class MonitorManagerProxyClientImpl implements MonitorManagerProxyClient {
}

View File

@ -0,0 +1,12 @@
import { JsonRpcServer } from "@theia/core";
export const MonitorManagerProxyPath = '/services/monitor-manager-proxy';
export const MonitorManagerProxy = Symbol('MonitorManagerProxy');
export interface MonitorManagerProxy extends JsonRpcServer<MonitorManagerProxyClient> {
}
export const MonitorManagerProxyClient = Symbol('MonitorManagerProxyClient');
export interface MonitorManagerProxyClient {
}

View File

@ -86,6 +86,9 @@ import WebSocketServiceImpl from './web-socket/web-socket-service-impl';
import { WebSocketService } from './web-socket/web-socket-service';
import { ArduinoLocalizationContribution } from './arduino-localization-contribution';
import { LocalizationContribution } from '@theia/core/lib/node/i18n/localization-contribution';
import { MonitorManagerProxyImpl } from './monitor-manager-proxy-impl';
import { MonitorManager } from './monitor-manager';
import { MonitorManagerProxy, MonitorManagerProxyClient, MonitorManagerProxyPath } from '../common/monitor-manager-proxy';
export default new ContainerModule((bind, unbind, isBound, rebind) => {
bind(BackendApplication).toSelf().inSingletonScope();

View File

@ -0,0 +1,20 @@
import { inject, injectable } from "@theia/core/shared/inversify";
import { MonitorManagerProxy, MonitorManagerProxyClient } from "../common/monitor-manager-proxy";
import { MonitorManager } from "./monitor-manager";
@injectable()
export class MonitorManagerProxyImpl implements MonitorManagerProxy {
constructor(
@inject(MonitorManager)
protected readonly manager: MonitorManager,
) {
}
dispose(): void {
// TODO
}
setClient(client: MonitorManagerProxyClient | undefined): void {
// TODO
}
}

View File

@ -0,0 +1,6 @@
import { injectable } from "@theia/core/shared/inversify";
@injectable()
export class MonitorManager {
}