Examples of ModuleIdentifier


Examples of org.jboss.modules.ModuleIdentifier

    @Override
    public synchronized void start(final StartContext context) throws StartException {
        final Handler handler;
        final ModuleLoader moduleLoader = Module.forClass(CustomHandlerService.class).getModuleLoader();
        final ModuleIdentifier id = ModuleIdentifier.create(moduleName);
        try {
            final Class<?> handlerClass = Class.forName(className, false, moduleLoader.loadModule(id).getClassLoader());
            if (Handler.class.isAssignableFrom(handlerClass)) {
                handler = (Handler) handlerClass.newInstance();
            } else {
View Full Code Here

Examples of org.jboss.modules.ModuleIdentifier

        capabilities.add(module);
        notifyObservers(new ChangeEvent(ChangeType.CAPABILITY, false, module.getIdentifier().toString()));
    }

    public OSGiCapability removeCapability(String id) {
        ModuleIdentifier identifier = ModuleIdentifier.fromString(id);
        synchronized (capabilities) {
            for (Iterator<OSGiCapability> it = capabilities.iterator(); it.hasNext(); ) {
                OSGiCapability module = it.next();
                if (module.getIdentifier().equals(identifier)) {
                    it.remove();
                    notifyObservers(new ChangeEvent(ChangeType.CAPABILITY, true, identifier.toString()));
                    return module;
                }
            }
            return null;
        }
View Full Code Here

Examples of org.jboss.modules.ModuleIdentifier

    static ModuleClassLoader getModuleClassLoader(final String moduleSpec) throws ModuleLoadException {
        try {
            return AccessController.doPrivileged(new PrivilegedExceptionAction<ModuleClassLoader>() {
                public ModuleClassLoader run() throws ModuleLoadException {
                    ModuleLoader loader = Module.getCallerModuleLoader();
                    ModuleIdentifier identifier = ModuleIdentifier.fromString(moduleSpec);
                    return loader.loadModule(identifier).getClassLoader();
                }
            });
        } catch (PrivilegedActionException pae) {
            throw new ModuleLoadException(pae);
View Full Code Here

Examples of org.jboss.modules.ModuleIdentifier

    static ModuleClassLoader getModuleClassLoader(final ModuleLoader loader, final String moduleSpec) throws ModuleLoadException {
        if (System.getSecurityManager() != null) {
            try {
                return AccessController.doPrivileged(new PrivilegedExceptionAction<ModuleClassLoader>() {
                    public ModuleClassLoader run() throws ModuleLoadException {
                        ModuleIdentifier identifier = ModuleIdentifier.fromString(moduleSpec);
                        return loader.loadModule(identifier).getClassLoader();
                    }
                });
            } catch (PrivilegedActionException pae) {
                throw SecurityMessages.MESSAGES.moduleLoadException(pae);
            }
        } else {
            ModuleIdentifier identifier = ModuleIdentifier.fromString(moduleSpec);
            return loader.loadModule(identifier).getClassLoader();
        }
    }
View Full Code Here

Examples of org.jboss.modules.ModuleIdentifier

        assertPreconditionForUpdateTest();

        TestHandler testHandler = new TestHandler();
        try {
            AutoInstallIntegration aii = new AutoInstallIntegration();
            ModuleIdentifier id = ModuleIdentifier.fromString("testing");
            SubsystemState.ChangeEvent event = new SubsystemState.ChangeEvent(SubsystemState.ChangeType.CAPABILITY, true, id.toString());
            aii.update(null, event);
            Assert.assertEquals("There should not be any error logs", 0, testHandler.records.size());
        } finally {
            testHandler.remove();
        }
View Full Code Here

Examples of org.jboss.modules.ModuleIdentifier

    public void assertPreconditionForUpdateTest() {
        TestHandler testHandler = new TestHandler();

        try {
            AutoInstallIntegration aii = new AutoInstallIntegration();
            ModuleIdentifier id = ModuleIdentifier.fromString("testing");
            SubsystemState.ChangeEvent event = new SubsystemState.ChangeEvent(SubsystemState.ChangeType.CAPABILITY, false, id.toString());
            Assert.assertEquals("Precondition", 0, testHandler.records.size());

            aii.update(null, event);
            Assert.assertEquals("There should be an error log, because the update was called with insufficient services available",
                1, testHandler.records.size());
View Full Code Here

Examples of org.jboss.modules.ModuleIdentifier

    static ModuleClassLoader getModuleClassLoader(final String moduleSpec) throws ModuleLoadException {
        try {
            return AccessController.doPrivileged(new PrivilegedExceptionAction<ModuleClassLoader>() {
                public ModuleClassLoader run() throws ModuleLoadException {
                    ModuleLoader loader = Module.getCallerModuleLoader();
                    ModuleIdentifier identifier = ModuleIdentifier.fromString(moduleSpec);
                    return loader.loadModule(identifier).getClassLoader();
                }
            });
        } catch (PrivilegedActionException pae) {
            throw new ModuleLoadException(pae);
View Full Code Here

Examples of org.jboss.modules.ModuleIdentifier

        String identifier = moduleMetaData.getIdentifier();
        Integer startLevel = moduleMetaData.getStartLevel();

        // Try the identifier as ModuleIdentifier
        if (isValidModuleIdentifier(identifier)) {
            ModuleIdentifier moduleId = ModuleIdentifier.fromString(identifier);

            // Attempt to install the bundle from the bundles hierarchy
            File bundleFile = ModuleIdentityArtifactProvider.getRepositoryEntry(bundlesDir, moduleId);
            if (bundleFile != null) {
                URL bundleURL = bundleFile.toURI().toURL();
View Full Code Here

Examples of org.jboss.modules.ModuleIdentifier

            } finally {
                input.close();
            }
        }
        final File modulesDir = injectedEnvironment.getValue().getModulesDir();
        final ModuleIdentifier identifier = module.getIdentifier();

        String identifierPath = identifier.getName().replace('.', File.separatorChar) + File.separator + identifier.getSlot();
        File entryFile = new File(modulesDir + File.separator + identifierPath + File.separator + "jbosgi-xservice.properties");
        if (entryFile.exists() == false) {
            ROOT_LOGGER.debugf("Cannot obtain OSGi metadata file: %s", entryFile);
            return null;
        }
View Full Code Here

Examples of org.jboss.modules.ModuleIdentifier

            ModuleLoader bootLoader = Module.getBootModuleLoader();
            PathFilter acceptAll = PathFilters.acceptAll();
            for (String modid : sysmodules.split(",")) {
                modid = modid.trim();
                if (modid.length() > 0) {
                    ModuleIdentifier identifier = ModuleIdentifier.create(modid);
                    specBuilder.addDependency(DependencySpec.createModuleDependencySpec(acceptAll, acceptAll, bootLoader, identifier, false));
                }
            }

            specBuilder.setModuleClassLoaderFactory(new BundleReferenceClassLoader.Factory(systemBundle));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.