Package com.sun.enterprise.module

Examples of com.sun.enterprise.module.ModuleDefinition


    }

    @Override
    public Module makeModuleFor(String name, String version, boolean resolve) throws ResolveError {
        for (int i=0;i<moduleDefs.size();i++) {
            ModuleDefinition md = moduleDefs.get(i);
            if (md.getName().equals(name)) {
                return modules.get(i);
            }
        }
        return null;
    }
View Full Code Here


        try {
            File[] files = repository.listFiles();
            for (File aFile : files) {
                if (aFile.getName().endsWith(".jar") && !isDisabled(aFile)) {
                    ModuleDefinition moduleDef = loadJar(aFile);
                    if (moduleDef!=null) {
                        moduleDefs.put(AbstractFactory.getInstance().createModuleId(moduleDef), moduleDef);
                    } else {
                        libraries.add(aFile.toURI());
                    }
View Full Code Here

        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

    public void changed(Module service) {
       
        System.out.println("I have received changed event from " + service);       
        // house keeping...
        remove(service);
        ModuleDefinition info = service.getModuleDefinition();
       
        Module newService = newModule(info);
       
        // store it
        add(newService);
View Full Code Here

        }
       
        private void initialize() {
            ClassLoader nullClassLoader = new NullClassLoader();
            for (Module module : modulesRegistry.getModules()) {
                ModuleDefinition moduleDef = module.getModuleDefinition();
                // FIXME: We may optimize this by creating a manifest entry in the
                // jar file(s) to indicate that the jar contains logger infos. Jar files
                // need not be opened if they don't contain logger infos.
                URI uris[] = moduleDef.getLocations();
                int size = (uris != null ? uris.length : 0);
                if (size == 0) {
                    continue;
                }
                URL urls[] = new URL[size];
View Full Code Here

    private void addProvider(Module module) {
        if (logger.isLoggable(Level.FINE))
            logger.fine(" Adding the Provider - verified the module");
        ClassLoader mcl = module.getClassLoader();
        //get manifest entries and process
        ModuleDefinition md = module.getModuleDefinition();
        Manifest mf = null;
        if (md != null) {
            mf = md.getManifest();
        }
        if (mf != null) {
            processManifest(mf, mcl);
        }
        handleFutureStatsProviders();
View Full Code Here

    // Factory method
    private OSGiModuleDefinition makeModuleDef(Bundle bundle)
            throws IOException, URISyntaxException {
        URI key = OSGiModuleDefinition.toURI(bundle);

        ModuleDefinition md = cache.get(key);

        if (md != null) {
          return OSGiModuleDefinition.class.cast(md);
        } else {
            cache.invalidate();
View Full Code Here

        }
        return bufsize;
    }

    public synchronized ModuleDefinition get(URI uri) {
        ModuleDefinition md = cachedData.get(uri);

        return md;
    }
View Full Code Here

     * @throws IOException
     */
    @Override
    protected ModuleDefinition loadJar(File jar) throws IOException {
        assert (jar.isFile()); // no support for exploded jar
        ModuleDefinition md = cache.get(jar.toURI());
        if (md != null) {
            if(logger.isLoggable(Level.FINE)) {
                logger.logp(Level.FINER, "OSGiDirectoryBasedRepository", "loadJar", "Found in mdCache for {0}", new Object[]{jar});
            }
            return md;
View Full Code Here

        return getBundle() == null;
    }

    private synchronized void init() {
        if (isUninitialized()) {
            final ModuleDefinition moduleDefinition = getModuleDefinition();
            Bundle bundle = getRegistry().getObrHandler().deploy(moduleDefinition.getName(), moduleDefinition.getVersion());
            if (bundle != null) {
                setBundle(bundle);
            } else {
                throw new RuntimeException("Unable to install module [ "
                        + this
View Full Code Here

TOP

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

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.