Package org.eclipse.sisu.inject

Examples of org.eclipse.sisu.inject.DefaultRankingFunction


     * when calculating the maximum potential rank contained in a given Injector - this heuristic is used
     * to decide the optimal time to merge in new results when iterating over a dynamic collection.
     */
    bind(RankingFunction.class).toInstance(new RankingFunction()
    {
      private final RankingFunction function = new DefaultRankingFunction(rank.incrementAndGet());

      public <T> int rank(Binding<T> binding) {
        return function.rank(binding);
      }

      public int maxRank() {
        return Integer.MAX_VALUE; // potential max rank could be as high as MAX_VALUE if @Priority is used
      }
View Full Code Here


        bind(ErrorPageServlet.class);

        serve("/error.html").with(ErrorPageServlet.class);

        // our configuration needs to be first-most when calculating order (some fudge room for edge-cases)
        bind(RankingFunction.class).toInstance(new DefaultRankingFunction(0x70000000));
      }
    });

    install(new MetricsModule());
View Full Code Here

            binder.bind( LoggerManager.class ).toProvider( loggerManagerProvider );
            binder.bind( Logger.class ).toProvider( loggerProvider );

            // allow plugins to override the default ranking function so we can support component profiles
            final Key<RankingFunction> plexusRankingKey = Key.get( RankingFunction.class, Names.named( "plexus" ) );
            binder.bind( plexusRankingKey ).toInstance( new DefaultRankingFunction( plexusRank.incrementAndGet() ) );
            binder.bind( RankingFunction.class ).to( plexusRankingKey );

            binder.install( dateConverter );

            binder.bind( PlexusBeanConverter.class ).toInstance( beanConverter );
View Full Code Here

TOP

Related Classes of org.eclipse.sisu.inject.DefaultRankingFunction

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.