]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.debug.browser/src/org/simantics/debug/browser/internal/SCL.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.debug.browser / src / org / simantics / debug / browser / internal / SCL.java
1 /*******************************************************************************
2  * Copyright (c) 2016 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     THTH ry - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.debug.browser.internal;
13
14 import java.net.URL;
15
16 import org.simantics.scl.runtime.reporting.SCLReporting;
17
18 /**
19  * @author Tuukka Lehtonen / Semantum Oy
20  */
21 public class SCL {
22
23     public static void startDebugServer() throws Exception {
24         Activator activator = Activator.getDefault();
25         DebugBrowserServer server = activator.getDebugServer();
26         if (server == null) {
27             server = activator.startDebugServer();
28             SCLReporting.print("Started debug server at " + server.getURL());
29         } else {
30             SCLReporting.print("Debug server is already running at " + server.getURL());
31         }
32     }
33
34     public static void stopDebugServer() throws Exception {
35         Activator activator = Activator.getDefault();
36         DebugBrowserServer server = activator.getDebugServer();
37         if (server != null) {
38             URL url = server.getURL();
39             activator.stopDebugServer();
40             SCLReporting.print("Stopped debug server that was running at " + url);
41         } else {
42             SCLReporting.print("Debug server is not running.");
43         }
44     }
45
46 }