Examples of Runtime


Examples of org.jboss.gravia.runtime.Runtime

    private Set<ServiceRegistration<?>> registrations = new HashSet<ServiceRegistration<?>>();

    @Override
    public void start(final BundleContext context) throws Exception {
        Runtime runtime = RuntimeLocator.getRequiredRuntime();
        RuntimeEnvironment environment = new RuntimeEnvironment(runtime).initDefaultContent();
        BundleResourceInstaller installer = new BundleResourceInstaller(context, environment);
        registrations.add(context.registerService(RuntimeEnvironment.class, environment, null));
        registrations.add(context.registerService(ResourceInstaller.class, installer, null));
    }
View Full Code Here

Examples of org.jboss.gravia.runtime.Runtime

            ThreadResourceAssociation.removeResource();
        }

        // Install the bundle as module if it has not already happened
        // A bundle that could not get resolved will not have an associated module
        Runtime runtime = RuntimeLocator.getRequiredRuntime();
        Module module = runtime.getModule(resid);
        BundleWiring wiring = bundle.adapt(BundleWiring.class);
        if (module == null && wiring != null) {
            try {
                ClassLoader classLoader = wiring.getClassLoader();
                module = runtime.installModule(classLoader, resource, null);
            } catch (ModuleException ex) {
                throw new ProvisionException(ex);
            }
        }
View Full Code Here

Examples of org.jboss.gravia.runtime.Runtime

            ThreadResourceAssociation.removeResource();
        }

        // Install the bundle as module if it has not already happened
        // A bundle that could not get resolved will not have an associated module
        Runtime runtime = RuntimeLocator.getRequiredRuntime();
        Module module = runtime.getModule(identity);
        BundleWiring wiring = bundle.adapt(BundleWiring.class);
        if (module == null && wiring != null) {
            try {
                ClassLoader classLoader = wiring.getClassLoader();
                module = runtime.installModule(classLoader, resource, null);
            } catch (ModuleException ex) {
                throw new ProvisionException(ex);
            }
        }
View Full Code Here

Examples of org.jboss.gravia.runtime.Runtime

        }

        // 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

Examples of org.jboss.gravia.runtime.Runtime

        } 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

Examples of org.jboss.gravia.runtime.Runtime

    @Override
    public void start(final StartContext startContext) throws StartException {
        LOGGER.info("Activating Gravia Subsystem");

        Runtime runtime = injectedRuntime.getValue();
        ModuleContext syscontext = runtime.getModuleContext();

        // Install and start this as a {@link Module}
        ModuleClassLoader classLoader = (ModuleClassLoader) getClass().getClassLoader();
        try {
            URL extensionURL = null;
            Enumeration<URL> resources = classLoader.getResources(JarFile.MANIFEST_NAME);
            while (resources.hasMoreElements()) {
                URL nextURL = resources.nextElement();
                if (nextURL.getPath().contains("wildfly-extension")) {
                    extensionURL = nextURL;
                    break;
                }
            }
            Manifest manifest = new Manifest(extensionURL.openStream());
            Dictionary<String, String> headers = new ManifestHeadersProvider(manifest).getHeaders();
            module = runtime.installModule(classLoader, headers);

            // Attach the {@link ModuleEntriesProvider} so
            ModuleEntriesProvider entriesProvider = new ClassLoaderEntriesProvider(module);
            Attachable attachable = AbstractModule.assertAbstractModule(module);
            attachable.putAttachment(AbstractModule.MODULE_ENTRIES_PROVIDER_KEY, entriesProvider);
View Full Code Here

Examples of org.jboss.gravia.runtime.Runtime

        return builder.install();
    }

    @Override
    public void start(StartContext startContext) throws StartException {
        Runtime runtime = injectedRuntime.getValue();
        syscontext = runtime.getModuleContext();
    }
View Full Code Here

Examples of org.jboss.gravia.runtime.Runtime

        context.putAttachment(WildFlyRuntime.DEPLOYMENT_ROOT_KEY, deploymentRoot);

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

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();

        // Initialize ConfigurationAdmin content
        Object configsDir = propsProvider.getProperty(Constants.PROPERTY_CONFIGURATIONS_DIR);
        ActivationSupport.initConfigurationAdmin(new File((String) configsDir));
    }
View Full Code Here

Examples of org.jboss.gravia.runtime.Runtime

        // META-INF/service discovery happens on every call to the factory
        // we need to delegate to the single instance
        synchronized (WildFlyURLStreamHandlerFactory.class) {
            if (tracker == null) {
                Runtime runtime = RuntimeLocator.getRequiredRuntime();
                tracker = new URLStreamHandlerTracker(runtime.getModuleContext());
                tracker.open();
            }
        }
    }
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.