Project

General

Profile

« Previous | Next » 

Revision 0afb9358

Added by Katja Luther almost 6 years ago

check in done() in remotingProgressMonitor whether result is already set

View differences:

cdmlib-commons/src/main/java/eu/etaxonomy/cdm/common/monitor/RemotingProgressMonitor.java
23 23

  
24 24
    private Serializable result;
25 25
    private List<String> reports = new ArrayList<String>();
26
    private boolean serviceDone;
26 27
//    private transient RemotingProgressMonitorThread monitorThread;
27 28

  
28 29

  
......
52 53
    @Override
53 54
    public void setResult(Serializable result) {
54 55
        this.result = result;
56
        if (serviceDone){
57
            super.done();
58
        }
55 59
    }
56 60

  
57 61

  
......
72 76
        reports.add(report);
73 77
    }
74 78

  
79
    @Override
80
    public void done() {
81
        serviceDone = true;
82
        if (result != null){
83
            super.done();
84
        }
85
    }
86

  
75 87
//    /**
76 88
//     * {@inheritDoc}
77 89
//     */
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/longrunningService/LongRunningTasksServiceImpl.java
24 24
import eu.etaxonomy.cdm.api.service.config.SecundumForSubtreeConfigurator;
25 25
import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
26 26
import eu.etaxonomy.cdm.common.monitor.RemotingProgressMonitorThread;
27
import eu.etaxonomy.cdm.common.monitor.SubProgressMonitor;
27 28

  
28 29
/**
29 30
 * @author k.luther
......
78 79
            @Override
79 80
            public Serializable doRun(IRemotingProgressMonitor remotingMonitor) {
80 81
                UpdateResult result;
81
                result = taxonNodeService.moveTaxonNodes(movingUuids,targetTreeNodeUuid, movingType, remotingMonitor);
82

  
83
                result = taxonNodeService.moveTaxonNodes(movingUuids,targetTreeNodeUuid, movingType,  SubProgressMonitor.NewStarted(remotingMonitor, movingUuids.size()+1,
84
                        "move taxon nodes", movingUuids.size()));
82 85
                for(Exception e : result.getExceptions()) {
83 86
                    remotingMonitor.addReport(e.getMessage());
84 87
                }
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonNodeServiceImpl.java
35 35
import eu.etaxonomy.cdm.api.service.pager.impl.DefaultPagerImpl;
36 36
import eu.etaxonomy.cdm.common.monitor.DefaultProgressMonitor;
37 37
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
38
import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
39 38
import eu.etaxonomy.cdm.filter.TaxonNodeFilter;
40 39
import eu.etaxonomy.cdm.hibernate.HHH_9751_Util;
41 40
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
......
730 729

  
731 730
        TaxonNode targetNode = dao.load(newParentNodeUuid);
732 731
        List<TaxonNode> nodes = dao.list(taxonNodeUuids, null, null, null, null);
732
        boolean hasPermission = true;
733

  
733 734
        monitor.beginTask("Move Taxonnodes", nodes.size() +1);
734
        ((IRemotingProgressMonitor)monitor).setResult(result);
735 735

  
736 736
        for (TaxonNode node: nodes){
737 737
            if (!nodes.contains(node.getParent())){
......
741 741
        }
742 742
        dao.saveOrUpdateAll(nodes);
743 743

  
744
//        monitor.done();
744
        monitor.done();
745 745
        return result;
746 746
    }
747 747

  
......
848 848
    public UpdateResult setSecundumForSubtree(SecundumForSubtreeConfigurator config) {
849 849
        UpdateResult result = new UpdateResult();
850 850
        IProgressMonitor monitor = config.getMonitor();
851

  
851 852
        if (monitor == null){
852 853
            monitor = DefaultProgressMonitor.NewInstance();
853 854
        }
......
890 891
           result.addUpdatedObjects(updatedSynonyms);
891 892
        }
892 893

  
893
//        monitor.done();
894
        monitor.done();
894 895
        return result;
895 896
    }
896 897

  
......
939 940
            result.addUpdatedObjects(updatedSynonyms);
940 941
        }
941 942

  
942
//        monitor.done();
943
        monitor.done();
943 944
        return result;
944 945
    }
945 946

  

Also available in: Unified diff