UNPKG

2.88 kBJavaScriptView Raw
1"use strict";
2// *****************************************************************************
3// Copyright (C) 2017 TypeFox and others.
4//
5// This program and the accompanying materials are made available under the
6// terms of the Eclipse Public License v. 2.0 which is available at
7// http://www.eclipse.org/legal/epl-2.0.
8//
9// This Source Code may also be made available under the following Secondary
10// Licenses when the conditions for such availability set forth in the Eclipse
11// Public License v. 2.0 are satisfied: GNU General Public License, version 2
12// with the GNU Classpath Exception which is available at
13// https://www.gnu.org/software/classpath/license.html.
14//
15// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16// *****************************************************************************
17Object.defineProperty(exports, "__esModule", { value: true });
18exports.messagingFrontendModule = void 0;
19const inversify_1 = require("inversify");
20const frontend_id_provider_1 = require("./frontend-id-provider");
21const ws_connection_source_1 = require("./ws-connection-source");
22const service_connection_provider_1 = require("./service-connection-provider");
23const connection_source_1 = require("./connection-source");
24const connection_management_1 = require("../../common/messaging/connection-management");
25const ws_connection_provider_1 = require("./ws-connection-provider");
26const backendServiceProvider = Symbol('backendServiceProvider');
27exports.messagingFrontendModule = new inversify_1.ContainerModule(bind => {
28 bind(connection_management_1.ConnectionCloseService).toDynamicValue(ctx => ws_connection_provider_1.WebSocketConnectionProvider.createProxy(ctx.container, connection_management_1.connectionCloseServicePath)).inSingletonScope();
29 bind(frontend_id_provider_1.BrowserFrontendIdProvider).toSelf().inSingletonScope();
30 bind(frontend_id_provider_1.FrontendIdProvider).toService(frontend_id_provider_1.BrowserFrontendIdProvider);
31 bind(ws_connection_source_1.WebSocketConnectionSource).toSelf().inSingletonScope();
32 bind(backendServiceProvider).toDynamicValue(ctx => {
33 bind(service_connection_provider_1.ServiceConnectionProvider).toSelf().inSingletonScope();
34 const container = ctx.container.createChild();
35 container.bind(connection_source_1.ConnectionSource).toService(ws_connection_source_1.WebSocketConnectionSource);
36 return container.get(service_connection_provider_1.ServiceConnectionProvider);
37 }).inSingletonScope();
38 bind(service_connection_provider_1.LocalConnectionProvider).toService(backendServiceProvider);
39 bind(service_connection_provider_1.RemoteConnectionProvider).toService(backendServiceProvider);
40 bind(ws_connection_provider_1.WebSocketConnectionProvider).toSelf().inSingletonScope();
41});
42//# sourceMappingURL=messaging-frontend-module.js.map
\No newline at end of file