-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* #96 #94 Cleanup and refactor client-server communication - Refactor client-server communication into a base protocol and a jsonrpc specific implementation (#94) - Cleanup protocol and implement (previously unused) shutdown method - Add ClientSessionManager to track lifecycle of GLSP client connections (#96) - Add listener-mechanism to react to lifecycle changes (used in DefaultModelStateProvider) - Remove (now obsolete) GLSPClientProxyProvider - Fix wrong version of guava in org.eclipse.glsp.graph pom.xml - Add unique applicationId to InitializeParameters Part of: - eclipse-glsp/glsp/issues/94 - eclipse-glsp/glsp/issues/96 * Fix minors * Adapt copyright headers and fix checkstyle warnings Co-authored-by: Philip Langer <planger@eclipsesource.com>
- Loading branch information
Showing
39 changed files
with
422 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
plugins/org.eclipse.glsp.api/src/org/eclipse/glsp/api/protocol/ClientSessionListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2020 EclipseSource and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the Eclipse | ||
* Public License v. 2.0 are satisfied: GNU General Public License, version 2 | ||
* with the GNU Classpath Exception which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
********************************************************************************/ | ||
package org.eclipse.glsp.api.protocol; | ||
|
||
public interface ClientSessionListener { | ||
|
||
default void clientConnected(final GLSPClient client) { | ||
// No-op as default. This enables partial interface implementation. | ||
} | ||
|
||
default void sessionCreated(final String clientId, final GLSPClient client) { | ||
// No-op as default. This enables partial interface implementation. | ||
} | ||
|
||
default void sessionClosed(final String clientId, final GLSPClient client) { | ||
// No-op as default. This enables partial interface implementation. | ||
} | ||
|
||
default void clientDisconnected(final GLSPClient client) { | ||
// No-op as default. This enables partial interface implementation. | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
plugins/org.eclipse.glsp.api/src/org/eclipse/glsp/api/protocol/ClientSessionManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2020 EclipseSource and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the Eclipse | ||
* Public License v. 2.0 are satisfied: GNU General Public License, version 2 | ||
* with the GNU Classpath Exception which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
********************************************************************************/ | ||
package org.eclipse.glsp.api.protocol; | ||
|
||
import java.util.Optional; | ||
|
||
public interface ClientSessionManager { | ||
|
||
boolean connectClient(GLSPClient client); | ||
|
||
boolean createClientSession(GLSPClient glspClient, String clientId); | ||
|
||
boolean disposeClientSession(String clientId); | ||
|
||
boolean disconnectClient(GLSPClient client); | ||
|
||
boolean addListener(ClientSessionListener listener); | ||
|
||
boolean removeListener(ClientSessionListener listener); | ||
|
||
Optional<GLSPClient> resolve(String clientId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
plugins/org.eclipse.glsp.api/src/org/eclipse/glsp/api/protocol/GLSPServer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2019-2020 EclipseSource and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the Eclipse | ||
* Public License v. 2.0 are satisfied: GNU General Public License, version 2 | ||
* with the GNU Classpath Exception which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
******************************************************************************/ | ||
package org.eclipse.glsp.api.protocol; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
|
||
import org.eclipse.glsp.api.action.ActionMessage; | ||
|
||
public interface GLSPServer<T extends GLSPClient> { | ||
CompletableFuture<Boolean> initialize(InitializeParameters params); | ||
|
||
void process(ActionMessage message); | ||
|
||
CompletableFuture<Boolean> shutdown(); | ||
|
||
void connect(T client); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.