service-registry/src/main/java/de/evoila/osb/service/registry/manager/ServiceBrokerManager.java
public void updateAllServiceBrokerCatalogs(boolean forceUpdate) {
        if (forceUpdate) cacheManager.clear();
        Iterable<ServiceBroker> brokers = getAll();
        int brokersCount = 0;
        for (ServiceBroker serviceBroker : brokers)
            brokersCount++;

        if (brokersCount == 0) return;

        ExecutorService executor = Executors.newFixedThreadPool(Math.min(brokersCount, catalogUpdateMaxThreadCount));
        List<FutureTask<String>> tasks = new LinkedList<FutureTask<String>>();

        for (ServiceBroker serviceBroker : brokers) {
            FutureTask<String> task = new FutureTask<String>(new AsyncCatalogUpdateTask(serviceBroker, this, forceUpdate));
            tasks.add(task);
            log.info("Starting new async " + (forceUpdate ? "forced" : "soft") + " catalog update handler for: " + serviceBroker.getLoggingNameString());
            executor.execute(task);
        }

        for (FutureTask<String> task : tasks) {
            try {
                String logName = task.get();
                log.info("Finished async catalog update for " + logName);
            } catch (InterruptedException | ExecutionException ex) {
                log.error("Executing an async catalog update failed.", ex);
            }
        }
    }
/**
     * Triggers a catalog update for every service broker in the storage.
     * This will be done via {@linkplain FutureTask} in parallel!
     *
     * @param forceUpdate flag to indicate a forced catalog update
     */
Triggers a catalog update for every service broker in the storage.
This will be done via  FutureTask in parallel!

@param forceUpdate flag to indicate a forced catalog update
Triggers a catalog update for every service broker in the storage . This will be done via FutureTask in parallel! @param forceUpdate flag to indicate a forced catalog update
public void updateAllServiceBrokerCatalogs(boolean forceUpdate) {
        if (forceUpdate) cacheManager.clear();
        Iterable<ServiceBroker> brokers = getAll();
        int brokersCount = 0;
        for (ServiceBroker serviceBroker : brokers)
            brokersCount++;
        if (brokersCount == 0) return;
        ExecutorService executor = Executors.newFixedThreadPool(Math.min(brokersCount, catalogUpdateMaxThreadCount));
        List<FutureTask<String>> tasks = new LinkedList<FutureTask<String>>();
        for (ServiceBroker serviceBroker : brokers) {
            FutureTask<String> task = new FutureTask<String>(new AsyncCatalogUpdateTask(serviceBroker, this, forceUpdate));
            tasks.add(task);
            log.info("Starting new async " + (forceUpdate ? "forced" : "soft") + " catalog update handler for: " + serviceBroker.getLoggingNameString());
            executor.execute(task);
        }
        for (FutureTask<String> task : tasks) {
            try {
                String logName = task.get();
                log.info("Finished async catalog update for " + logName);
            } catch (InterruptedException | ExecutionException ex) {
                log.error("Executing an async catalog update failed.", ex);
            }
        }
    }
public void updateAllServiceBrokerCatalogs ( boolean forceUpdate ) { if ( forceUpdate ) cacheManager . clear ( ) ; Iterable < ServiceBroker > brokers = getAll ( ) ; int brokersCount = 0 ; for ( ServiceBroker serviceBroker : brokers ) brokersCount ++ ; if ( brokersCount == 0 ) return ; ExecutorService executor = Executors . newFixedThreadPool ( Math . min ( brokersCount , catalogUpdateMaxThreadCount ) ) ; List < FutureTask < String > > tasks = new LinkedList < FutureTask < String > > ( ) ; for ( ServiceBroker serviceBroker : brokers ) { FutureTask < String > task = new FutureTask < String > ( new AsyncCatalogUpdateTask ( serviceBroker , this , forceUpdate ) ) ; tasks . add ( task ) ; log . info ( "Starting new async " + ( forceUpdate ? "forced" : "soft" ) + " catalog update handler for: " + serviceBroker . getLoggingNameString ( ) ) ; executor . execute ( task ) ; } for ( FutureTask < String > task : tasks ) { try { String logName = task . get ( ) ; log . info ( "Finished async catalog update for " + logName ) ; } catch ( InterruptedException | ExecutionException ex ) { log . error ( "Executing an async catalog update failed." , ex ) ; } } }
Triggers a catalog update for every service broker in the storage.
Triggers a catalog update for every service broker in the storage .