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


Java IModule.getName方法代码示例

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


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

示例1: getTempJarPath

import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
protected String getTempJarPath(IModule module) throws CoreException {
	try {
		File tempFolder = File.createTempFile("tempFolderForJavaAppJar", //$NON-NLS-1$
				null);
		tempFolder.delete();
		tempFolder.mkdirs();

		if (!tempFolder.exists()) {
			throw CloudErrorUtil.toCoreException(
					NLS.bind(Messages.JavaCloudFoundryArchiver_ERROR_CREATE_TEMP_DIR, tempFolder.getPath()));
		}

		File targetFile = new File(tempFolder, module.getName() + ".jar"); //$NON-NLS-1$
		targetFile.deleteOnExit();

		String path = new Path(targetFile.getAbsolutePath()).toString();

		return path;

	} catch (IOException io) {
		CloudErrorUtil.toCoreException(io);
	}
	return null;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:25,代码来源:JarArchivingUIHandler.java

示例2: getOrCreateCloudModule

import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
synchronized CloudFoundryApplicationModule getOrCreateCloudModule(IModule module) {

			// See if the cloud module for the given local IModule has been
			// created.
			CloudFoundryApplicationModule appModule = getExistingCloudModule(module);
			if (appModule != null) {
				return appModule;
			}

			// Otherwise check if there is a mapping between the IModule ID and
			// the deployed application name, and
			// search for a cloud module that matches the deployed application
			// name
			String deployedAppName = getLocalModuleToCloudModuleMapping().get(module.getId());
			if (deployedAppName == null) {
				deployedAppName = module.getName();
			}

			// no mapping found, create new Cloud Foundry-aware module. Note
			// that the
			// deployedAppName and the module name need not be the same.
			appModule = new CloudFoundryApplicationModule(module, deployedAppName, server);

			add(appModule);
			return appModule;
		}
 
开发者ID:eclipse,项目名称:cft,代码行数:27,代码来源:ModuleCache.java

示例3: moduleListToString

import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
/** Convert an array of modules to a String for debugging.*/
private static String moduleListToString(IModule[] module) {
	String moduleStr = "{ ";
	if(module != null) {
		for(int x = 0; x < module.length; x++) {
			IModule currModule = module[x];
			
			if(currModule == null) { continue; } 
			
			moduleStr += currModule.getName()+" ["+currModule.getId()+"/"+(currModule.getModuleType() != null ? currModule.getModuleType().getId() : "")  +"]";
			
			if(x+1 < module.length) {
				moduleStr += ", ";
			}
		}
	}
	moduleStr = moduleStr.trim() + "}";
	
	return moduleStr;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:21,代码来源:CloudFoundryServer.java

示例4: getOrCreateCloudModule

import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
synchronized DockerFoundryApplicationModule getOrCreateCloudModule(IModule module) {

			// See if the cloud module for the given local IModule has been
			// created.
			DockerFoundryApplicationModule appModule = getExistingCloudModule(module);
			if (appModule != null) {
				return appModule;
			}

			// Otherwise check if there is a mapping between the IModule ID and
			// the deployed application name, and
			// search for a cloud module that matches the deployed application
			// name
			String deployedAppName = getLocalModuleToCloudModuleMapping().get(module.getId());
			if (deployedAppName == null) {
				deployedAppName = module.getName();
			}

			// no mapping found, create new Cloud Foundry-aware module. Note
			// that the
			// deployedAppName and the module name need not be the same.
			appModule = new DockerFoundryApplicationModule(module, deployedAppName, server);

			add(appModule);
			return appModule;
		}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:27,代码来源:ModuleCache.java

示例5: getApplicationArchive

import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
@Override
public CFApplicationArchive getApplicationArchive(IModule module, IServer server, IModuleResource[] resources,
		IProgressMonitor monitor) throws CoreException {
	CloudFoundryApplicationModule appModule = CloudServerUtil.getExistingCloudModule(module, server);

	try {
		if (server instanceof Server) {
			File warFile = CloudUtil.createWarFile(new IModule[] { module }, (Server) server, monitor);

			CloudFoundryPlugin.trace("War file " + warFile.getName() + " created"); //$NON-NLS-1$ //$NON-NLS-2$

			return new ZipArchive(new ZipFile(warFile));
		}
		else {
			throw CloudErrorUtil.toCoreException("Expected server: " + server.getId() + " to be of type: "
					+ Server.class.getName() + ". Unable to generate WAR file and deploy the application to the selected server.");
		}
	}
	catch (Exception e) {
		throw new CoreException(new Status(IStatus.ERROR, CloudFoundryPlugin.PLUGIN_ID,
				"Failed to create war file. " + //$NON-NLS-1$
						"\nApplication: " + appModule.getDeployedApplicationName() + //$NON-NLS-1$
						"\nModule: " + module.getName() + //$NON-NLS-1$
						"\nException: " + e.getMessage(), //$NON-NLS-1$
				e));
	}
}
 
开发者ID:eclipse,项目名称:cft,代码行数:28,代码来源:WarApplicationArchiver.java

示例6: createWarFile

import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
/**
 * Creates a partial war file containing only the resources listed in the
 * list to filter in. Note that at least one content must be present in the
 * list to filter in, otherwise null is returned.
 * @param resources
 * @param module
 * @param server
 * @param monitor
 * @return partial war file with resources specified in the filter in list,
 * or null if filter list is empty or null
 * @throws CoreException
 */
public static File createWarFile(List<IModuleResource> allResources, IModule module,
		Set<IModuleResource> filterInResources, IProgressMonitor monitor) throws CoreException {
	if (allResources == null || allResources.isEmpty() || filterInResources == null
			|| filterInResources.isEmpty()) {
		return null;
	}
	List<IStatus> result = new ArrayList<IStatus>();
	try {
		File tempDirectory = getTempFolder(module);
		// tempFile needs to be in the same location as the war file
		// otherwise PublishHelper will fail
		String fileName = module.getName() + ".war"; //$NON-NLS-1$

		File warFile = new File(tempDirectory, fileName);
		warFile.createNewFile();
		warFile.deleteOnExit();
		List<IModuleResource> newResources = new ArrayList<IModuleResource>();
		for (IModuleResource mr : allResources) {
			newResources.add(processModuleResource(mr));
		}

		IStatus[] status = publishZip(allResources, warFile, filterInResources, monitor);
		merge(result, status);
		throwException(result, "Publishing of : " + module.getName() + " failed"); //$NON-NLS-1$ //$NON-NLS-2$

		return warFile;
	}
	catch (IOException e) {
		throw new CoreException(new Status(IStatus.ERROR, CloudFoundryPlugin.PLUGIN_ID,
				"Failed to create war file: " + e.getMessage(), e)); //$NON-NLS-1$
	}
}
 
开发者ID:eclipse,项目名称:cft,代码行数:45,代码来源:CloudUtil.java

示例7: createWarFile

import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
/**
 * Creates a partial war file containing only the resources listed in the
 * list to filter in. Note that at least one content must be present in the
 * list to filter in, otherwise null is returned.
 * @param resources
 * @param module
 * @param server
 * @param monitor
 * @return partial war file with resources specified in the filter in list,
 * or null if filter list is empty or null
 * @throws CoreException
 */
public static File createWarFile(List<IModuleResource> allResources, IModule module,
		Set<IModuleResource> filterInResources, IProgressMonitor monitor) throws CoreException {
	if (allResources == null || allResources.isEmpty() || filterInResources == null || filterInResources.isEmpty()) {
		return null;
	}
	List<IStatus> result = new ArrayList<IStatus>();
	try {
		File tempDirectory = getTempFolder(module);
		// tempFile needs to be in the same location as the war file
		// otherwise PublishHelper will fail
		String fileName = module.getName() + ".war"; //$NON-NLS-1$

		File warFile = new File(tempDirectory, fileName);
		warFile.createNewFile();
		warFile.deleteOnExit();
		List<IModuleResource> newResources = new ArrayList<IModuleResource>();
		for (IModuleResource mr : allResources) {
			newResources.add(processModuleResource(mr));
		}

		IStatus[] status = publishZip(allResources, warFile, filterInResources, monitor);
		merge(result, status);
		throwException(result, "Publishing of : " + module.getName() + " failed"); //$NON-NLS-1$ //$NON-NLS-2$

		return warFile;
	}
	catch (IOException e) {
		throw new CoreException(new Status(IStatus.ERROR, DockerFoundryPlugin.PLUGIN_ID, 
				"Failed to create war file: "+ e.getMessage(), e)); //$NON-NLS-1$
	}
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:44,代码来源:CloudUtil.java

示例8: apply

import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
@Override
public String apply(IModule module) {
  Preconditions.checkNotNull(module);
  return module.getName();
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:6,代码来源:LocalAppEngineServerDelegateTest.java

示例9: createPatternMatchListener

import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
protected ConsolePatternMatchListener createPatternMatchListener(IModule module) {
	return new ConsolePatternMatchListener(module.getName());
}
 
开发者ID:eclipse,项目名称:cft,代码行数:4,代码来源:AbstractConsoleMonitorAppStateTracker.java

示例10: handleRebelProject

import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
protected void handleRebelProject(CloudServerEvent event, IModule module, String consoleMessage,
		IProgressMonitor monitor) throws CoreException {

	CloudFoundryServer cloudServer = event.getServer();

	if (consoleMessage != null) {
		CFRebelConsoleUtil.printToConsole(module, cloudServer, consoleMessage);
	}

	int eventType = event.getType();
	List<String> oldUrls = null;
	List<String> currentUrls = null;
	if (event instanceof AppUrlChangeEvent) {
		AppUrlChangeEvent appUrlEvent = (AppUrlChangeEvent) event;
		oldUrls = appUrlEvent.getOldUrls();
		currentUrls = appUrlEvent.getCurrentUrls();
	}
	else {

		// Get cached module first
		CloudFoundryApplicationModule cloudAppModule = cloudServer.getExistingCloudModule(module);

		if (cloudAppModule != null) {

			CFRebelConsoleUtil.printToConsole(cloudAppModule, cloudServer,
					Messages.CFRebelServerIntegration_UPDATING_APP_MODULE);

			// Update the module to get the latest URLS in Cloud Foundry
			cloudAppModule = cloudServer.getBehaviour().updateDeployedModule(module, monitor);

			CFRebelConsoleUtil.printToConsole(cloudAppModule, cloudServer,
					Messages.CFRebelServerIntegration_UPDATED_APP_MODULE);

			if (cloudAppModule != null && cloudAppModule.getDeploymentInfo() != null) {
				currentUrls = cloudAppModule.getDeploymentInfo().getUris();
			}
		}

		if (cloudAppModule == null) {
			String errorMessage = "Unable to update JRebel server URL for  " + module.getName() //$NON-NLS-1$
					+ ". No cloud application module found.  Please refresh the Cloud server instance " //$NON-NLS-1$
					+ cloudServer.getServer().getId() + " and try again."; //$NON-NLS-1$
			CloudFoundryPlugin.logError(errorMessage); 
			return;
		}
	}

	updateUrls(cloudServer, eventType, module, oldUrls, currentUrls, monitor);
}
 
开发者ID:eclipse,项目名称:cft,代码行数:50,代码来源:CFRebelServerIntegration.java

示例11: convertPublishModuleToString

import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
/** Convert a call to publishModule(...) to a String, for debugging */
private static String convertPublishModuleToString(int deltaKind, IModule[] module) { 
	try {
		String deltaKindStr;
		
		if(deltaKind == REMOVED) {
			deltaKindStr = "REMOVED";
		} else if(deltaKind == ADDED) {
			deltaKindStr = "ADDED";
		} else if(deltaKind == CHANGED) {
			deltaKindStr = "CHANGED";
		} else if(deltaKind == NO_CHANGE) {
			deltaKindStr = "NO_CHANGE";
		} else {
			deltaKindStr = "Unknown";
		}
		
		String moduleStr = "{ ";
		if(module != null) {
			for(int x = 0; x < module.length; x++) {
				IModule currModule = module[x];
				
				if(currModule == null) { continue; } 
				
				moduleStr += currModule.getName()+" ["+currModule.getId()+"/"+(currModule.getModuleType() != null ? currModule.getModuleType().getId() : "")  +"]";
				
				if(x+1 < module.length) {
					moduleStr += ", ";
				}
			}
		}
		moduleStr = moduleStr.trim() + "}";
		
		return "CloudFoundryServerBehaviour.publishModule(...): "+deltaKindStr +" "+moduleStr;
		
	} catch(Exception t) {
		// This method is for logging only; we should not throw exceptions to calling methods under any circumstances.
	}
	
	return "";
}
 
开发者ID:eclipse,项目名称:cft,代码行数:42,代码来源:CloudFoundryServerBehaviour.java

示例12: updateModuleWithBasicCloudInfo

import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
/**
 * Updates a module with enough Cloud information to determine basic Cloud
 * application stats (URL, bound services, env vars, etc..) including its
 * running state in the Cloud. Returns null if the application no longer
 * exists
 * @param module
 * @param monitor
 * @return Updated {@link CloudFoundryApplicationModule} or null if the
 * application no longer exists in the Cloud
 * @throws CoreException
 */
public CloudFoundryApplicationModule updateModuleWithBasicCloudInfo(IModule module, IProgressMonitor monitor)
		throws CoreException {

	CloudFoundryApplicationModule appModule = getCloudFoundryServer().getExistingCloudModule(module);

	String name = appModule != null ? appModule.getDeployedApplicationName() : module.getName();
	return updateModuleWithBasicCloudInfo(name, monitor);
}
 
开发者ID:eclipse,项目名称:cft,代码行数:20,代码来源:CloudFoundryServerBehaviour.java

示例13: updateCloudModule

import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
/**
 * Updates the given module with an application request to the Cloud space.
 * Returns null if the application no longer exists.
 * @param module
 * @param monitor
 * @return Updated {@link DockerFoundryApplicationModule} or null if the
 * application no longer exists in the Cloud Space
 * @throws CoreException
 */
public DockerFoundryApplicationModule updateCloudModule(IModule module, IProgressMonitor monitor)
		throws CoreException {

	DockerFoundryApplicationModule appModule = getCloudFoundryServer().getExistingCloudModule(module);

	String name = appModule != null ? appModule.getDeployedApplicationName() : module.getName();
	return updateCloudModule(name, monitor);
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:18,代码来源:DockerFoundryServerBehaviour.java

示例14: CloudFoundryApplicationModule

import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
/**
 * Creates a cloud module that has a corresponding local module. This should
 * be used if there is an accessible workspace project for the deployed app
 * (the presence of an IModule would indicate a possible accessible
 * workspace resource for the application).
 * @param module local module from the WST server. Must not be null.
 * @param deployedApplicationName name of the deployed application. It may
 * not match the local workspace project name, as users are allowed to
 * specify a different deployment name when pushing an application. Must not
 * be null
 * @param server. Must not be null.
 */
public CloudFoundryApplicationModule(IModule module, String deployedApplicationName, IServer server) {
	this(module, deployedApplicationName, module.getName(), server);
}
 
开发者ID:eclipse,项目名称:cft,代码行数:16,代码来源:CloudFoundryApplicationModule.java

示例15: DockerFoundryApplicationModule

import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
/**
 * Creates a cloud module that has a corresponding local module. This should
 * be used if there is an accessible workspace project for the deployed app
 * (the presence of an IModule would indicate a possible accessible
 * workspace resource for the application).
 * @param module local module from the WST server. Must not be null.
 * @param deployedApplicationName name of the deployed application. It may
 * not match the local workspace project name, as users are allowed to
 * specify a different deployment name when pushing an application. Must not
 * be null
 * @param server. Must not be null.
 */
public DockerFoundryApplicationModule(IModule module, String deployedApplicationName, IServer server) {
	this(module, deployedApplicationName, module.getName(), server);
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:16,代码来源:DockerFoundryApplicationModule.java


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