Skip to main content

Posts

Showing posts with the label ExecutorService

Calling Synchronous WebServices Asynchronously from ADF Managed Bean

Recently I had to implement a SOAP webservice call from a af:commandButton action, but the requirement was to make it an asynchronous call. So that the user doesn't have to wait till the Webservice finish processing the request. So I built : Interface which extends java.util.concurrent.Callable. Interface so that I can use the same technique to call multiple Webservices, if required. A session scoped bean to invoke the above interface. #1. Interface : WebserviceCallee public interface WebserviceCallee<T> extends Callable<Boolean> {          // Base URL of the Webservice to call     public String getBaseUrl();     public void setBaseUrl(String baseUrl);     // To identify this object uniquely         public String getUniqueIdentifier(); } #2. Implentation :   public class WebServiceA implements WebserviceCallee<Boolean> {     ...