chibenwa commented on code in PR #1824:
URL: https://github.com/apache/james-project/pull/1824#discussion_r1422338355


##########
server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServerFactory.java:
##########
@@ -43,28 +45,32 @@ public class IMAPServerFactory extends 
AbstractServerFactory {
     protected final ThrowingFunction<HierarchicalConfiguration<ImmutableNode>, 
ImapSuite> imapSuiteProvider;
     protected final ImapMetrics imapMetrics;
     protected final GaugeRegistry gaugeRegistry;
+    protected final ThrowingFunction<HierarchicalConfiguration<ImmutableNode>, 
Set<ConnectionCheck>> connectionCheckProvider;
 
     @Inject
     @Deprecated
     public IMAPServerFactory(FileSystem fileSystem, ImapDecoder decoder, 
ImapEncoder encoder, ImapProcessor processor,
-                             MetricFactory metricFactory, GaugeRegistry 
gaugeRegistry) {
+                             MetricFactory metricFactory, GaugeRegistry 
gaugeRegistry, ThrowingFunction<HierarchicalConfiguration<ImmutableNode>, 
Set<ConnectionCheck>> connectionCheckProvider) {

Review Comment:
   ```suggestion
                                MetricFactory metricFactory, GaugeRegistry 
gaugeRegistry, Function<HierarchicalConfiguration<ImmutableNode>, 
Set<ConnectionCheck>> connectionCheckProvider
   ```
   
   That's lighter. Tips: Sneaky throw.
   
   Or even better: name this explicitly with an interface:
   
   ```
   @FunctionalInterface
   interface ConnectionCheckFactory {
       Set<ConnectionCheck> create(ImapConfiguration imapConfiguration)
   }
   ```
   
   BTW that's mabe a refactoring but we would need to convert the XML into an 
ImapConfiguration in this class as soon as we can.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to