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


Java ModuleInstall类代码示例

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


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

示例1: closing

import org.openide.modules.ModuleInstall; //导入依赖的package包/类
public boolean closing(List<Module> modules) {
    Util.err.fine("closing: " + modules);
    for (Module m: modules) {
        Class<? extends ModuleInstall> instClazz = installs.get(m);
        if (instClazz != null) {
            try {
                ModuleInstall inst = SharedClassObject.findObject(instClazz, true);
                if (! inst.closing()) {
                    Util.err.fine("Module " + m + " refused to close");
                    return false;
                }
            } catch (RuntimeException re) {
                Util.err.log(Level.SEVERE, null, re);
                // continue, assume it is trash
            } catch (LinkageError le) {
                Util.err.log(Level.SEVERE, null, le);
            }
        }
    }
    return onStartStop.closing(modules);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:NbInstaller.java

示例2: installerFor

import org.openide.modules.ModuleInstall; //导入依赖的package包/类
private static ModuleInstall installerFor(Bundle b) {
    if (b.getSymbolicName().equals("org.netbeans.modules.autoupdate.ui")) { // NOI18N
        // Won't work anyway, so don't even try.
        return null;
    }
    String respath = (String) b.getHeaders().get("OpenIDE-Module-Install");
    if (respath != null) {
        String fqn = respath.replaceFirst("[.]class$", "").replace('/', '.');
        try {
            return SharedClassObject.findObject(((Class<?>) b.loadClass(fqn)).asSubclass(ModuleInstall.class), true);
        } catch (Exception x) { // CNFE, CCE, ...
            LOG.log(Level.WARNING, "Could not load " + fqn, x);
            return null;
        }
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:Activator.java

示例3: loadCode

import org.openide.modules.ModuleInstall; //导入依赖的package包/类
/** Load/unload installer code for a module. */
@SuppressWarnings("deprecation") // old ModuleInstall methods we have to call
private void loadCode(Module m, boolean load) throws Exception {
    Class<? extends ModuleInstall> instClazz = installs.get(m);
    if (instClazz != null) {
        ModuleInstall inst = SharedClassObject.findObject(instClazz, true);
        if (load) {
            ev.log(Events.RESTORE, m);
            inst.restored();
        } else {
            ev.log(Events.UNINSTALL, m);
            inst.uninstalled();
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:NbInstaller.java

示例4: closeAsync

import org.openide.modules.ModuleInstall; //导入依赖的package包/类
@Override
public Task closeAsync(List<Module> modules) {
    Util.err.fine("close: " + modules);
    ev.log(Events.CLOSE);
    moduleList.shutDown();
    List<Task> waitFor = onStartStop.startClose(modules);
    // [PENDING] this may need to write out changed ModuleInstall externalized
    // forms...is that really necessary to do here, or isn't it enough to
    // do right after loading etc.? Currently these are only written when
    // a ModuleInstall has just been restored etc. which is probably fine.
    for (Module m : modules) {
        Class<? extends ModuleInstall> instClazz = installs.get(m);
        if (instClazz != null) {
            try {
                ModuleInstall inst = SharedClassObject.findObject(instClazz, true);
                if (inst == null) throw new IllegalStateException("Inconsistent state: " + instClazz); // NOI18N
                inst.close();
            } catch (ThreadDeath td) {
                throw td;
            } catch (Throwable t) {
                // Catch even the heavy stuff here, we are going away.
                Util.err.log(Level.SEVERE, null, t);
                // oh well
            }
        }
    }
    waitFor.add(WarmUpSupport.waitTask());
    return new ProxyTask(waitFor);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:NbInstaller.java


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