X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.debug.browser%2Fsrc%2Forg%2Fsimantics%2Fdebug%2Fbrowser%2Finternal%2FSCL.java;fp=bundles%2Forg.simantics.debug.browser%2Fsrc%2Forg%2Fsimantics%2Fdebug%2Fbrowser%2Finternal%2FSCL.java;h=8c529b03f6a0f14532a774c28e45401864e5dd20;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.debug.browser/src/org/simantics/debug/browser/internal/SCL.java b/bundles/org.simantics.debug.browser/src/org/simantics/debug/browser/internal/SCL.java new file mode 100644 index 000000000..8c529b03f --- /dev/null +++ b/bundles/org.simantics.debug.browser/src/org/simantics/debug/browser/internal/SCL.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (c) 2016 Association for Decentralized Information Management + * in Industry THTH ry. + * 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: + * THTH ry - initial API and implementation + *******************************************************************************/ +package org.simantics.debug.browser.internal; + +import java.net.URL; + +import org.simantics.scl.runtime.reporting.SCLReporting; + +/** + * @author Tuukka Lehtonen / Semantum Oy + */ +public class SCL { + + public static void startDebugServer() throws Exception { + Activator activator = Activator.getDefault(); + DebugBrowserServer server = activator.getDebugServer(); + if (server == null) { + server = activator.startDebugServer(); + SCLReporting.print("Started debug server at " + server.getURL()); + } else { + SCLReporting.print("Debug server is already running at " + server.getURL()); + } + } + + public static void stopDebugServer() throws Exception { + Activator activator = Activator.getDefault(); + DebugBrowserServer server = activator.getDebugServer(); + if (server != null) { + URL url = server.getURL(); + activator.stopDebugServer(); + SCLReporting.print("Stopped debug server that was running at " + url); + } else { + SCLReporting.print("Debug server is not running."); + } + } + +}