| package org.eclipse.e4.languages.javascript.debug; |
| |
| import org.eclipse.e4.languages.internal.javascript.debug.Constants; |
| import org.eclipse.e4.languages.javascript.debug.rhino.RhinoDebugger; |
| import org.mozilla.javascript.ContextFactory; |
| import org.osgi.framework.BundleActivator; |
| import org.osgi.framework.BundleContext; |
| import org.osgi.framework.ServiceRegistration; |
| |
| public class Activator implements BundleActivator { |
| |
| private ServiceRegistration registration; |
| private RhinoDebugger debugger; |
| |
| public void start(final BundleContext context) throws Exception { |
| String rhinoDebug = context.getProperty(Constants.RHINO_DEBUG); |
| if (rhinoDebug != null) { |
| debugger = new RhinoDebugger(rhinoDebug); |
| registration = context.registerService(ContextFactory.Listener.class.getName(), debugger, null); |
| debugger.start(); |
| } |
| } |
| |
| public void stop(BundleContext context) throws Exception { |
| if (registration != null) { |
| registration.unregister(); |
| debugger.stop(); |
| } |
| } |
| |
| } |