Package com.sun.enterprise.module

Examples of com.sun.enterprise.module.Repository


        if (!f.exists()) {
            System.err.println(repoPath + " does not exist.");
            System.exit(-1);
        }
        OSGiFactoryImpl.initialize(null);
        Repository moduleRepository = new OSGiDirectoryBasedRepository("repo", f);
        moduleRepository.initialize();

        PackageAnalyser analyser = new PackageAnalyser(moduleRepository);
        Collection<Wire> wires = analyser.analyseWirings();
        Collection<String> exportedPkgs = analyser.findAllExportedPackageNames();
        analyser.generateBundleReport(bundleOut);
View Full Code Here


                    }
                }
                return files.toArray(new File[files.size()]);
            }
        };
        Repository moduleRepository = new DirectoryBasedRepository("repo", f);
        moduleRepository.initialize();
        List<ModuleDefinition> moduleDefs = new ArrayList<ModuleDefinition>();
        if (args.length > 1) {
            for (int i = 1; i < args.length; ++i) {
                File moduleFile = new File(args[i]);
                if (!moduleFile.isAbsolute()) {
                    moduleFile = new File(repoPath, args[i]);
                }
                ModuleDefinition moduleDef = new DefaultModuleDefinition(moduleFile);
                moduleDefs.add(moduleDef);
            }
        } else {
            moduleDefs = moduleRepository.findAll();
        }
        List<URI> badModules = new ArrayList<URI>();
        for (ModuleDefinition moduleDef : moduleDefs) {
            ModuleDependencyAnalyser analyser =
                    new ModuleDependencyAnalyser(moduleDef, moduleRepository);
            if (System.getProperty("ExcludedPatterns")!=null) {
                StringTokenizer st = new StringTokenizer(
                        System.getProperty("ExcludedPatterns"), ",", false);
                Set<String> patterns = new HashSet<String>();
                while (st.hasMoreTokens()) {
                    patterns.add(st.nextToken());
                }
                analyser.excludePatterns(patterns);
            }
            if (!analyser.analyse()) {
                URI badModule = moduleRepository.getLocation().relativize(moduleDef.getLocations()[0]);
                badModules.add(badModule);
                System.out.println("<Module name = " + badModule + ">");
                System.out.println(analyser.getResultAsString());
                System.out.println("</Module>");
            }
View Full Code Here

                }
                return files.toArray(new File[files.size()]);
            }
        };
        HK2Factory.initialize();
        Repository moduleRepository = new DirectoryBasedRepository("repo", f);
        moduleRepository.initialize();
        List<ModuleDefinition> moduleDefs = new ArrayList<ModuleDefinition>();
        if (args.length > 1) {
            for (int i = 1; i < args.length; ++i) {
                File moduleFile = new File(args[i]);
                if (!moduleFile.isAbsolute()) {
                    moduleFile = new File(repoPath, args[i]);
                }
                ModuleDefinition moduleDef = new DefaultModuleDefinition(moduleFile);
                moduleDefs.add(moduleDef);
            }
        } else {
            moduleDefs = moduleRepository.findAll();
        }
        List<URI> badModules = new ArrayList<URI>();
        for (ModuleDefinition moduleDef : moduleDefs) {
            ModuleDependencyAnalyser analyser =
                    new ModuleDependencyAnalyser(moduleDef, moduleRepository);
            if (System.getProperty("ExcludedPatterns")!=null) {
                StringTokenizer st = new StringTokenizer(
                        System.getProperty("ExcludedPatterns"), ",", false);
                Set<String> patterns = new HashSet<String>();
                while (st.hasMoreTokens()) {
                    patterns.add(st.nextToken());
                }
                analyser.excludePatterns(patterns);
            }
            if (!analyser.analyse()) {
                URI badModule = moduleRepository.getLocation().relativize(moduleDef.getLocations()[0]);
                badModules.add(badModule);
                System.out.println("<Module name = " + badModule + ">");
                System.out.println(analyser.getResultAsString());
                System.out.println("</Module>");
            }
View Full Code Here

        if (!f.exists()) {
            System.err.println(repoPath + " does not exist.");
            System.exit(-1);
        }
        OSGiFactoryImpl.initialize(null);
        Repository moduleRepository = new OSGiDirectoryBasedRepository("repo", f);
        moduleRepository.initialize();

        PackageAnalyser analyser = new PackageAnalyser(moduleRepository);
        Collection<Wire> wires = analyser.analyseWirings();
        Collection<PackageCapability> exportedPkgs = analyser.findAllExportedPackages();
        analyser.generateBundleReport(bundleOut);
View Full Code Here

                // I've never seen this happen!
                location = location.getAbsoluteFile();
            }
           
            try {
                Repository repo = new DirectoryBasedRepository(repoId, location);
                addRepo(repo, mr, weight);
            } catch (IOException e) {
                throw new BootException("Exception while adding " + repoId + " repository", e);

            }
View Full Code Here

     * longer
     * @param name name of the repository to remove
     */
    public synchronized void removeRepository(String name) {
        for (Integer weight : repositories.keySet()) {
            Repository repo = repositories.get(weight);
            if (repo.getName().equals(name)) {
                repositories.remove(weight);
                return;
            }
        }
    }
View Full Code Here

     * @param name name of the repository to return
     * @return the repository or null if not found
     */
    public synchronized Repository getRepository(String name) {
        for (Integer weight : repositories.keySet()) {
            Repository repo = repositories.get(weight);
            if (repo.getName().equals(name)) {
                return repo;
            }
        }
        return null;
    }
View Full Code Here

    protected Module loadFromRepository(String name, String version) {
        Set<Integer> keys = repositories.keySet();
        TreeSet<Integer> sortedKeys = new TreeSet<Integer>();
        sortedKeys.addAll(keys);
        for (Integer key : sortedKeys) {
            Repository repo = repositories.get(key);
            ModuleDefinition moduleDef = repo.find(name, version);
            if (moduleDef!=null) {
                return newModule(moduleDef);
            }
        }
        return null;
View Full Code Here

        // force repository extraction
        Set<Integer> keys = repos.keySet();
        TreeSet<Integer> sortedKeys = new TreeSet<Integer>();
        sortedKeys.addAll(keys);
        for (Integer key : sortedKeys) {
            Repository repo = repos.get(key);
            for (ModuleDefinition moduleDef : repo.findAll()) {
                if (modules.get(AbstractFactory.getInstance().createModuleId(moduleDef))==null) {
                    Module newModule = newModule(moduleDef);
                    if (newModule!=null) {
                        // When some module can't get installed,
                        // don't halt proceeding, instead continue
View Full Code Here

     * longer
     * @param name name of the repository to remove
     */
    public synchronized void removeRepository(String name) {
        for (Integer weight : repositories.keySet()) {
            Repository repo = repositories.get(weight);
            if (repo.getName().equals(name)) {
                repositories.remove(weight);
                return;
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.module.Repository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.