Package org.jboss.weld.bootstrap.api

Examples of org.jboss.weld.bootstrap.api.Service


     * @param registry the given service registry
     */
    void loadAdditionalServices(ServiceRegistry registry) {
        for (ResourceLoader loader : getResourceLoaders()) {
            for (Metadata<Service> metadata : ServiceLoader.load(Service.class, loader)) {
                Service service = metadata.getValue();
                for (Class<? extends Service> serviceInterface : identifyServiceInterfaces(service.getClass(), new HashSet<>())) {
                    put(registry, serviceInterface, service);
                }
            }
        }
    }
View Full Code Here


        identifyServiceInterfaces(clazz.getSuperclass(), serviceInterfaces);
        return serviceInterfaces;
    }

    private <T extends Service> void put(ServiceRegistry registry, Class<T> key, Service value) {
        Service previous = registry.get(key);
        if (previous == null) {
            BootstrapLogger.LOG.debugv("Installing additional service {0} ({1})", key.getName(), value.getClass());
            registry.add(key, Reflections.cast(value));
        } else if (shouldOverride(key, previous, value)) {
            BootstrapLogger.LOG.debugv("Overriding service implementation for {0}. Previous implementation {1} is replaced with {2}", key.getName(), previous
                    .getClass().getName(), value.getClass().getName());
            registry.add(key, Reflections.cast(value));
        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.weld.bootstrap.api.Service

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.