• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Launcher类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中sun.misc.Launcher的典型用法代码示例。如果您正苦于以下问题:Java Launcher类的具体用法?Java Launcher怎么用?Java Launcher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: instantiateJPMMLModel

import sun.misc.Launcher; //导入依赖的package包/类
private Evaluator instantiateJPMMLModel() {
  PMML pmml = null;
  try {
    pmml = IOUtil.unmarshal(Launcher.class.getResource("/predictionModel-PMML.xml").openStream());
  } catch (Exception e) {
    e.printStackTrace();
  }
  PMMLManager pmmlManager = new PMMLManager(pmml);
  Evaluator evaluator = (Evaluator) pmmlManager.getModelManager(null, ModelEvaluatorFactory.getInstance());
  return evaluator;
}
 
开发者ID:DhruvKumar,项目名称:iot-lab,代码行数:12,代码来源:SparkPredictionBolt.java


示例2: invokeMethod

import sun.misc.Launcher; //导入依赖的package包/类
private void invokeMethod(String className, URL url, String methodName, String args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
    final ClassLoader appClassLoader = Launcher.getLauncher().getClassLoader();
    final Class<?> agentClass = appClassLoader.loadClass(className);
    Method method = null;
    Object[] invokeArgs = null;
    try {
        method = lookupMainOrAgentClass(agentClass, methodName, new Class<?>[] {String.class, Instrumentation.class});
        invokeArgs = new Object[2];
        invokeArgs[1] = InstrumentationManager.createInstrumentation();
    } catch (NoSuchMethodException ex) {
        method = lookupMainOrAgentClass(agentClass, methodName, new Class<?>[] {String.class});
        invokeArgs = new Object[1];
    }
    invokeArgs[0] = args;
    InstrumentationManager.registerAgent(url);
    method.invoke(null, invokeArgs);
}
 
开发者ID:beehive-lab,项目名称:Maxine-VM,代码行数:18,代码来源:JavaRunScheme.java


示例3: shouldCoverAllFunctionsFromJDKPackage

import sun.misc.Launcher; //导入依赖的package包/类
/**
 * see test name.
 */
@Test
public void shouldCoverAllFunctionsFromJDKPackage() throws Exception {

    final Reflections reflections = new Reflections( "java.util.function", Launcher.getBootstrapClassPath().getURLs() );
    final Set<Class<?>> jdkFunctions = reflections.getTypesAnnotatedWith( FunctionalInterface.class );

    final Set<Class<?>> serializableFunctions = serializableFunctions();

    final Set<Class<?>> notFoundJdkFunctions = new HashSet<>();
    for ( final Class<?> jdkFunction : jdkFunctions ) {
        final Class<?> correspondingSerializableFunction =
                findSerializableVariantOf( jdkFunction.getSimpleName(), serializableFunctions );
        if ( correspondingSerializableFunction == null ) {
            notFoundJdkFunctions.add( jdkFunction );
        }
    }

    assertThat( String.format( "Not covered ( %s ): %s ", notFoundJdkFunctions.size(), notFoundJdkFunctions ),
            notFoundJdkFunctions.isEmpty() );
}
 
开发者ID:freiheit-com,项目名称:fdc-serializable-function,代码行数:24,代码来源:Tests.java


示例4: handle

import sun.misc.Launcher; //导入依赖的package包/类
@Override
void handle(String className, URL[] urls, String agentArgs)
    throws IOException, ClassNotFoundException, InvocationTargetException, IllegalAccessException, NoSuchMethodException {
    for (URL url : urls) {
        addURLToAppClassLoader.invoke(Launcher.getLauncher().getClassLoader(), url);
    }
    invokeMethod(className, urls[0], "premain", agentArgs);
}
 
开发者ID:beehive-lab,项目名称:Maxine-VM,代码行数:9,代码来源:JavaRunScheme.java


示例5: test

