Esempio n. 1
0
  @Override
  public final AddServiceFromContextPhase addServiceFromContext(
      final String ctxName,
      final Class<? extends Service> serviceType,
      final List<Class<? extends ServiceFilter>> filterTypes,
      final String path,
      final boolean bindPrefix) {
    final List<ServiceFilter> filters = new ArrayList<>();
    if (filterTypes != null) {
      for (final Class<? extends ServiceFilter> filterType : filterTypes) {
        final ServiceFilter filter = ctx.getBean(ctxName, filterType);
        filters.add(filter);
      }
    }
    final Service service = ctx.getBean(ctxName, serviceType);

    addService(service, path, bindPrefix, filters.toArray(new ServiceFilter[filters.size()]));
    return this;
  }
Esempio n. 2
0
 @Override
 public AddServiceFromContextPhase defineServiceFromContext(
     final String ctxName,
     final Class<? extends Service> serviceType,
     final String path,
     final boolean bindPrefix,
     final ContextBasedServiceBindingProvider provider) {
   final Service service = ctx.getBean(ctxName, serviceType);
   final ServiceBuilder builder = new ServiceBuilder(service, path, bindPrefix);
   provider.configureService(builder);
   builder.addService();
   return this;
 }