@Override public boolean test(final ServiceMeta.ActionMeta actionMeta) { return accepted.isEmpty() || accepted.contains(actionMeta.getFamily()); } };
@Override public boolean test(final ServiceMeta.ActionMeta actionMeta) { return accepted.isEmpty() || accepted.contains(actionMeta.getType()); } };
return new ServiceMeta.ActionMeta(component, actionType.value(), name, serviceMethod.getGenericParameterTypes(), parameterModelService
final Map<String, String> runtimeParams = ofNullable(params).map(HashMap::new).orElseGet(HashMap::new); runtimeParams.put("$lang", localeMapper.mapLocale(lang).getLanguage()); final Object result = actionMeta.getInvoker().apply(runtimeParams); return Response.ok(result).type(APPLICATION_JSON_TYPE).build(); } catch (final RuntimeException re) {
.flatMap(identity()) .filter(typeMatcher.and(componentMatcher)) .map(s -> new ActionItem(s.getFamily(), s.getType(), s.getAction(), propertiesService .buildProperties(s.getParameters(), c.getLoader(), locale, null) .collect(toList())))) .collect(toList()));
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()); }