Package org.jboss.gravia.runtime

Examples of org.jboss.gravia.runtime.Runtime


    }

    @Override
    public void start(StartContext startContext) throws StartException {
        PropertiesProvider propsProvider = new DefaultPropertiesProvider(getRuntimeProperties(), true);
        Runtime runtime = RuntimeLocator.createRuntime(new WildFlyRuntimeFactory(), propsProvider);
        runtime.init();
    }
View Full Code Here


    }

    @Override
    public void start(final StartContext startContext) throws StartException {
        LOGGER.info("Activating Gravia Subsystem");
        Runtime runtime = injectedRuntime.getValue();
        installExtensionModule(startContext, runtime);
        installGraviaServices(startContext, runtime);
    }
View Full Code Here

    public void contextInitialized(ServletContextEvent event) {

        ServletContext servletContext = event.getServletContext();

        // HttpService integration
        Runtime runtime = RuntimeLocator.getRequiredRuntime();
        Module sysmodule = runtime.getModuleContext().getModule();
        BundleContext bundleContext = sysmodule.adapt(Bundle.class).getBundleContext();
        servletContext.setAttribute(BundleContext.class.getName(), bundleContext);
    }
View Full Code Here

        }

        // Install the module
        ModuleClassLoader classLoader = depUnit.getAttachment(Attachments.MODULE).getClassLoader();
        try {
            Runtime runtime = RuntimeLocator.getRuntime();
            Module module = runtime.installModule(classLoader, resource, headers);
            depUnit.putAttachment(GraviaConstants.MODULE_KEY, module);
        } catch (ModuleException ex) {
            throw new DeploymentUnitProcessingException(ex);
        }
    }
View Full Code Here

        }

        // Install the resource as module
        ModuleLoader moduleLoader = org.jboss.modules.Module.getBootModuleLoader();
        ModuleClassLoader classLoader = moduleLoader.loadModule(modid).getClassLoader();
        Runtime runtime = RuntimeLocator.getRequiredRuntime();
        final Module module = runtime.installModule(classLoader, resource, null);

        // Start the module
        module.start();

        Resource modres = module.adapt(Resource.class);
View Full Code Here

        } finally {
            NamedResourceAssociation.removeResource(runtimeName);
        }

        // 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;
        return new AbstractResourceHandle(modres, module) {
            @Override
View Full Code Here

        return buffer.toString();
    }

    private void addModuleDependencies(Resource resource, Map<Requirement, Resource> mapping, StringBuffer buffer) {
        buffer.append(" <dependencies>");
        Runtime runtime = RuntimeLocator.getRequiredRuntime();
        for (Requirement req : resource.getRequirements(IdentityNamespace.IDENTITY_NAMESPACE)) {
            Resource depres = mapping.get(req);
            if (depres != null) {
                ModuleIdentifier modid = null;
               
                // #1 Check the runtime for a deployed module
                ResourceIdentity resid = depres.getIdentity();
                Module module = runtime.getModule(resid);
                if (module != null) {
                    ModuleClassLoader modcl = (ModuleClassLoader) module.adapt(ClassLoader.class);
                    modid = modcl.getModule().getIdentifier();
                }
                // #2 Check the attached ModuleIdentifier
View Full Code Here

    }

    @Override
    @SuppressWarnings("deprecation")
    public void start(StartContext startContext) throws StartException {
        Runtime runtime = injectedRuntime.getValue();
        MatchPolicy matchPolicy = new DefaultMatchPolicy();
        File modulesDir = injectedServerEnvironment.getValue().getModulesDir();
        environment = new RuntimeEnvironment(runtime, new SystemResourceStore(modulesDir), matchPolicy);

        ModuleContext syscontext = runtime.getModuleContext();
        registration = syscontext.registerService(RuntimeEnvironment.class, environment, null);
    }
View Full Code Here

        // Setup the integration properties
        Properties props = WildFlySecurityManager.getSystemPropertiesPrivileged();
        PropertiesProvider propsProvider = new DefaultPropertiesProvider(props);

        Runtime runtime = RuntimeLocator.createRuntime(new EmbeddedRuntimeFactory(), propsProvider);
        runtime.init();
    }
View Full Code Here

                tempfile.delete();
            }
        }

        // Get the resource as module (may be null)
        Runtime runtime = RuntimeLocator.getRequiredRuntime();
        Module module = runtime.getModule(identity);

        Resource modres = module != null ? module.adapt(Resource.class) : resource;
        return new AbstractResourceHandle(modres, module) {
            @Override
            public void uninstall() {
View Full Code Here

TOP

Related Classes of org.jboss.gravia.runtime.Runtime

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.