@Override public void checkForUpdate() { if (updateCheckService != null) { updateCheckService.checkForUpdate(this); } else { // Requirement to run check even is service isn't running Service service = ServiceFactory.newServiceFactory().newService("update.check"); if (service != null) { updateCheckService = (UpdateCheckService) service; updateCheckService.checkForUpdate(this); } } }
private static ServiceFactory newServiceFactory(ServiceLoader<ServiceFactorySpi> serviceFactories) { ConcurrentMap<String, ServiceFactorySpi> serviceFactoriesByType = new ConcurrentHashMap<>(); for (ServiceFactorySpi serviceFactory : serviceFactories) { Collection<String> serviceTypes = serviceFactory.getServiceTypes(); for (String serviceType : serviceTypes) { ServiceFactorySpi oldServiceFactory = serviceFactoriesByType.putIfAbsent(serviceType, serviceFactory); if (oldServiceFactory != null) { // TODO: ignore, log warning? throw new RuntimeException(format("Duplicate type service factory: %s", serviceType)); } } } return new ServiceFactory(serviceFactoriesByType); } }
public static ServiceFactory newServiceFactory() { return newServiceFactory(load(ServiceFactorySpi.class)); }
serviceInstance = serviceFactory.newService(serviceType); if (serviceInstance == null) { throw new IllegalArgumentException("Unrecognized service type: " + serviceType);
public static ServiceFactory newServiceFactory(ClassLoader loader) { return newServiceFactory(load(ServiceFactorySpi.class, loader)); }
ResourceAddressFactory resourceAddressFactory = resolveResourceAddressFactories(); TransportFactory transportFactory = TransportFactory.newTransportFactory((Map) configuration); ServiceFactory serviceFactory = ServiceFactory.newServiceFactory(); Collection<ServiceContext> services = resolveServices(servicesByURI, webDir, tempDir, serviceConfigs, securityContext,