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


Java ModuleInfo类代码示例

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


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

示例1: testMemoryConsumption

import org.openide.modules.ModuleInfo; //导入依赖的package包/类
public void testMemoryConsumption() throws Exception { // #90195
    assertSize("java.project is not too big", Arrays.asList(javaProjectProject.evaluator(), javaProjectProject.getHelper()), 2345678, new MemoryFilter() {
        final Class<?>[] REJECTED = {
            Project.class,
            FileObject.class,
            ClassLoader.class,
            Class.class,
            ModuleInfo.class,
            LogManager.class,
            RequestProcessor.class,
            ResourceBundle.class,
        };
        public @Override boolean reject(Object obj) {
            for (Class<?> c : REJECTED) {
                if (c.isInstance(obj)) {
                    return true;
                }
            }
            return false;
        }
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:NbModuleProjectTest.java

示例2: stopLoader

import org.openide.modules.ModuleInfo; //导入依赖的package包/类
@Override
protected void stopLoader(ModuleInfo m, ClassLoader loader) {
    NetigsoLoader nl = (NetigsoLoader)loader;
    Bundle b = nl.bundle;
    try {
        assert b != null;
        try {
            LOG.log(Level.FINE, "Stopping bundle {0}", m.getCodeNameBase());
            b.stop();
        } catch (BundleException possible) {
            if (isRealBundle(b)) {
                throw possible;
            }
            LOG.log(Level.FINE, "Not stopping fragment {0}", m.getCodeNameBase());
        }
    } catch (BundleException ex) {
        throw new IllegalStateException(ex);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:Netigso.java

示例3: getModulesResult

import org.openide.modules.ModuleInfo; //导入依赖的package包/类
private Lookup.Result<ModuleInfo> getModulesResult() {
    synchronized (this) {
        if (modulesResult == null) {
            Lookup lookup = getModuleLookup();
            modulesResult = lookup.
                lookup(new Lookup.Template<ModuleInfo>(ModuleInfo.class));
            modulesResult.addLookupListener(new LookupListener() {
                public void resultChanged(LookupEvent ev) {
                    Collection<? extends ModuleInfo> l = getModulesResult().allInstances();
                    XMLSettingsSupport.err.fine("Modules changed: " + l); // NOI18N
                    List reloaded;
                    synchronized (this) {
                        fillModules(l);
                        reloaded = replaceReloadedModules();
                        XMLSettingsSupport.err.fine("Reloaded modules: " + reloaded); // NOI18N
                    }
                    notifyReloads(reloaded);
                }
            });
        }
        return modulesResult;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:ModuleInfoManager.java

示例4: OpenProjectList

import org.openide.modules.ModuleInfo; //导入依赖的package包/类
OpenProjectList() {
    LOAD = new LoadOpenProjects(0);
    openProjects = new ArrayList<Project>();
    openProjectsModuleInfos = new HashMap<ModuleInfo, List<Project>>();
    infoListener = new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent evn) {
            if (ModuleInfo.PROP_ENABLED.equals(evn.getPropertyName())) {
                checkModuleInfo((ModuleInfo)evn.getSource());
            }
        }
    };
    pchSupport = new PropertyChangeSupport( this );
    recentProjects = new RecentProjectList(10); // #47134
    recentTemplates = new ArrayList<String>();
    projectGroupSupport = new ArrayList<ProjectGroupChangeListener>();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:OpenProjectList.java

示例5: addModuleInfo

import org.openide.modules.ModuleInfo; //导入依赖的package包/类
private void addModuleInfo(final Project prj) {
    final ModuleInfo info = Modules.getDefault().ownerOf(prj.getClass());
    if (info != null) {
        // is null in tests..
        MUTEX.writeAccess(new Mutex.Action<Void>() {
            public @Override Void run() {
            if (!openProjectsModuleInfos.containsKey(info)) {
                openProjectsModuleInfos.put(info, new ArrayList<Project>());
                info.addPropertyChangeListener(infoListener);
            }
            openProjectsModuleInfos.get(info).add(prj);
            return null;
        }
        });
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:OpenProjectList.java

示例6: setUp

import org.openide.modules.ModuleInfo; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
    super.setUp();

    Lookup.getDefault().lookup(ModuleInfo.class);

    // We need to set up netbeans.dirs so that the NBInst URLMapper correctly
    // finds the mysql jar file
    File jarFile = new File(JDBCDriverManager.class.getProtectionDomain().getCodeSource().getLocation().toURI());
    File clusterDir = jarFile.getParentFile().getParentFile();
    System.setProperty("netbeans.dirs", clusterDir.getAbsolutePath());

    getProperties();

    server = MySQLDatabaseServer.getDefault();
    server.setUser(getUser());
    server.setPassword(getPassword());
    server.setHost(getHost());
    server.setPort(getPort());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:MySQLDatabaseServerTest.java

示例7: testStoppingFalse

import org.openide.modules.ModuleInfo; //导入依赖的package包/类
public void testStoppingFalse() {
    final boolean[] ok = { false };
    
    onStartStop.initialize();
    onStartStop.waitOnStart();
    final Callable<Boolean> run = new Callable<Boolean>() {
        @Override public Boolean call() {
            ok[0] = true;
            return false;
        }
    };
    stop.add(run);
    List<ModuleInfo> modules = Collections.singletonList(Modules.getDefault().ownerOf(run.getClass()));
    assertFalse("Close rejected", onStartStop.closing(modules));
    
    assertTrue("Initialized", ok[0]);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:NbStartStopTest.java

示例8: testStop

import org.openide.modules.ModuleInfo; //导入依赖的package包/类
public void testStop() {
    final boolean[] ok = { false };
    
    onStartStop.initialize();
    onStartStop.waitOnStart();
    final Runnable run = new Runnable() {
        @Override public void run() {
            ok[0] = true;
        }
    };
    stop.add(run);
    List<ModuleInfo> modules = Collections.singletonList(Modules.getDefault().ownerOf(run.getClass()));
    for (Task t : onStartStop.startClose(modules)) {
        t.waitFinished();
    }
    
    assertTrue("Initialized", ok[0]);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:NbStartStopTest.java

示例9: setUp

import org.openide.modules.ModuleInfo; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
    UIHandler.flushImmediatelly();
    MetricsHandler.flushImmediatelly();
    System.setProperty("netbeans.user", getWorkDirPath());
    clearWorkDir();
    Locale.setDefault(new Locale("ts", "AU"));
    NbPreferences.root().node("org/netbeans/core").putBoolean("usageStatisticsEnabled", true);
    
    installer = Installer.findObject(Installer.class, true);
    assertNotNull(installer);
    //checkHandlers("After Installer find object", Logger.getLogger(Installer.UI_LOGGER_NAME));
    MockServices.setServices(A.class, D.class);
    //checkHandlers("After mock services set up", Logger.getLogger(Installer.UI_LOGGER_NAME));
    // Initialize the module system:
    Lookup.getDefault().lookupAll(ModuleInfo.class);
    //checkHandlers("After initialization of module system", Logger.getLogger(Installer.UI_LOGGER_NAME));
    MemoryURL.initialize();
    //checkHandlers("After all set up", Logger.getLogger(Installer.UI_LOGGER_NAME));
    installer.restored();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:AutoSubmitTest.java

示例10: setPreferredLoader

import org.openide.modules.ModuleInfo; //导入依赖的package包/类
/** Utility method to mark a file as belonging to a loader.
 * When the file is to be recognized this loader will be used first.
 *
 * @param fo file to mark
 * @param loader the loader to assign to the file or null if previous
 *    association should be cleared
 * @exception IOException if setting the file's attribute failed
 */
public static void setPreferredLoader (FileObject fo, DataLoader loader)
throws IOException {
    DataLoader prev = getPreferredLoader (fo);
    
    if (prev == loader) {
        return;
    }
    
    if (loader == null) {
        fo.setAttribute(DataObject.EA_ASSIGNED_LOADER, null);
    } else {
        Class c = loader.getClass();
        fo.setAttribute (DataObject.EA_ASSIGNED_LOADER, c.getName ());
        ModuleInfo module = Modules.getDefault().ownerOf(c);
        if (module != null) {
            fo.setAttribute(DataObject.EA_ASSIGNED_LOADER_MODULE, module.getCodeNameBase());
        }
    }
    Set<FileObject> one = new HashSet<FileObject>();
    one.add(fo);
    if (!DataObjectPool.getPOOL().revalidate(one).isEmpty()) {
        DataObject.LOG.log(Level.FINE, "It was not possible to invalidate data object: {0}", fo); // NOI18N
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:33,代码来源:DataLoaderPool.java

示例11: createInstanceDataObject

import org.openide.modules.ModuleInfo; //导入依赖的package包/类
/** see InstanceDataObject.create */
public static InstanceDataObject createInstanceDataObject (
DataFolder folder, String name, Object instance, ModuleInfo mi,
boolean create) throws IOException {
    synchronized (me) {
        me.mi = mi;
        me.folder = folder;
        me.instance = instance;
        me.name = name;
        me.create = create;

        DataObjectPool.getPOOL().runAtomicActionSimple (folder.getPrimaryFile(), me);
        me.mi = null;
        me.folder = null;
        me.instance = null;
        me.name = null;
        InstanceDataObject result = me.result;
        me.result = null;
        return result;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:InstanceDataObject.java

示例12: storeModule

import org.openide.modules.ModuleInfo; //导入依赖的package包/类
private static void storeModule(ModuleInfo mi, PrintWriter pw)
throws IOException {
    if (mi == null) return;
    
    String modulName = mi.getCodeName();
    SpecificationVersion spec = mi.getSpecificationVersion();
    StringBuffer sb = new StringBuffer (80);
    sb.append("    <module"); // NOI18N
    if (modulName != null && modulName.length() != 0) {
        sb.append(" name=\"").append(modulName).append('"');// NOI18N
    }
    if (spec != null) {
        sb.append(" spec=\"").append(spec.toString()).append('"');// NOI18N
    }
    sb.append("/>"); // NOI18N
    pw.println(sb.toString());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:XMLSettingsSupport.java

示例13: acceptTCRef

import org.openide.modules.ModuleInfo; //导入依赖的package包/类
/** Checks if module for given tcRef exists.
 * @return true if tcRef is valid - its module exists
 */
private boolean acceptTCRef (TCRefParser tcRefParser, TCRefConfig config) {
    InternalConfig cfg = tcRefParser.getInternalConfig();
    //Check module info
    if (cfg.moduleCodeNameBase != null) {
        ModuleInfo curModuleInfo = PersistenceManager.findModule
                                        (cfg.moduleCodeNameBase, cfg.moduleCodeNameRelease,
                                         cfg.moduleSpecificationVersion);
        if (curModuleInfo == null) {
            PersistenceManager.LOG.fine("Cannot find module \'" +
                      cfg.moduleCodeNameBase + " " + cfg.moduleCodeNameRelease + " " + 
                      cfg.moduleSpecificationVersion + "\' for tcref with id \'" + config.tc_id + "\'"); // NOI18N
            
        }
        return (curModuleInfo != null) && curModuleInfo.isEnabled();
    } else {
        //No module info
        return true;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:ModeParser.java

示例14: acceptMode

import org.openide.modules.ModuleInfo; //导入依赖的package包/类
/** Checks if module for given mode exists.
 * @return true if mode is valid - its module exists
 */
private boolean acceptMode (ModeParser modeParser, ModeConfig config) {
    InternalConfig cfg = modeParser.getInternalConfig();
    //Check module info
    if (cfg.moduleCodeNameBase != null) {
        ModuleInfo curModuleInfo = PersistenceManager.findModule
        (cfg.moduleCodeNameBase, cfg.moduleCodeNameRelease,
         cfg.moduleSpecificationVersion);
        if (curModuleInfo == null) {
            PersistenceManager.LOG.info("Cannot find module \'" +
                      cfg.moduleCodeNameBase + " " + cfg.moduleCodeNameRelease + " " + 
                      cfg.moduleSpecificationVersion + "\' for wsmode with name \'" + config.name + "\'"); // NOI18N
        }
        if ((curModuleInfo != null) && curModuleInfo.isEnabled()) {
            //Module is present and is enabled
            return true;
        } else {
            //Module is NOT present (it could be deleted offline)
            //or is NOT enabled
            return false;
        }
    } else {
        //No module info
        return true;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:WindowManagerParser.java

示例15: acceptGroup

import org.openide.modules.ModuleInfo; //导入依赖的package包/类
/** Checks if module for given group exists.
 * @return true if group is valid - its module exists
 */
private boolean acceptGroup (GroupParser groupParser, GroupConfig config) {
    InternalConfig cfg = groupParser.getInternalConfig();
    //Check module info
    if (cfg.moduleCodeNameBase != null) {
        ModuleInfo curModuleInfo = PersistenceManager.findModule
                                    (cfg.moduleCodeNameBase, cfg.moduleCodeNameRelease,
                                     cfg.moduleSpecificationVersion);
        if (curModuleInfo == null) {
            
            PersistenceManager.LOG.log(Level.FINE, "Cannot find module \'" +
                      cfg.moduleCodeNameBase + " " + cfg.moduleCodeNameRelease + " " + 
                      cfg.moduleSpecificationVersion + "\' for group with name \'" + config.name + "\'"); // NOI18N
            
        }
        if ((curModuleInfo != null) && curModuleInfo.isEnabled()) {
            //Module is present and is enabled
            return true;
        } else {
            return false;
        }
    } else {
        //No module info
        return true;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:WindowManagerParser.java


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