Package org.ocpsoft.common.pattern

Examples of org.ocpsoft.common.pattern.WeightedComparator


    * The visitor must be initialized with the handlers to call for specific annotations
    */
   public ClassVisitorImpl(List<AnnotationHandler<Annotation>> handlers, Object payload)
   {
      handlerList = new ArrayList<AnnotationHandler<Annotation>>(handlers);
      Collections.sort(handlerList, new WeightedComparator());
      this.payload = payload;

      if (log.isDebugEnabled())
      {
         log.debug("Initialized to use {} AnnotationHandlers..", handlers.size());
View Full Code Here


         synchronized (El.class)
         {
            if (_providers == null)
            {
               _providers = Iterators.asList(ServiceLoader.load(ExpressionLanguageProvider.class));
               Collections.sort(_providers, new WeightedComparator());

               if (_providers.isEmpty())
               {
                  log.warn("No instances of [{}] were configured. EL support is disabled.",
                           ExpressionLanguageProvider.class.getName());
View Full Code Here

   {
      if (servletRegistrationProviders == null)
      {
         servletRegistrationProviders = Iterators.asList(
                  ServiceLoader.loadTypesafe(ServletRegistrationProvider.class).iterator());
         Collections.sort(servletRegistrationProviders, new WeightedComparator());
      }
      return servletRegistrationProviders;
   }
View Full Code Here

   {
      List<DispatcherTypeProvider> providers = (List<DispatcherTypeProvider>)
               event.getRequest().getAttribute(PROVIDER_KEY);
      if (providers == null) {
         providers = Iterators.asList(ServiceLoader.loadTypesafe(DispatcherTypeProvider.class).iterator());
         Collections.sort(providers, new WeightedComparator());
         event.getRequest().setAttribute(PROVIDER_KEY, providers);
      }
      return providers;
   }
View Full Code Here

               providers = Iterators.asList(ServiceLoader.load(RequestParameterProvider.class));
         }

      dispatcherProviders = Iterators.asList(
               ServiceLoader.loadTypesafe(DispatcherTypeProvider.class).iterator());
      Collections.sort(dispatcherProviders, new WeightedComparator());

   }
View Full Code Here

      {
         operations = new ArrayList<DeferredOperation>();
         request.setAttribute(REQUEST_KEY, operations);
      }

      Collections.sort(operations, new WeightedComparator());

      return operations;
   }
View Full Code Here

   private List<DispatcherTypeProvider> getDispatcherTypeProviders()
   {
      if (dispatcherTypeProviders == null) {
         dispatcherTypeProviders = Iterators.asList(
                  ServiceLoader.loadTypesafe(DispatcherTypeProvider.class).iterator());
         Collections.sort(dispatcherTypeProviders, new WeightedComparator());
      }
      return dispatcherTypeProviders;
   }
View Full Code Here

   @SuppressWarnings("unchecked")
   public static <T> T lookup(Class<T> type)
   {
      if (instanceProviders == null) {
         instanceProviders = Iterators.asList(ServiceLoader.load(InstanceProvider.class));
         Collections.sort(instanceProviders, new WeightedComparator());
         ServiceLogger.logLoadedServices(log, InstanceProvider.class, instanceProviders);
      }

      T result = null;
      for (InstanceProvider p : instanceProviders) {
View Full Code Here

      providers = Iterators.asList(ServiceLoader.load(RewriteProvider.class));
      resultHandlers = Iterators.asList(ServiceLoader.load(RewriteResultHandler.class));
      inbound = Iterators.asList(ServiceLoader.load(InboundRewriteProducer.class));
      outbound = Iterators.asList(ServiceLoader.load(OutboundRewriteProducer.class));

      Collections.sort(listeners, new WeightedComparator());
      Collections.sort(wrappers, new WeightedComparator());
      Collections.sort(providers, new WeightedComparator());
      Collections.sort(resultHandlers, new WeightedComparator());
      Collections.sort(inbound, new WeightedComparator());
      Collections.sort(outbound, new WeightedComparator());

      ServiceLogger.logLoadedServices(log, RewriteLifecycleListener.class, listeners);
      ServiceLogger.logLoadedServices(log, RequestCycleWrapper.class, wrappers);
      ServiceLogger.logLoadedServices(log, RewriteProvider.class, providers);
      ServiceLogger.logLoadedServices(log, RewriteResultHandler.class, resultHandlers);
View Full Code Here

   private synchronized void lookupBeanManager()
   {
      if (!lookupPerformed) {
         final List<BeanManagerProvider> providers = loadServices();
         Collections.sort(providers, new WeightedComparator());
         for (BeanManagerProvider provider : providers) {
            beanManager = provider.getBeanManager();
            if (beanManager != null) {
               locatingProvider = provider;
               break;
View Full Code Here

TOP

Related Classes of org.ocpsoft.common.pattern.WeightedComparator

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.