.getServices() .stream() .flatMap(c -> c.getActions().stream()) .map(actionDao::createOrUpdate) .collect(toList());
@Override public void onClose(final Container container) { // ensure we don't keep any data/ref after the classloader of the container is // released ofNullable(container.get(ContainerComponentRegistry.class)).ifPresent(r -> { final ContainerComponentRegistry registry = container.remove(ContainerComponentRegistry.class); registry.getComponents().clear(); registry .getServices() .stream() .filter(i -> !Proxy.isProxyClass(i.getInstance().getClass())) .forEach(s -> doInvoke(container.getId(), s.getInstance(), PreDestroy.class)); registry.getServices().clear(); }); ofNullable(container.get(AllServices.class)) .map(s -> s.getServices().get(Jsonb.class)) .map(Jsonb.class::cast) .ifPresent(jsonb -> { try { jsonb.close(); } catch (final Exception e) { log.warn(e.getMessage(), e); } }); }
internationalizationServiceFactory.create(proxy, container.getLoader())); services.put(proxy, instance); registry.getServices().add(new ServiceMeta(instance, emptyList())); }); finder HttpClientFactory.class.cast(services.get(HttpClientFactory.class)).create(proxy, null); services.put(proxy, instance); registry.getServices().add(new ServiceMeta(instance, emptyList())); }); final Map<Class<?>, Object> userServices = finder registry .getServices() .add(new ServiceMeta(instance, Stream .of(service.getMethods()) .filter(m -> Stream
private Collection<ActionReference> findActions(final String family, final Set<ActionReference> actions, final Container container, final Locale locale, final FamilyBundle familyBundle) { final ContainerComponentRegistry registry = container.get(ContainerComponentRegistry.class); return registry .getServices() .stream() .flatMap(s -> s.getActions().stream()) .filter(s -> s.getFamily().equals(family)) .filter(s -> actions .stream() .anyMatch(e -> s.getFamily().equals(e.getFamily()) && s.getType().equals(e.getType()) && s.getAction().equals(e.getName()))) .map(s -> new ActionReference(s.getFamily(), s.getAction(), s.getType(), familyBundle.actionDisplayName(s.getType(), s.getAction()).orElse(s.getAction()), propertiesService .buildProperties(s.getParameters(), container.getLoader(), locale, null) .collect(toList()))) .collect(toList()); }
.getServices() .stream() .map(s -> s.getActions().stream()) .flatMap(identity()) .filter(typeMatcher.and(componentMatcher))