use of org.eclipse.wst.server.core.IRuntimeLifecycleListener in project webtools.servertools by eclipse.
the class JavaServerPlugin method start.
/**
* @see Plugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
runtimeListener = new IRuntimeLifecycleListener() {
public void runtimeAdded(IRuntime runtime) {
handleRuntimeChange(runtime, 0);
}
public void runtimeChanged(IRuntime runtime) {
handleRuntimeChange(runtime, 1);
}
public void runtimeRemoved(IRuntime runtime) {
handleRuntimeChange(runtime, 2);
}
};
ServerCore.addRuntimeLifecycleListener(runtimeListener);
// register the debug options listener
final Hashtable<String, String> props = new Hashtable<String, String>(4);
props.put(DebugOptions.LISTENER_SYMBOLICNAME, JavaServerPlugin.PLUGIN_ID);
context.registerService(DebugOptionsListener.class.getName(), new Trace(), props);
}
use of org.eclipse.wst.server.core.IRuntimeLifecycleListener in project webtools.servertools by eclipse.
the class RuntimeLifecycleListenerTestCase method testListener.
public void testListener() {
IRuntimeLifecycleListener listener = new IRuntimeLifecycleListener() {
public void runtimeAdded(IRuntime runtime) {
// ignore
}
public void runtimeChanged(IRuntime runtime) {
// ignore
}
public void runtimeRemoved(IRuntime runtime) {
// ignore
}
};
listener.runtimeAdded(null);
listener.runtimeChanged(null);
listener.runtimeRemoved(null);
}
use of org.eclipse.wst.server.core.IRuntimeLifecycleListener in project liferay-ide by liferay.
the class LiferayServerCore method start.
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext )
*/
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
this.runtimeLifecycleListener = new IRuntimeLifecycleListener() {
@Override
public void runtimeAdded(IRuntime runtime) {
saveGlobalRuntimeSettings(runtime);
}
@Override
public void runtimeChanged(IRuntime runtime) {
saveGlobalRuntimeSettings(runtime);
}
@Override
public void runtimeRemoved(IRuntime runtime) {
saveGlobalRuntimeSettings(runtime);
}
};
this.serverLifecycleListener = new IServerLifecycleListener() {
@Override
public void serverAdded(IServer server) {
saveGlobalServerSettings(server);
}
@Override
public void serverChanged(IServer server) {
saveGlobalServerSettings(server);
}
@Override
public void serverRemoved(IServer server) {
saveGlobalServerSettings(server);
if (connections.get(server.getId()) != null) {
connections.put(server.getId(), null);
}
}
};
ServerCore.addRuntimeLifecycleListener(this.runtimeLifecycleListener);
ServerCore.addServerLifecycleListener(this.serverLifecycleListener);
}
Aggregations