Package org.jboss.modules

Examples of org.jboss.modules.ModuleIdentifier


    }


    void installObjectFactory(final OperationContext context, final String name, final ModelNode model, ServiceVerificationHandler verificationHandler, final List<ServiceController<?>> newControllers) throws OperationFailedException {

        final ModuleIdentifier moduleID = ModuleIdentifier.fromString(NamingBindingResourceDefinition.MODULE.resolveModelAttribute(context, model).asString());
        final String className = NamingBindingResourceDefinition.CLASS.resolveModelAttribute(context, model).asString();
        final Module module;
        try {
            module = Module.getBootModuleLoader().loadModule(moduleID);
        } catch (ModuleLoadException e) {
View Full Code Here


    public void stop(HttpServer httpServer) {
        httpServer.removeContext(context);
    }

    protected static ClassLoader getClassLoader(final String module) throws ModuleLoadException {
        ModuleIdentifier id = ModuleIdentifier.fromString(module);
        ClassLoader cl = Module.getCallerModuleLoader().loadModule(id).getClassLoader();

        return cl;
    }
View Full Code Here

        }

        private Module createFrameworkModule(final Bundle systemBundle) {
            // Setup the extended framework module spec
            Module systemModule = injectedSystemModule.getValue();
            ModuleIdentifier systemIdentifier = systemModule.getIdentifier();
            ModuleLoader systemLoader = systemModule.getModuleLoader();
            ModuleSpec.Builder specBuilder = ModuleSpec.build(ModuleIdentifier.create(JBOSGI_PREFIX + ".framework"));
            PathFilter acceptAll = PathFilters.acceptAll();
            specBuilder.addDependency(DependencySpec.createModuleDependencySpec(acceptAll, acceptAll, systemLoader, systemIdentifier, false));

            // Add a dependency on the default framework module
            ModuleLoader bootLoader = Module.getBootModuleLoader();
            ModuleIdentifier frameworkIdentifier = ModuleIdentifier.create("org.jboss.osgi.framework");
            specBuilder.addDependency(DependencySpec.createModuleDependencySpec(acceptAll, acceptAll, bootLoader, frameworkIdentifier, false));

            // Add the user defined module dependencies
            String modulesProps = (String) subsystemState.getProperties().get(PROP_JBOSS_OSGI_SYSTEM_MODULES);
            if (modulesProps != null) {
                for (String moduleProp : modulesProps.split(",")) {
                    moduleProp = moduleProp.trim();
                    if (moduleProp.length() > 0) {
                        ModuleIdentifier moduleId = ModuleIdentifier.create(moduleProp);
                        DependencySpec moduleDep = DependencySpec.createModuleDependencySpec(acceptAll, acceptAll, bootLoader, moduleId, false);
                        specBuilder.addDependency(moduleDep);
                    }
                }
            }
View Full Code Here

            final ServiceTarget serviceTarget = context.getChildTarget();
            final File modulesDir = injectedEnvironment.getValue().getModulesDir();
            final File bundlesDir = new File(modulesDir.getPath() + "/../bundles").getCanonicalFile();
            for (OSGiModule moduleMetaData : subsystemState.getModules()) {
                ServiceName serviceName;
                ModuleIdentifier identifier = moduleMetaData.getIdentifier();
                File bundleFile = getRepositoryEntry(bundlesDir, identifier);
                if (bundleFile != null) {
                    URL url = bundleFile.toURI().toURL();
                    BundleInfo info = BundleInfo.createBundleInfo(url);
                    Deployment dep = DeploymentFactory.createDeployment(info);
View Full Code Here

        return entryFile;
    }

    private OSGiMetaData getModuleMetadata(Module module) throws IOException {
        final File modulesDir = injectedEnvironment.getValue().getModulesDir();
        final ModuleIdentifier identifier = module.getIdentifier();

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

    public Collection<Capability> findProviders(Requirement req) {
        String namespace = req.getNamespace();
        List<Capability> result = new ArrayList<Capability>();
        if (MODULE_IDENTITY_NAMESPACE.equals(namespace)) {
            String strval = (String) req.getAttributes().get(MODULE_IDENTITY_NAMESPACE);
            ModuleIdentifier moduleIdentifier = ModuleIdentifier.fromString(strval);
            try {
                File contentFile = getRepositoryEntry(bundlesDir, moduleIdentifier);
                if (contentFile != null) {
                    URL baseURL = bundlesDir.toURI().toURL();
                    String contentPath = contentFile.toURI().toURL().toExternalForm();
View Full Code Here

        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 hirarchy
            File bundleFile = ModuleIdentityArtifactProvider.getRepositoryEntry(bundlesDir, moduleId);
            if (bundleFile != null) {
                URL bundleURL = bundleFile.toURI().toURL();
View Full Code Here

            } 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

            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

            final HandlerConfiguration configuration;

            if (moduleName != null) {
                // Check if this is a log4j appender
                final ModuleLoader moduleLoader = ModuleLoader.forClass(HandlerOperations.class);
                final ModuleIdentifier id = ModuleIdentifier.create(moduleName);
                try {
                    final Class<?> actualClass = Class.forName(className, false, moduleLoader.loadModule(id).getClassLoader());
                    if (Appender.class.isAssignableFrom(actualClass)) {
                        // Check for construction parameters
                        if (constructionProperties == null) {
View Full Code Here

TOP

Related Classes of org.jboss.modules.ModuleIdentifier

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.