Project

General

Profile

Revision ed4d8a9e

IDed4d8a9e4f531e6e2eeab393ca9b8bf4361c5a29
Parent 487ee713
Child caa38c5b

Added by Katja Luther over 2 years ago

fix problems with progress monitor

View differences:

cdmlib-commons/src/main/java/eu/etaxonomy/cdm/common/monitor/IRemotingProgressMonitor.java
46 46
    public void addReport(String report);
47 47

  
48 48

  
49

  
49 50
//    public RemotingProgressMonitorThread getThread();
50
//
51
//    public boolean isMonitorThreadRunning();
51
    public boolean isMonitorThreadRunning();
52 52

  
53 53
}
cdmlib-commons/src/main/java/eu/etaxonomy/cdm/common/monitor/RemotingProgressMonitor.java
95 95
//    /**
96 96
//     * {@inheritDoc}
97 97
//     */
98
//    @Override
99
//    public boolean isMonitorThreadRunning() {
100
//        RemotingProgressMonitorThread monitorThread = RemotingProgressMonitorThread.getMonitorThread(this);
101
//        return monitorThread != null;
102
//    }
98
    @Override
99
    public boolean isMonitorThreadRunning() {
100
        RemotingProgressMonitorThread monitorThread = RemotingProgressMonitorThread.getMonitorThread(this);
101
        return monitorThread != null;
102
    }
103 103
}
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/longrunningService/LongRunningTasksServiceImpl.java
48 48
            public Serializable doRun(IRemotingProgressMonitor monitor) {
49 49
                UpdateResult result;
50 50
                config.setMonitor(monitor);
51
                System.err.println(monitor.getThread().getId());
52 51

  
53 52
                result = updateData(config);
54 53
                for(Exception e : result.getExceptions()) {
......
79 78
            @Override
80 79
            public Serializable doRun(IRemotingProgressMonitor remotingMonitor) {
81 80
                UpdateResult result;
82

  
83
                System.err.println(remotingMonitor.getThread().getId());
84

  
85 81
                result = taxonNodeService.moveTaxonNodes(movingUuids,targetTreeNodeUuid, movingType, remotingMonitor);
86 82
                for(Exception e : result.getExceptions()) {
87 83
                    remotingMonitor.addReport(e.getMessage());
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/ProgressMonitorServiceImpl.java
99 99
    public boolean isMonitorThreadRunning(UUID uuid) {
100 100
        IRemotingProgressMonitor remotingMonitor = getRemotingMonitor(uuid);
101 101
        if(remotingMonitor != null) {
102
            return progressMonitorManager.getThread(uuid) != null;
102
            return remotingMonitor.isMonitorThreadRunning();
103 103
        }
104 104
        return false;
105 105
    }
......
113 113
        if(monitor != null) {
114 114
            monitor.setCanceled(true);
115 115
            monitor.done();
116

  
116 117
        }
117 118
    }
118 119

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)