/** Load the certificates contained in all the TSL referenced by the LOTL */ public void init() { diagnosticInfo.clear(); X509Certificate lotlCert = null; if (checkSignature) { lotlCert = readLOTLCertificate(); } TrustStatusList lotl; try { LOG.info("Downloading LOTL from url= {}", lotlUrl); final ArrayList<X509Certificate> x509CertificateList = new ArrayList<X509Certificate>(); x509CertificateList.add(lotlCert); lotl = getTrustStatusList(lotlUrl, x509CertificateList); } catch (DSSException e) { LOG.error("The LOTL cannot be loaded: " + e.getMessage(), e); throw e; } diagnosticInfo.put(lotlUrl, "Loaded " + new Date().toString()); final int size = lotl.getOtherTSLPointers().size(); // final ExecutorService executorService = Executors.newFixedThreadPool(size); // List<Future> futures = new ArrayList<Future>(size); for (final PointerToOtherTSL pointerToTSL : lotl.getOtherTSLPointers()) { // Runnable runnable = new Runnable() { // public void run() { final String url = pointerToTSL.getTslLocation(); final String territory = pointerToTSL.getTerritory(); final List<X509Certificate> signingCertList = pointerToTSL.getDigitalIdentity(); try { loadTSL(url, territory, signingCertList); } catch (DSSException e) { LOG.error("Error loading trusted list for {} at {}", new Object[] {territory, url, e}); // do nothing continue with the next trusted list. } // } // }; // final Future submit = executorService.submit(runnable); // futures.add(submit); } // executorService.shutdown(); // while (!executorService.isTerminated()){ // try { // Thread.sleep(100); // } catch (InterruptedException e) { // throw new RuntimeException(e); // } // } // LOG.info("Parallel download of Trusted list done"); loadAdditionalLists(); LOG.info("Loading completed: {} trusted lists", size); LOG.info(" : {} certificates", certPool.getNumberOfCertificates()); }