本文整理汇总了Java中org.codehaus.classworlds.ClassRealm类的典型用法代码示例。如果您正苦于以下问题:Java ClassRealm类的具体用法?Java ClassRealm怎么用?Java ClassRealm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClassRealm类属于org.codehaus.classworlds包,在下文中一共展示了ClassRealm类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addProjectDependenciesToClassRealm
import org.codehaus.classworlds.ClassRealm; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void addProjectDependenciesToClassRealm(ExpressionEvaluator expressionEvaluator, ClassRealm containerRealm) throws ComponentConfigurationException {
Set<String> runtimeClasspathElements = new HashSet<String>();
try {
runtimeClasspathElements.addAll((List<String>) expressionEvaluator.evaluate("${project.runtimeClasspathElements}"));
} catch (ExpressionEvaluationException e) {
throw new ComponentConfigurationException("There was a problem evaluating: ${project.runtimeClasspathElements}", e);
}
Collection<URL> urls = this.buildURLs(runtimeClasspathElements);
urls.addAll(this.buildAritfactDependencies(expressionEvaluator));
for (URL url : urls) {
containerRealm.addConstituent(url);
}
}
开发者ID:EricssonResearch,项目名称:trap,代码行数:17,代码来源:IndexConfigurator.java
示例2: addProjectDependenciesToClassRealm
import org.codehaus.classworlds.ClassRealm; //导入依赖的package包/类
private void addProjectDependenciesToClassRealm(ExpressionEvaluator expressionEvaluator, ClassRealm containerRealm)
throws ComponentConfigurationException
{
List<String> runtimeClasspathElements;
try
{
// noinspection unchecked
runtimeClasspathElements = (List<String>) expressionEvaluator
.evaluate("${project.runtimeClasspathElements}");
}
catch (ExpressionEvaluationException e)
{
throw new ComponentConfigurationException(
"There was a problem evaluating: ${project.runtimeClasspathElements}", e);
}
// Add the project dependencies to the ClassRealm
final URL[] urls = buildURLs(runtimeClasspathElements);
for (URL url : urls)
{
containerRealm.addConstituent(url);
}
}
开发者ID:protostuff,项目名称:protostuff,代码行数:24,代码来源:IncludeProjectDependenciesComponentConfigurator.java
示例3: addProjectDependenciesToClassRealm
import org.codehaus.classworlds.ClassRealm; //导入依赖的package包/类
private void addProjectDependenciesToClassRealm(ExpressionEvaluator expressionEvaluator, ClassRealm containerRealm)
throws ComponentConfigurationException {
List<String> runtimeClasspathElements;
try {
// noinspection unchecked
runtimeClasspathElements = (List<String>) expressionEvaluator
.evaluate("${project.runtimeClasspathElements}");
} catch (ExpressionEvaluationException e) {
throw new ComponentConfigurationException(
"There was a problem evaluating: ${project.runtimeClasspathElements}", e);
}
// Add the project dependencies to the ClassRealm
final URL[] urls = buildURLs(runtimeClasspathElements);
for (URL url : urls) {
containerRealm.addConstituent(url);
}
}
开发者ID:raphaeljolivet,项目名称:java2typescript,代码行数:19,代码来源:IncludeProjectDependenciesComponentConfigurator.java
示例4: configureComponent
import org.codehaus.classworlds.ClassRealm; //导入依赖的package包/类
public void configureComponent(Object component, PlexusConfiguration configuration,
ExpressionEvaluator expressionEvaluator, ClassRealm containerRealm, ConfigurationListener listener)
throws ComponentConfigurationException {
addProjectDependenciesToClassRealm(expressionEvaluator, containerRealm);
converterLookup.registerConverter(new ClassRealmConverter(containerRealm));
ObjectWithFieldsConverter converter = new ObjectWithFieldsConverter();
converter.processConfiguration(converterLookup, component, containerRealm.getClassLoader(), configuration,
expressionEvaluator, listener);
}
开发者ID:brooklyncentral,项目名称:brooklyn-maven-plugin,代码行数:11,代码来源:IncludeProjectDependenciesComponentConfigurator.java
示例5: addProjectDependenciesToClassRealm
import org.codehaus.classworlds.ClassRealm; //导入依赖的package包/类
private void addProjectDependenciesToClassRealm(ExpressionEvaluator expressionEvaluator, ClassRealm containerRealm) throws ComponentConfigurationException {
List<String> runtimeClasspathElements;
try {
//noinspection unchecked
runtimeClasspathElements = (List<String>) expressionEvaluator.evaluate("${project.runtimeClasspathElements}");
} catch (ExpressionEvaluationException e) {
throw new ComponentConfigurationException("There was a problem evaluating: ${project.runtimeClasspathElements}", e);
}
final URL[] urls = buildURLs(runtimeClasspathElements);
for (URL url : urls) {
containerRealm.addConstituent(url);
}
}
开发者ID:brooklyncentral,项目名称:brooklyn-maven-plugin,代码行数:15,代码来源:IncludeProjectDependenciesComponentConfigurator.java
示例6: configureComponent
import org.codehaus.classworlds.ClassRealm; //导入依赖的package包/类
public void configureComponent(Object component, PlexusConfiguration configuration,
ExpressionEvaluator expressionEvaluator, ClassRealm containerRealm,
ConfigurationListener listener)
throws ComponentConfigurationException
{
addProjectDependenciesToClassRealm(expressionEvaluator, containerRealm);
converterLookup.registerConverter(new ClassRealmConverter(containerRealm));
ObjectWithFieldsConverter converter = new ObjectWithFieldsConverter();
converter.processConfiguration(converterLookup, component, containerRealm.getClassLoader(), configuration,
expressionEvaluator, listener);
}
开发者ID:protostuff,项目名称:protostuff,代码行数:13,代码来源:IncludeProjectDependenciesComponentConfigurator.java
示例7: setupClasspath
import org.codehaus.classworlds.ClassRealm; //导入依赖的package包/类
private void setupClasspath() throws DependencyResolutionRequiredException, DuplicateRealmException, MalformedURLException {
List<String> elements = project.getCompileClasspathElements();
ClassWorld world = new ClassWorld();
ClassRealm realm;
realm = world.newRealm("maven.plugin." + getClass().getSimpleName(), Thread.currentThread().getContextClassLoader());
for (String e : elements) {
File elementFile = new File(e);
URL url = new URL("file:///" + elementFile.getPath() + (elementFile.isDirectory() ? "/" : ""));
realm.addConstituent(url);
}
Thread.currentThread().setContextClassLoader(realm.getClassLoader());
}
开发者ID:mvb-online,项目名称:restapi-doc,代码行数:14,代码来源:RestApiDocGeneratorMojo.java
示例8: configureComponent
import org.codehaus.classworlds.ClassRealm; //导入依赖的package包/类
@Override
public void configureComponent(Object component, PlexusConfiguration configuration,
ExpressionEvaluator expressionEvaluator, ClassRealm containerRealm,
ConfigurationListener listener)
throws ComponentConfigurationException {
addProjectDependenciesToClassRealm(expressionEvaluator, containerRealm);
ObjectWithFieldsConverter converter = new ObjectWithFieldsConverter();
converter.processConfiguration(converterLookup, component, containerRealm.getClassLoader(), configuration,
expressionEvaluator, listener);
}
开发者ID:kongchen,项目名称:swagger-maven-plugin,代码行数:12,代码来源:IncludeProjectDependenciesComponentConfigurator.java
示例9: addProjectDependenciesToClassRealm
import org.codehaus.classworlds.ClassRealm; //导入依赖的package包/类
private void addProjectDependenciesToClassRealm(ExpressionEvaluator expressionEvaluator, ClassRealm containerRealm) throws ComponentConfigurationException {
List<String> compileClasspathElements;
try {
//noinspection unchecked
compileClasspathElements = (List<String>) expressionEvaluator.evaluate("${project.compileClasspathElements}");
} catch (ExpressionEvaluationException e) {
throw new ComponentConfigurationException("There was a problem evaluating: ${project.compileClasspathElements}", e);
}
// Add the project dependencies to the ClassRealm
final URL[] urls = buildURLs(compileClasspathElements);
for (URL url : urls) {
containerRealm.addConstituent(url);
}
}
开发者ID:kongchen,项目名称:swagger-maven-plugin,代码行数:16,代码来源:IncludeProjectDependenciesComponentConfigurator.java
示例10: getClassLoader
import org.codehaus.classworlds.ClassRealm; //导入依赖的package包/类
public static ClassLoader getClassLoader(ClassPathManager classPathManager, File pluginJarFile) {
ClassWorld classWorld = classPathManager.classWorld;
String pluginRealmName = pluginJarFile.toURI().toString();
try {
ClassRealm pluginRealm = classWorld.getRealm(pluginRealmName);
return pluginRealm.getClassLoader();
} catch (NoSuchRealmException e) {
throw new RuntimeException(e);
}
}
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:11,代码来源:ClassPathManagerUtils.java
示例11: configureComponent
import org.codehaus.classworlds.ClassRealm; //导入依赖的package包/类
@Override
public void configureComponent(Object component, PlexusConfiguration configuration,
ExpressionEvaluator expressionEvaluator, ClassRealm containerRealm, ConfigurationListener listener)
throws ComponentConfigurationException {
addProjectDependenciesToClassRealm(expressionEvaluator, containerRealm);
converterLookup.registerConverter(new ClassRealmConverter(containerRealm));
ObjectWithFieldsConverter converter = new ObjectWithFieldsConverter();
converter.processConfiguration(converterLookup, component, containerRealm.getClassLoader(), configuration,
expressionEvaluator, listener);
}
开发者ID:raphaeljolivet,项目名称:java2typescript,代码行数:15,代码来源:IncludeProjectDependenciesComponentConfigurator.java
示例12: createClassLoader
import org.codehaus.classworlds.ClassRealm; //导入依赖的package包/类
/**
* It uses Maven <code>ClassWorld</code> and <code>ClassRealm</code> where
* the project classes/resources/dependencies will be associated<br>
* See <a href=http://stackoverflow.com/questions/2659048/add-maven-build-
* classpath -to-plugin-execution-classpath>add maven build classpath to
* plugin execution classpath</a><br>
* See also Apache Maven (Pearson editions) chapter 11, p 181 <i>Cr�er un
* plugin : des classes et des royaumes</i>
*
* @return
* @throws MalformedURLException
* @throws DuplicateRealmException
*/
protected ClassLoader createClassLoader() throws MalformedURLException,
DuplicateRealmException {
ClassWorld world = new ClassWorld();
ClassRealm realm = world.newRealm("txnmgr-docgen");
final URL[] urls = buildURLs(runtimeClasspathElements);
for (URL url : urls) {
realm.addConstituent(url);
}
return realm.getClassLoader();
}
开发者ID:dgrandemange,项目名称:txnmgrflow-docgen-maven-plugin,代码行数:26,代码来源:DocGenMojo.java
示例13: configureComponent
import org.codehaus.classworlds.ClassRealm; //导入依赖的package包/类
public void configureComponent(Object component, PlexusConfiguration configuration, ExpressionEvaluator expressionEvaluator, ClassRealm containerRealm, ConfigurationListener listener) throws ComponentConfigurationException {
this.addProjectDependenciesToClassRealm(expressionEvaluator, containerRealm);
this.converterLookup.registerConverter(new ClassRealmConverter(containerRealm));
ObjectWithFieldsConverter converter = new ObjectWithFieldsConverter();
converter.processConfiguration(this.converterLookup, component, containerRealm.getClassLoader(), configuration, expressionEvaluator, listener);
}
开发者ID:EricssonResearch,项目名称:trap,代码行数:11,代码来源:IndexConfigurator.java
注:本文中的org.codehaus.classworlds.ClassRealm类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论