Package eu.admire.gateway.core.dispel

Examples of eu.admire.gateway.core.dispel.DistributedDISPELProcessor


                {
                    LOG.debug("Partitioning graph");
                    Map<GatewayLocation, Graph> partitions =
                        partitioner.partition(graph);
                   
                    DistributedDISPELProcessor processor =
                        new DistributedDISPELProcessor();
                    processor.registerRemoteProcessListener(this);
                    LOG.debug("Initialising distributed processors.");
                    processor.initialise(context, partitions, mErrors);
                    allResults.putAll(processor.getResults());
                    allExternalTransfers.putAll(processor.getExternalTransfers());
                    allManagedTransfers.putAll(processor.getManagedTransfers());
                    processors.add(processor);
                }
            }
            catch (InitialisationFailedException e)
            {
                LOG.error("Caught exception during initialisation.");
                updateStatus(ProcessingStatus.INITIALISATION_ERROR);
                updateErrors();
                updateFinishedAt();
                return;
            }
            updateResourceProperty(Constants.RESOURCE_PROPERTY_RESULTS, allResults);
            updateResourceProperty(Constants.RESOURCE_PROPERTY_EXTERNAL_TRANSFERS.getLocalPart(), allExternalTransfers);
            LOG.debug("Completed initialisation.");
            updateStatus(ProcessingStatus.PROCESSING);

            LOG.debug("Starting to process workflows.");
            ExecutorService service = Executors.newCachedThreadPool();
            CompletionService<Boolean> completion =
                new ExecutorCompletionService<Boolean>(service);
            try
            {
                int numTasks = 0;
                for (DistributedDISPELProcessor processor : processors)
                {
                    numTasks += processor.process(completion);
                }
                boolean success = true;
                for (int i=0; i<numTasks; i++)
                {
                    if (!completion.take().get())
View Full Code Here

TOP

Related Classes of eu.admire.gateway.core.dispel.DistributedDISPELProcessor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.