Package juzu.impl.plugin

Examples of juzu.impl.plugin.ServiceDescriptor


    super("validation");
  }

  @Override
  public ServiceDescriptor init(ServiceContext context) throws Exception {
    return new ServiceDescriptor(Tools.iterable(BeanDescriptor.createFromBean(ValidationFilter.class, Scope.SINGLETON, Collections.<Annotation>emptyList())));
  }
View Full Code Here


    BeanDescriptor registryDescriptor = BeanDescriptor.createFromProvider//<2>
        MetricRegistry.class,
        Scope.SINGLETON,
        Collections.<Annotation>emptyList(),
        registryProvider);
    return new ServiceDescriptor(Arrays.asList(registryDescriptor));        //<3>
  }
View Full Code Here

    super("ajax");
  }

  @Override
  public ServiceDescriptor init(ServiceContext context) throws Exception {
    return context.getConfig() != null ? new ServiceDescriptor() : null;
  }
View Full Code Here

        public ResourceResolver getApplicationResolver() {
          return applicationResolver;
        }
      };
      plugin.setApplication(descriptor);
      ServiceDescriptor pluginDescriptor = plugin.init(pluginContext);
      if (pluginDescriptor != null) {
        pluginDescriptors.put(plugin.getName(), pluginDescriptor);
      }
    }

    //
    for (Iterator<String> i = plugins.keySet().iterator();i.hasNext();) {
      String name = i.next();
      if (!pluginDescriptors.containsKey(name)) {
        i.remove();
      }
    }

    // Bind the plugins
    for (Service service : plugins.values()) {

      // Bind the plugin as a bean
      Class aClass = service.getClass();
      Object o = service;
      injector.bindBean(aClass, null, o);
    }

    // Bind the beans
    for (ServiceDescriptor pluginDescriptor : pluginDescriptors.values()) {
      for (BeanDescriptor bean : pluginDescriptor.getBeans()) {
        bean.bind(injector);
      }
    }

    // Bind the application descriptor
View Full Code Here

          return classPathResolver;
        }
      };

      //
      ServiceDescriptor desc = plugin.init(pluginContext);
      if (desc != null) {
        descriptors.put(plugin.getName(), desc);
      }
    }
View Full Code Here

        }

        //
        beans.add(descriptor);
      }
      return new ServiceDescriptor(beans);
    } else {
      return null;
    }
  }
View Full Code Here

    super("authz");
  }

  @Override
  public ServiceDescriptor init(ServiceContext context) throws Exception {
    return new ServiceDescriptor(Collections.singleton(BeanDescriptor.createFromBean(
        AuthzManager.class,
        Scope.SINGLETON,
        Collections.<Annotation>emptyList())
    ));
  }
View Full Code Here

TOP

Related Classes of juzu.impl.plugin.ServiceDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.