Cleaner dependency injection for BootJavaLanguageServer

This commit is contained in:
Kris De Volder
2017-10-18 16:20:42 -07:00
parent 71dabb8d6c
commit 5ea32cf751
19 changed files with 388 additions and 268 deletions

View File

@@ -0,0 +1,25 @@
/*******************************************************************************
* Copyright (c) 2017 Pivotal, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pivotal, Inc. - initial API and implementation
*******************************************************************************/
package org.springframework.ide.vscode.commons.languageserver.util;
/**
* A factory that is aware of the language server context. Use this to inject
* dependencies into a {@link SimpleLanguageServer} implementation when the
* instantiation of the injected component itself depends on the language server (or
* some of its services).
*
* Note: It is starting to 'smell' like we should really be using some kind of dependency
* injection framework to deal with stuff like this.
*/
@FunctionalInterface
public interface LSFactory<T> {
T create(SimpleLanguageServer server);
}