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


Java ServerUtil.modifyModules方法代码示例

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


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

示例1: run

import org.eclipse.wst.server.core.ServerUtil; //导入方法依赖的package包/类
@Override
public void run(IProgressMonitor monitor) throws CoreException {
	IServer server = cloudServer.getServer();

	IServerWorkingCopy wc = server.createWorkingCopy();

	ModuleCache moduleCache = CloudFoundryPlugin.getModuleCache();
	ServerData data = moduleCache.getData(cloudServer.getServerOriginal());
	data.tagForReplace(appModule);

	ServerUtil.modifyModules(wc, new IModule[0], new IModule[] { appModule.getLocalModule() }, monitor);
	wc.save(true, monitor);

	CloudFoundryApplicationModule updatedModule = cloudServer
			.getExistingCloudModule(appModule.getDeployedApplicationName());

	if (updatedModule != null) {
		// Do a complete update of the module with Cloud information since
		// the link/unlink project may re-create
		// the module
		cloudServer.getBehaviour().operations().updateModule(updatedModule.getLocalModule()).run(monitor);
	}
}
 
开发者ID:eclipse,项目名称:cft,代码行数:24,代码来源:UnmapProjectOperation.java

示例2: doMap

import org.eclipse.wst.server.core.ServerUtil; //导入方法依赖的package包/类
protected void doMap(IProject project, IProgressMonitor monitor) throws CoreException {
	IServer server = cloudServer.getServer();

	IServerWorkingCopy wc = server.createWorkingCopy();

	final IModule[] modules = ServerUtil.getModules(project);

	if (modules == null || modules.length == 0) {
		throw CloudErrorUtil
				.toCoreException("Unable to create module for " + project.getName() + ". Failed to map to " + appModule.getDeployedApplicationName()); //$NON-NLS-1$ //$NON-NLS-2$
	}

	if (ServerUtil.containsModule(server, modules[0], monitor)) {
		throw CloudErrorUtil
				.toCoreException("Unable to create module for " + project.getName() + ". Module already exists. Failed to map to " + appModule.getDeployedApplicationName()); //$NON-NLS-1$ //$NON-NLS-2$
	}

	IModule[] add = new IModule[] { modules[0] };

	ServerUtil.modifyModules(wc, add, new IModule[] { appModule.getLocalModule() }, monitor);
	wc.save(true, monitor);

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

示例3: doMap

import org.eclipse.wst.server.core.ServerUtil; //导入方法依赖的package包/类
protected void doMap(IProject project, IProgressMonitor monitor) throws CoreException {
	IServer server = cloudServer.getServer();

	IServerWorkingCopy wc = server.createWorkingCopy();

	final IModule[] modules = ServerUtil.getModules(project);

	if (modules == null || modules.length == 0) {
		throw CloudErrorUtil
				.toCoreException("Unable to create module for " + project.getName() + ". Failed to link the project with " + appModule.getDeployedApplicationName()); //$NON-NLS-1$ //$NON-NLS-2$
	}

	if (ServerUtil.containsModule(server, modules[0], monitor)) {
		throw CloudErrorUtil
				.toCoreException("Unable to create module for " + project.getName() + ". Module already exists. Failed to link the project with " + appModule.getDeployedApplicationName()); //$NON-NLS-1$ //$NON-NLS-2$
	}

	IModule[] add = new IModule[] { modules[0] };

	ServerUtil.modifyModules(wc, add, new IModule[] { appModule.getLocalModule() }, monitor);
	wc.save(true, monitor);

	CloudFoundryServerBehaviour behaviour = cloudServer.getBehaviour();
	if (behaviour != null) {
		behaviour.cleanModuleStates(add, monitor);
	}

	CloudFoundryApplicationModule updatedModule = cloudServer.getExistingCloudModule(appModule
			.getDeployedApplicationName());

	if (updatedModule != null) {
		// Do a complete update of the module with Cloud information since
		// the link/unlink project may re-create
		// the module
		cloudServer.getBehaviour().operations().updateModule(updatedModule.getLocalModule()).run(monitor);
	}
}
 
开发者ID:eclipse,项目名称:cft,代码行数:38,代码来源:MapToProjectOperation.java


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