Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log names of unfinished shutdown hooks #1017

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;

import com.webobjects.foundation.NSKeyValueCoding;
import com.webobjects.foundation.NSNotification;
Expand Down Expand Up @@ -57,7 +58,8 @@ public void run() {
synchronized( ALL_HOOKS ) {
while( ALL_HOOKS.size() > 0 ) {
// Use System.out to minimize dependencies
System.out.println( "ShutdownHook waiting for " + ALL_HOOKS.size() + " hook" + (ALL_HOOKS.size() > 1 ? "s" : "") + " to complete" );
String names = ALL_HOOKS.stream().map( hook -> hook.name ).collect( Collectors.joining( ", " ) );
System.out.println( "ERXShutdownHook waiting for " + ALL_HOOKS.size() + " hook" + (ALL_HOOKS.size() > 1 ? "s" : "") + " to complete: " + names );
ALL_HOOKS.wait();
}

Expand All @@ -74,7 +76,7 @@ public void run() {
} );
}

private String name;
String name;

/**
* Call this in your app constructor if you have no other shutdown hooks. If you don't call
Expand Down
Loading