Search in sources :

Example 1 with IServiceIdDecoratorPlugin

use of org.jowidgets.cap.service.api.plugin.IServiceIdDecoratorPlugin in project jo-client-platform by jo-source.

the class BeanServicesProviderBuilderHelper method decorateServiceId.

private static <SERVICE_TYPE> IServiceId<SERVICE_TYPE> decorateServiceId(final IServiceId<SERVICE_TYPE> defaultId, final IServiceId<IEntityService> entityServiceId, final Class<? extends IBean> beanType, final Object entityId, final Class<SERVICE_TYPE> serviceType) {
    IServiceId<SERVICE_TYPE> result = defaultId;
    final IPluginPropertiesBuilder propertiesBuilder = PluginProperties.builder();
    propertiesBuilder.add(IServiceIdDecoratorPlugin.BEAN_TYPE_PROPERTY_KEY, beanType);
    propertiesBuilder.add(IServiceIdDecoratorPlugin.ENTITIY_ID_PROPERTY_KEY, entityId);
    for (final IServiceIdDecoratorPlugin plugin : PluginProvider.getPlugins(IServiceIdDecoratorPlugin.ID, propertiesBuilder.build())) {
        result = plugin.decorateServiceId(result, entityServiceId, beanType, entityId, serviceType);
    }
    return result;
}
Also used : IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder) IServiceIdDecoratorPlugin(org.jowidgets.cap.service.api.plugin.IServiceIdDecoratorPlugin)

Aggregations

IServiceIdDecoratorPlugin (org.jowidgets.cap.service.api.plugin.IServiceIdDecoratorPlugin)1 IPluginPropertiesBuilder (org.jowidgets.plugin.api.IPluginPropertiesBuilder)1