• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ServerEvent类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.eclipse.wst.server.core.ServerEvent的典型用法代码示例。如果您正苦于以下问题:Java ServerEvent类的具体用法?Java ServerEvent怎么用?Java ServerEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

ServerEvent类属于org.eclipse.wst.server.core包,在下文中一共展示了ServerEvent类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: serverChanged

点赞 3

import org.eclipse.wst.server.core.ServerEvent; //导入依赖的package包/类
@Override
public void serverChanged(ServerEvent event) {
  Preconditions.checkState(server == event.getServer());
  switch (event.getState()) {
    case IServer.STATE_STARTED:
      openBrowserPage(server);
      fireChangeEvent(DebugEvent.STATE);
      return;

    case IServer.STATE_STOPPED:
      server.removeServerListener(serverEventsListener);
      fireTerminateEvent();
      try {
        logger.fine("Server stopped; terminating launch"); //$NON-NLS-1$
        launch.terminate();
      } catch (DebugException ex) {
        logger.log(Level.WARNING, "Unable to terminate launch", ex); //$NON-NLS-1$
      }
      return;

    default:
      fireChangeEvent(DebugEvent.STATE);
      return;
  }
}
 

开发者ID:GoogleCloudPlatform,
项目名称:google-cloud-eclipse,
代码行数:26,
代码来源:LocalAppEngineServerLaunchConfigurationDelegate.java

示例2: initialize

点赞 3

import org.eclipse.wst.server.core.ServerEvent; //导入依赖的package包/类
@Override
protected void initialize(IProgressMonitor monitor) {
	super.initialize(monitor);
	getServer().addServerListener(serverListener, ServerEvent.SERVER_CHANGE);

	try {
		refreshHandler = new RefreshModulesHandler(getCloudFoundryServer());

		// getApplicationUrlLookup().refreshDomains(monitor);

		// Important: Must perform a refresh operation
		// as any operation that calls the CF client first
		// performs a server connection and sets server state.
		// The server connection is indirectly performed by this
		// first refresh call.
		getRefreshHandler().scheduleRefreshAll();
	}
	catch (CoreException e) {
		DockerFoundryPlugin.logError(e);
	}
}
 

开发者ID:osswangxining,
项目名称:dockerfoundry,
代码行数:22,
代码来源:DockerFoundryServerBehaviour.java

示例3: serverChanged

点赞 2

import org.eclipse.wst.server.core.ServerEvent; //导入依赖的package包/类
public void serverChanged(ServerEvent event) {
	if (CloudFoundryRsePlugin.doesServerBelongToHost(event.getServer(), getHost())) {
		if ((event.getKind() & ServerEvent.MODULE_CHANGE) != 0 && (event.getKind() & ServerEvent.STATE_CHANGE) != 0) {
			if (event.getState() == IServer.STATE_STARTED || event.getState() == IServer.STATE_STOPPED) {
				fireEventChangeChildren();
			}
		}
	}
}
 

开发者ID:eclipse,
项目名称:cft,
代码行数:10,
代码来源:ApplicationSubSystem.java

示例4: serverChanged

点赞 2

import org.eclipse.wst.server.core.ServerEvent; //导入依赖的package包/类
public void serverChanged(ServerEvent event) {
	// refresh when server is saved, e.g. due to add/remove of modules
	if (event.getKind() == ServerEvent.SERVER_CHANGE) {
		launchRefresh(new UpdateEditorOperation(CloudServerEvent.EVENT_UPDATE_COMPLETED, RefreshArea.ALL,
				event.getStatus()));
	}
}
 

开发者ID:eclipse,
项目名称:cft,
代码行数:8,
代码来源:CloudFoundryApplicationsEditorPage.java

示例5: initialize

点赞 2

import org.eclipse.wst.server.core.ServerEvent; //导入依赖的package包/类
@Override
protected void initialize(IProgressMonitor monitor) {
	super.initialize(monitor);

	CFRebelServerIntegration integration = CloudFoundryPlugin.getCallback().getJRebelServerIntegration();
	if (integration != null) {
		integration.register();
	}
	getServer().addServerListener(serverListener, ServerEvent.SERVER_CHANGE);

	try {
		// This code will just throw an exception for an sso server
		if (getCloudFoundryServer().isSso() && getCloudFoundryServer().getToken() == null) {
			return;
		}

		getApplicationUrlLookup().refreshDomains(monitor);

		// Important: Must perform a refresh operation
		// as any operation that calls the CF client first
		// performs a server connection and sets server state.
		// The server connection is indirectly performed by this
		// first refresh call.
		asyncUpdateAll();

		ServerEventHandler.getDefault().fireServerEvent(
				new CloudServerEvent(getCloudFoundryServer(), CloudServerEvent.EVENT_SERVER_CONNECTED));
	}
	catch (CoreException e) {
		CloudFoundryPlugin.logError(e);
	}
}
 

