本文整理汇总了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);
}
}
示例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);
}
示例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);
}
}