当前位置: 首页>>代码示例>>Java>>正文


Java IServer.PUBLISH_STATE_UNKNOWN属性代码示例

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


在下文中一共展示了IServer.PUBLISH_STATE_UNKNOWN属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: canRestartModule

@Override
public boolean canRestartModule(IModule[] modules) {
	try {
		CloudFoundryServer cloudServer = getCloudFoundryServer();
		IServer server = cloudServer.getServerOriginal();

		// If module is started, we should return true, regardless of the
		// publish state (this is for example an unlinked project that is
		// available and running, just not bound to any project in the
		// workspace)
		int moduleState = server.getModuleState(modules);
		if (moduleState == IServer.STATE_STARTED) {
			return true;
		}

		int publishState = server.getModulePublishState(modules);
		// If state is unknown, then inform module(s) can't be
		// restarted (which will disable push/start context menu operations)
		if (publishState == IServer.PUBLISH_STATE_UNKNOWN) {
			return false;
		}
	}
	catch (CoreException ce) {
		CloudFoundryPlugin.logError(ce);
	}

	return super.canRestartModule(modules);
}
 
开发者ID:eclipse,项目名称:cft,代码行数:28,代码来源:CloudFoundryServerBehaviour.java

示例2: updateState

protected void updateState(Server server, CloudFoundryApplicationModule appModule) throws CoreException {
	IModule[] localModule = new IModule[] { appModule.getLocalModule() };
	server.setModuleState(localModule, appModule.getState());
	if (server.getModulePublishState(localModule) == IServer.PUBLISH_STATE_UNKNOWN) {
		if (!server.hasPublishedResourceDelta(localModule)) {
			server.setModulePublishState(localModule, IServer.PUBLISH_STATE_NONE);
		}
		else {
			server.setModulePublishState(localModule, IServer.PUBLISH_STATE_INCREMENTAL);
		}
	}
	// Update the child module states if available.
	updateChildModuleStates(server, localModule);
}
 
开发者ID:eclipse,项目名称:cft,代码行数:14,代码来源:CloudFoundryServer.java

示例3: updateChildModuleStates

private void updateChildModuleStates(Server server, IModule[] parentModule) throws CoreException {
	if (parentModule == null || parentModule.length == 0) {
		return;
	}

	int parentModuleSize = parentModule.length;

	IModule[] childModules = server.getChildModules(parentModule, null);
	if (childModules == null || childModules.length == 0) {
		return;
	}
	for (IModule curChildModule : childModules) {
		IModule[] curFullChildModule = new IModule[parentModuleSize + 1];
		System.arraycopy(parentModule, 0, curFullChildModule, 0, parentModuleSize);
		curFullChildModule[parentModuleSize] = curChildModule;

		if (server.getModulePublishState(curFullChildModule) == IServer.PUBLISH_STATE_UNKNOWN) {
			if (!server.hasPublishedResourceDelta(curFullChildModule)) {
				server.setModulePublishState(curFullChildModule, IServer.PUBLISH_STATE_NONE);
			}
			else {
				server.setModulePublishState(curFullChildModule, IServer.PUBLISH_STATE_INCREMENTAL);
			}
		}
		updateChildModuleStates(server, curFullChildModule);
	}
}
 
开发者ID:eclipse,项目名称:cft,代码行数:27,代码来源:CloudFoundryServer.java

示例4: updateState

protected void updateState(Server server, DockerFoundryApplicationModule appModule) throws CoreException {
	IModule[] localModule = new IModule[] { appModule.getLocalModule() };
	server.setModuleState(localModule, appModule.getState());
	if (server.getModulePublishState(localModule) == IServer.PUBLISH_STATE_UNKNOWN) {
		if (!server.hasPublishedResourceDelta(localModule)) {
			server.setModulePublishState(localModule, IServer.PUBLISH_STATE_NONE);
		}
		else {
			server.setModulePublishState(localModule, IServer.PUBLISH_STATE_INCREMENTAL);
		}
	}
	// Update the child module states if available.
	updateChildModuleStates(server, localModule);
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:14,代码来源:DockerFoundryServer.java

示例5: publishModule

@Override
public int publishModule(int kind, int deltaKind, IModule[] module, IProgressMonitor monitor) throws CoreException {
	return IServer.PUBLISH_STATE_UNKNOWN;
}
 
开发者ID:fbricon,项目名称:wildfly-hive,代码行数:4,代码来源:NoOpPublishController.java

示例6: publishModule

@Override
protected void publishModule(int kind, int deltaKind, IModule[] module, IProgressMonitor monitor)
		throws CoreException {
	super.publishModule(kind, deltaKind, module, monitor);

	try {
		// If the delta indicates that the module has been removed, remove
		// it
		// from the server.
		// Note that although the "module" parameter is of IModule[] type,
		// documentation
		// (and the name of the parameter) indicates that it is always one
		// module
		if (deltaKind == REMOVED) {
			final DockerFoundryServer cloudServer = getCloudFoundryServer();
			final DockerFoundryApplicationModule cloudModule = cloudServer.getCloudModule(module[0]);
			if (cloudModule.getApplication() != null) {
				new BehaviourRequest<Void>(NLS.bind(Messages.DELETING_MODULE,
						cloudModule.getDeployedApplicationName())) {
					@Override
					protected Void doRun(DockerClient client, SubMonitor progress) throws CoreException {
						// client.deleteApplication(cloudModule.getDeployedApplicationName());
						return null;
					}
				}.run(monitor);
			}

		}
		else if (!module[0].isExternal()) {
			// These operations must ONLY be performed on NON-EXTERNAL
			// applications (apps with associated accessible workspace
			// projects).
			// Do not perform any updates or restarts on non-workspace
			// (external) apps, as some spaces may contain long-running
			// applications that
			// should not be restarted.
			int publishState = getServer().getModulePublishState(module);
			ICloudFoundryOperation op = null;
			if (deltaKind == ServerBehaviourDelegate.ADDED || publishState == IServer.PUBLISH_STATE_UNKNOWN) {
				// Application has not been published, so do a full
				// publish
				op = operations().applicationDeployment(module, ApplicationAction.PUSH);
			}
			else if (deltaKind == ServerBehaviourDelegate.CHANGED) {
				op = operations().applicationDeployment(module, ApplicationAction.UPDATE_RESTART);
			}
			// Republish the root module if any of the child module requires
			// republish
			else if (isChildModuleChanged(module, monitor)) {
				op = operations().applicationDeployment(module, ApplicationAction.UPDATE_RESTART);
			}

			// NOTE: No need to run this as a separate Job, as publish
			// operations
			// are already run in a PublishJob. To better integrate with
			// WST, ensure publish operation
			// is run to completion in the PublishJob, unless launching
			// asynch events to notify other components while the main
			// publish operation is being run (e.g refresh UI, etc..).
			if (op != null) {
				op.run(monitor);
			}
		}
	}
	catch (CoreException e) {
		handlePublishError(e);
		throw e;
	}
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:69,代码来源:DockerFoundryServerBehaviour.java


注:本文中的org.eclipse.wst.server.core.IServer.PUBLISH_STATE_UNKNOWN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。