import sun.misc.Launcher; //导入依赖的package包/类
public void test(String path) throws Exception {
    final File jarFile = getJarFile(null);

    if(jarFile.isFile()) {  // Run with JAR file
        final JarFile jar = new JarFile(jarFile);
        final Enumeration<JarEntry> entries = jar.entries(); //gives ALL entries in jar
        while(entries.hasMoreElements()) {
            final String name = entries.nextElement().getName();
            if (name.startsWith(path + "/")) { //filter according to the path
                System.out.println(name);
            }
        }
        jar.close();
    } else { // Run with IDE
        final URL url = Launcher.class.getResource("/" + path);
        if (url != null) {
            try {
                final File apps = new File(url.toURI());
                for (File app : apps.listFiles()) {
                    System.out.println(app);
                }
            } catch (URISyntaxException e) {
                e.printStackTrace();
            }
        }
    }
}
 
开发者ID:linchaolong,项目名称:ApkToolPlus,代码行数:28,代码来源:JarUtils.java


示例6: initSystemClassLoader

import sun.misc.Launcher; //导入依赖的package包/类
private static synchronized void initSystemClassLoader() {
if (!sclSet) {
    if (scl != null)
	throw new IllegalStateException("recursive call");
           sun.misc.Launcher l = sun.misc.Launcher.getLauncher();
    if (l != null) {
	Throwable oops = null;
	scl = l.getClassLoader();
        try {
	    PrivilegedExceptionAction a;
	    a = new SystemClassLoaderAction(scl);
                   scl = (ClassLoader) AccessController.doPrivileged(a);
        } catch (PrivilegedActionException pae) {
	    oops = pae.getCause();
            if (oops instanceof InvocationTargetException) {
	        oops = oops.getCause();
	    }
        }
	if (oops != null) {
	    if (oops instanceof Error) {
		throw (Error) oops;
	    } else {
	        // wrap the exception
	        throw new Error(oops);
	    }
	}
    }
    sclSet = true;
}
   }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:aClassLoader.java


示例7: Launcher_clinit

import sun.misc.Launcher; //导入依赖的package包/类
@ALIAS(declaringClass = Launcher.class, name = "<clinit>")
private static native void Launcher_clinit();
 
开发者ID:beehive-lab,项目名称:Maxine-VM,代码行数:3,代码来源:JDK_java_lang_System.java


示例8: loadMainClass

import sun.misc.Launcher; //导入依赖的package包/类
private Class<?> loadMainClass() throws IOException, ClassNotFoundException {
    final ClassLoader appClassLoader = Launcher.getLauncher().getClassLoader();
    return appClassLoader.loadClass(mainClassName);
}
 
开发者ID:beehive-lab,项目名称:Maxine-VM,代码行数:5,代码来源:JavaRunScheme.java


示例9: shouldUseOpaqueButtons

import sun.misc.Launcher; //导入依赖的package包/类
static boolean shouldUseOpaqueButtons() {
    final ClassLoader launcherClassLoader = Launcher.getLauncher().getClassLoader();
    if (classExists(launcherClassLoader, "com.installshield.wizard.platform.macosx.MacOSXUtils")) return true;
    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:AquaUtils.java


示例10: getBootstrapClassPath

import sun.misc.Launcher; //导入依赖的package包/类
static URLClassPath getBootstrapClassPath() {
if (bootstrapClassPath == null) {
    bootstrapClassPath = sun.misc.Launcher.getBootstrapClassPath();
}
return bootstrapClassPath;
   }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:aClassLoader.java


示例11: getBootstrapsResources

import sun.misc.Launcher; //导入依赖的package包/类
/**
 * Implementation of parent {@link URLClassLoader} and {@link ClassLoader}
 * class method for filter parent ClassLoader and current
 * {@link ClassLoader}'s resources
 *
 * @return {@link Enumeration}
 */
static Enumeration<Resource> getBootstrapsResources(String name) {
    return Launcher.getBootstrapClassPath().getResources(name);
}
 
开发者ID:levants,项目名称:lightmare,代码行数:11,代码来源:EjbClassLoader.java



注:本文中的sun.misc.Launcher类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AbstractSpliterator类代码示例发布时间:2022-05-21
下一篇:
Java Neo4jConfiguration类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap