I've inherited a huge Java J2EE application (Java 1.8, Tomcat 8). It takes 30 seconds to logon - mostly because of multiple sequential AJAX calls (from the Java server, NOT JavaScript) to various services. One in particular takes over 10 seconds to return.
I don't need that result until towards the end - so I could initialize the AJAX call at the start, do other stuff, then sync up & use the result at the end.
I've never worked with Java multi-threading, but that seems like one way to achieve that. But not wanting to wait for the result of an AJAX call seems like a common use case. Are there any tools/libraries/conventions for this?
And this class has a lot of other methods - I don't (think) I want to make the whole class "Runnable" - would I make a couple of inner classes - "waiter & notifier", or??? Sorry, just never worked with threading in Java & trying to figure out where to begin....
Thanks...