开发者ID:eclipse,
项目名称:cft,
代码行数:33,
代码来源:CloudFoundryServerBehaviour.java

示例6: serverChanged

点赞 2

import org.eclipse.wst.server.core.ServerEvent; //导入依赖的package包/类
public void serverChanged(ServerEvent event) {
	// refresh when server is saved, e.g. due to add/remove of modules
	if (event.getKind() == ServerEvent.SERVER_CHANGE) {
		launchRefresh(new RefreshEditorOperation(CloudServerEvent.EVENT_SERVER_REFRESHED, RefreshArea.ALL,
				event.getStatus()));
	}
}
 

开发者ID:osswangxining,
项目名称:dockerfoundry,
代码行数:8,
代码来源:DockerFoundryApplicationsEditorPage.java

示例7: serverChanged

点赞 2

import org.eclipse.wst.server.core.ServerEvent; //导入依赖的package包/类
@Override
public void serverChanged(ServerEvent event) {
  if ((event.getKind() & ServerEvent.SERVER_CHANGE) != 0) {
    update(event.getState());
  }
}
 

开发者ID:GoogleCloudPlatform,
项目名称:google-cloud-eclipse,
代码行数:7,
代码来源:LocalAppEngineConsole.java

示例8: serverChanged

点赞 2

import org.eclipse.wst.server.core.ServerEvent; //导入依赖的package包/类
@Override
public void serverChanged(ServerEvent event) {
  update();
}
 

开发者ID:GoogleCloudPlatform,
项目名称:google-cloud-eclipse,
代码行数:5,
代码来源:LocalAppEngineConsolePageParticipant.java

示例9: restartServer

点赞 2

import org.eclipse.wst.server.core.ServerEvent; //导入依赖的package包/类
private void restartServer(IServer server, IProgressMonitor monitor) throws CoreException {
	monitor.subTask("Restarting server"); //$NON-NLS-1$

	final CountDownLatch eventLatch = new CountDownLatch(1);
	IServerListener serverListener = new IServerListener() {
		public void serverChanged(ServerEvent event) {
			if (event.getState() == IServer.STATE_STARTED) {
				eventLatch.countDown();
			}
		}
	};

	try {
		server.addServerListener(serverListener);

		if (server.getServerState() != IServer.STATE_STARTED) {
			server.start(ILaunchManager.DEBUG_MODE, monitor);
		}
		else if (server.getServerRestartState()) {
			server.restart(ILaunchManager.DEBUG_MODE, monitor);
		}
		else {
			return;
		}

		// wait 10 seconds
		monitor.subTask("Waiting for server to start"); //$NON-NLS-1$
		for (int i = 0; i < 50; i++) {
			try {
				if (eventLatch.await(200, TimeUnit.MILLISECONDS)) {
					break;
				}
			}
			catch (InterruptedException e) {
				throw new OperationCanceledException();
			}
			if (monitor != null && monitor.isCanceled()) {
				throw new OperationCanceledException();
			}
		}
	}
	finally {
		server.removeServerListener(serverListener);
	}
}
 

开发者ID:eclipse,
项目名称:cft,
代码行数:46,
代码来源:ServerHandler.java

示例10: serverChanged

点赞 2

import org.eclipse.wst.server.core.ServerEvent; //导入依赖的package包/类
public void serverChanged(ServerEvent event) {
	update();
}
 

开发者ID:eclipse,
项目名称:cft,
代码行数:4,
代码来源:CloudFoundryServerStatusSection.java

示例11: serverChanged

点赞 2

import org.eclipse.wst.server.core.ServerEvent; //导入依赖的package包/类
@Override
public void serverChanged(final ServerEvent event)
{
  // update modules
  updateModules(event.getServer());
}
 

开发者ID:UBPL,
项目名称:jive,
代码行数:7,
代码来源:JiveTomcatLaunchPlugin.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)