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