Package org.jboss.modules

Examples of org.jboss.modules.ModuleIdentifier


    public void annotateClass(final Marshaller marshaller, final Class<?> clazz) throws IOException {
        final Module module = Module.forClass(clazz);
        if (module == null) {
            marshaller.writeObject(null);
        } else {
            final ModuleIdentifier identifier = module.getIdentifier();
            marshaller.writeObject(identifier.getName());
            marshaller.writeObject(identifier.getSlot());
        }
    }
View Full Code Here


    public void annotateProxyClass(final Marshaller marshaller, final Class<?> proxyClass) throws IOException {
        final Module module = Module.forClass(proxyClass);
        if (module == null) {
            marshaller.writeObject(null);
        } else {
            final ModuleIdentifier identifier = module.getIdentifier();
            marshaller.writeObject(identifier.getName());
            marshaller.writeObject(identifier.getSlot());
        }
    }
View Full Code Here

        final String name = (String) unmarshaller.readObject();
        if (name == null) {
            return Class.forName(className, false, Module.class.getClassLoader());
        }
        final String slot = (String) unmarshaller.readObject();
        final ModuleIdentifier identifier = ModuleIdentifier.create(name, slot);
        try {
            return Class.forName(className, false, moduleLoader.loadModule(identifier).getClassLoader());
        } catch (ModuleLoadException e) {
            final InvalidClassException ce = new InvalidClassException(className, "Module load failed");
            ce.initCause(e);
View Full Code Here

        final ClassLoader classLoader;
        if (name == null) {
            classLoader = Module.class.getClassLoader();
        } else {
            final String slot = (String) unmarshaller.readObject();
            final ModuleIdentifier identifier = ModuleIdentifier.create(name, slot);
            final Module module;
            try {
                module = moduleLoader.loadModule(identifier);
            } catch (ModuleLoadException e) {
                final InvalidClassException ce = new InvalidClassException("Module load failed");
View Full Code Here

            deploymentUnit.putAttachment(JaxrsAttachments.ADDITIONAL_RESTEASY_DEPLOYMENT_DATA, deploymentData);
        } else {
            deploymentData = parent.getAttachment(JaxrsAttachments.ADDITIONAL_RESTEASY_DEPLOYMENT_DATA);
        }

        final ModuleIdentifier moduleIdentifier = deploymentUnit.getAttachment(Attachments.MODULE_IDENTIFIER);

        ResteasyDeploymentData resteasyDeploymentData = new ResteasyDeploymentData();
        final WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY);
        final Module module = deploymentUnit.getAttachment(Attachments.MODULE);
        final ServiceController<ModuleIndexService> serviceController = (ServiceController<ModuleIndexService>) phaseContext.getServiceRegistry().getRequiredService(Services.JBOSS_MODULE_INDEX_SERVICE);
View Full Code Here

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

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

        return cl;
    }
View Full Code Here

        ResourceIdentity resid = resource.getIdentity();
        String symbolicName = resid.getSymbolicName();
        Version version = resid.getVersion();

        ModuleIdentifier modid = ModuleIdentifier.create(symbolicName, version.toString());

        final File modulesDir = injectedServerEnvironment.getValue().getModulesDir();
        final File moduleDir = new File(modulesDir, symbolicName.replace(".", File.separator) + File.separator + version);

        if (moduleDir.exists()) {
View Full Code Here

        // Install the resource as module if it has not happend already
        Runtime runtime = RuntimeLocator.getRequiredRuntime();
        Module module = runtime.getModule(resource.getIdentity());
        if (module == null) {
            ModuleLoader moduleLoader = injectedServiceModuleLoader.getValue();
            ModuleIdentifier modid = ModuleIdentifier.create(ServiceModuleLoader.MODULE_PREFIX + runtimeName);
            ClassLoader classLoader = moduleLoader.loadModule(modid).getClassLoader();
            module = runtime.installModule(classLoader, resource, null);
        }

        Resource modres = module != null ? module.adapt(Resource.class) : resource;
View Full Code Here

        @Override
        public Resource getResource(ResourceIdentity identity) {
            String symbolicName = identity.getSymbolicName();
            Version version = identity.getVersion();
            String modname = symbolicName + (version != Version.emptyVersion ? ":" + version : "");
            ModuleIdentifier modid = ModuleIdentifier.fromString(modname);
            try {
                ModuleLoader moduleLoader = Module.getBootModuleLoader();
                moduleLoader.loadModule(modid);
            } catch (ModuleLoadException ex) {
                return null;
View Full Code Here

                    }
                    if (!versionRange.includes(version)) {
                        continue;
                    }
                    String modname = symbolicName + ":" + version;
                    ModuleIdentifier modid = ModuleIdentifier.fromString(modname);
                    try {
                        ModuleLoader moduleLoader = Module.getBootModuleLoader();
                        moduleLoader.loadModule(modid);
                    } catch (ModuleLoadException ex) {
                        continue;
                    }
                    DefaultResourceBuilder builder = new DefaultResourceBuilder();
                    Capability icap = builder.addIdentityCapability(symbolicName, version);
                    icap.getAttributes().put(IdentityNamespace.CAPABILITY_TYPE_ATTRIBUTE, IdentityNamespace.TYPE_ABSTRACT);
                    result.add(builder.getResource().getIdentityCapability());
                }
            }

            // Add the main module
            if (result.isEmpty()) {
                ModuleIdentifier modid = ModuleIdentifier.fromString(symbolicName);
                try {
                    ModuleLoader moduleLoader = Module.getBootModuleLoader();
                    moduleLoader.loadModule(modid);

                    DefaultResourceBuilder builder = new DefaultResourceBuilder();
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.