Package org.jboss.gravia.runtime.spi

Examples of org.jboss.gravia.runtime.spi.PropertiesProvider


        return builder.install();
    }

    @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


        return builder.install();
    }

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

    @Override
    public void start(StartContext startContext) throws StartException {

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

    }

    public void start() throws Exception {

        // Create Runtime
        PropertiesProvider propsProvider = new DefaultPropertiesProvider();
        runtime = RuntimeLocator.createRuntime(new EmbeddedRuntimeFactory(), propsProvider);
        runtime.init();

        // Install/Start the Agent as a Module
        Module module = installAgentModule();
View Full Code Here

    public <T> Map<String, ?> configure(final Map<String, ?> configuration, T target, String... ignorePrefix) throws Exception {
        assertValid();
        Map<String, Object> result = new HashMap<>();
        final Runtime runtime = this.runtime.get();

        final PropertiesProvider runtimeProperties = new PropertiesProvider() {
            @Override
            public Object getProperty(String key) {
                return runtime.getProperty(key);
            }

            @Override
            public Object getRequiredProperty(String key) {
                return runtime.getRequiredProperty(key);
            }

            @Override
            public Object getProperty(String key, Object defaultValue) {
                return runtime.getProperty(key, defaultValue);
            }
        };

        final PropertiesProvider configurationProvider = new MapPropertiesProvider((Map<String, Object>) configuration);
        final PropertiesProvider[] propertiesProviders = new PropertiesProvider[]{configurationProvider, runtimeProperties};

        PropertiesProvider provider = new SubstitutionPropertiesProvider(propertiesProviders);

        for (Map.Entry<String, ?> entry : configuration.entrySet()) {
            String key = entry.getKey();
            Object value = provider.getProperty(key);
            result.put(key, value);
        }
        ConfigInjection.applyConfiguration(result, target, ignorePrefix);
        return result;
    }
View Full Code Here

    @Override
    public void contextInitialized(ServletContextEvent event) {

        // Create the runtime
        ServletContext servletContext = event.getServletContext();
        PropertiesProvider propsProvider = new FabricPropertiesProvider(servletContext);
        Runtime runtime = RuntimeLocator.createRuntime(new TomcatRuntimeFactory(servletContext), propsProvider);
        runtime.init();

        // Start listening on the {@link BootstrapComplete}
        final ModuleContext syscontext = runtime.getModuleContext();
View Full Code Here

    @Override
    public void contextInitialized(ServletContextEvent event) {

        // Create the runtime
        ServletContext servletContext = event.getServletContext();
        PropertiesProvider propsProvider = new TomcatPropertiesProvider(servletContext);
        Runtime runtime = RuntimeLocator.createRuntime(new TomcatRuntimeFactory(servletContext), propsProvider);
        runtime.init();

        // HttpService integration
        ModuleContext moduleContext = runtime.getModuleContext();
View Full Code Here

        resolverRegistration = syscontext.registerService(Resolver.class, resolver, null);
        return resolver;
    }

    private Repository registerRepositoryService(final Runtime runtime) {
        PropertiesProvider propertyProvider = new RuntimePropertiesProvider(runtime);
        Repository repository = new DefaultRepository(propertyProvider);
        ModuleContext syscontext = runtime.getModuleContext();
        repositoryRegistration =  RepositoryRuntimeRegistration.registerRepository(syscontext, repository);
        return repository;
    }
View Full Code Here

TOP

Related Classes of org.jboss.gravia.runtime.spi.PropertiesProvider

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.