cstamas commented on a change in pull request #77:
URL: https://github.com/apache/maven-resolver/pull/77#discussion_r605520475



##########
File path: 
maven-resolver-impl/src/main/java/org/eclipse/aether/impl/guice/AetherModule.java
##########
@@ -146,10 +161,77 @@ protected void configure()
         bind( LocalRepositoryManagerFactory.class ).annotatedWith( 
Names.named( "enhanced" ) ) //
         .to( EnhancedLocalRepositoryManagerFactory.class ).in( Singleton.class 
);
 
+        bind( SyncContextFactoryDelegate.class ).annotatedWith( Names.named( 
NoLockSyncContextFactory.NAME ) )
+                .to( NoLockSyncContextFactory.class ).in( Singleton.class );
+        bind( SyncContextFactoryDelegate.class ).annotatedWith( Names.named( 
GlobalSyncContextFactory.NAME ) )
+                .to( GlobalSyncContextFactory.class ).in( Singleton.class );
+        bind( SyncContextFactoryDelegate.class ).annotatedWith( Names.named( 
NamedSyncContextFactory.NAME ) )
+                .to( NamedSyncContextFactory.class ).in( Singleton.class );
+
+        bind( NameMapper.class ).annotatedWith( Names.named( 
StaticNameMapper.NAME ) )
+            .to( StaticNameMapper.class ).in( Singleton.class );
+        bind( NameMapper.class ).annotatedWith( Names.named( 
GAVNameMapper.NAME ) )
+            .to( GAVNameMapper.class ).in( Singleton.class );
+        bind( NameMapper.class ).annotatedWith( Names.named( 
DiscriminatingNameMapper.NAME ) )
+            .to( DiscriminatingNameMapper.class ).in( Singleton.class );
+        bind( NameMapper.class ).annotatedWith( Names.named( 
TakariNameMapper.NAME ) )
+            .to( TakariNameMapper.class ).in( Singleton.class );
+
+        bind( NamedLockFactory.class ).annotatedWith( Names.named( 
LocalReadWriteLockNamedLockFactory.NAME ) )
+                .to( LocalReadWriteLockNamedLockFactory.class ).in( 
Singleton.class );
+        bind( NamedLockFactory.class ).annotatedWith( Names.named( 
LocalSemaphoreNamedLockFactory.NAME ) )
+                .to( LocalSemaphoreNamedLockFactory.class ).in( 
Singleton.class );
+        bind( NamedLockFactory.class ).annotatedWith( Names.named( 
TakariNamedLockFactory.NAME ) )
+            .to( TakariNamedLockFactory.class ).in( Singleton.class );
+
         install( new Slf4jModule() );
 
     }
 
+    @Provides
+    @Singleton
+    Map<String, SyncContextFactoryDelegate> provideSyncContextFactoryDelegates(
+            @Named( NoLockSyncContextFactory.NAME ) SyncContextFactoryDelegate 
nolock,
+            @Named( GlobalSyncContextFactory.NAME ) SyncContextFactoryDelegate 
global,
+            @Named( NamedSyncContextFactory.NAME ) SyncContextFactoryDelegate 
named )
+    {
+        Map<String, SyncContextFactoryDelegate> factories = new HashMap<>();
+        factories.put( NoLockSyncContextFactory.NAME, nolock );
+        factories.put( GlobalSyncContextFactory.NAME, global );
+        factories.put( NamedSyncContextFactory.NAME, named );
+        return Collections.unmodifiableMap( factories );
+    }
+
+    @Provides
+    @Singleton
+    Map<String, NameMapper> provideNameMappers(
+        @Named( StaticNameMapper.NAME ) NameMapper staticNameMapper,
+        @Named( GAVNameMapper.NAME ) NameMapper gavNameMapper,
+        @Named( DiscriminatingNameMapper.NAME ) NameMapper lgavNameMapper,

Review comment:
       leftover, fixed. At one point it was "local repo + gav mapper", but 
since it got changed to use composition with gav mapper and became 
"discriminating"




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to