File tree Expand file tree Collapse file tree 4 files changed +11
-8
lines changed
batch-module/src/main/java/org/simplejavamail/internal/batchsupport
core-module/src/main/java/org/simplejavamail
simple-java-mail/src/main/java/org/simplejavamail/mailer/internal Expand file tree Collapse file tree 4 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -131,11 +131,11 @@ private void checkConfigureOAuth2Token(Session session) {
131131 */
132132 @ NotNull
133133 @ Override
134- public Future <? > shutdownConnectionPools (@ NotNull Session session ) {
134+ public Future <Void > shutdownConnectionPools (@ NotNull Session session ) {
135135 if (smtpConnectionPool == null ) {
136136 LOGGER .warn ("user requested connection pool shutdown, but there is no connection pool to shut down (yet)" );
137137 return completedFuture (null );
138138 }
139139 return smtpConnectionPool .shutdownPool (session );
140140 }
141- }
141+ }
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ public interface Mailer extends AutoCloseable {
120120 * <p>
121121 * <strong>Note:</strong> this is only works in combination with the {@value org.simplejavamail.internal.modules.BatchModule#NAME}.
122122 */
123- Future <? > shutdownConnectionPool ();
123+ Future <Void > shutdownConnectionPool ();
124124
125125 /**
126126 * @return The server connection details. Will be {@code null} in case a custom fixed {@link Session} instance is used.
Original file line number Diff line number Diff line change @@ -57,5 +57,5 @@ public interface BatchModule {
5757 * Shuts down connection pool(s) and closes remaining open connections. Waits until all connections still in use become available again to deallocate them as well.
5858 */
5959 @ NotNull
60- Future <? > shutdownConnectionPools (@ NotNull Session session );
61- }
60+ Future <Void > shutdownConnectionPools (@ NotNull Session session );
61+ }
Original file line number Diff line number Diff line change @@ -373,11 +373,14 @@ public boolean validate(@NotNull final Email email)
373373 * @see Mailer#shutdownConnectionPool()
374374 */
375375 @ Override
376- public Future <? > shutdownConnectionPool () {
376+ public Future <Void > shutdownConnectionPool () {
377377 if (!operationalConfig .isExecutorServiceIsUserProvided ()) {
378378 operationalConfig .getExecutorService ().shutdown ();
379379 }
380- return ModuleLoader .loadBatchModule ().shutdownConnectionPools (session );
380+ if (ModuleLoader .batchModuleAvailable ()) {
381+ return ModuleLoader .loadBatchModule ().shutdownConnectionPools (session );
382+ }
383+ return CompletableFuture .completedFuture (null );
381384 }
382385
383386 @ Override
@@ -458,4 +461,4 @@ public EmailGovernance getEmailGovernance() {
458461 public void close () throws ExecutionException , InterruptedException {
459462 shutdownConnectionPool ().get ();
460463 }
461- }
464+ }
You can’t perform that action at this time.
0 commit comments