• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openmrs / openmrs-core / 23193642646

17 Mar 2026 12:13PM UTC coverage: 63.1% (-0.3%) from 63.429%
23193642646

push

github

rkorytkowski
Fixing: Fix an issue with the ModuleResourceServlet

0 of 2 new or added lines in 1 file covered. (0.0%)

925 existing lines in 17 files now uncovered.

23137 of 36667 relevant lines covered (63.1%)

0.63 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

44.44
/api/src/main/java/org/openmrs/scheduler/tasks/AbstractTask.java
1
/**
2
 * This Source Code Form is subject to the terms of the Mozilla Public License,
3
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
4
 * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
5
 * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
6
 *
7
 * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
8
 * graphic logo is a trademark of OpenMRS Inc.
9
 */
10
package org.openmrs.scheduler.tasks;
11

12
import java.util.concurrent.ExecutionException;
13

14
import org.openmrs.scheduler.Task;
15
import org.openmrs.scheduler.TaskContext;
16
import org.openmrs.scheduler.TaskDefinition;
17
import org.openmrs.scheduler.TaskHandler;
18
import org.slf4j.Logger;
19
import org.slf4j.LoggerFactory;
20

21
/**
22
 * Base class for all other task classes.
23
 * 
24
 * @deprecated since 2.9.x use {@link TaskHandler} instead.
25
 */
26
@Deprecated
27
public abstract class AbstractTask implements Task {
28
        
29
        // Logger
30
        private static final Logger log = LoggerFactory.getLogger(AbstractTask.class);
1✔
31
        
32
        // Indicates whether the task is currently running
33
        protected boolean isExecuting = false;
1✔
34
        
35
        // The task definition of the running task
36
        protected TaskDefinition taskDefinition;
37
        
38
        protected TaskContext taskContext;
39
        
40
        /**
41
         * Default constructor
42
         */
43
        protected AbstractTask() {
1✔
44
        }
1✔
45
        
46
        /**
47
         * Constructor
48
         * 
49
         * @param taskDefinition the task definition
50
         */
UNCOV
51
        protected AbstractTask(TaskDefinition taskDefinition) {
×
UNCOV
52
                log.debug("Initializing " + taskDefinition.getName());
×
UNCOV
53
                initialize(taskDefinition);
×
UNCOV
54
        }
×
55
        
56
        /**
57
         * @see org.openmrs.scheduler.Task#execute()
58
         */
59
        @Override
60
        public abstract void execute() throws InterruptedException, ExecutionException;
61
        
62
        /**
63
         * @see org.openmrs.scheduler.Task#isExecuting()
64
         */
65
        @Override
66
        public boolean isExecuting() {
UNCOV
67
                return isExecuting;
×
68
        }
69
        
70
        /**
71
         * @see org.openmrs.scheduler.Task#initialize(TaskDefinition)
72
         */
73
        @Override
74
        public void initialize(final TaskDefinition definition) {
UNCOV
75
                this.taskDefinition = definition;
×
UNCOV
76
        }
×
77
        
78
        /**
79
         * @see org.openmrs.scheduler.Task#getTaskDefinition()
80
         */
81
        @Override
82
        public TaskDefinition getTaskDefinition() {
UNCOV
83
                return this.taskDefinition;
×
84
        }
85
        
86
        /**
87
         * @see org.openmrs.scheduler.Task#shutdown()
88
         */
89
        @Override
90
        public void shutdown() {
UNCOV
91
                taskDefinition = null;
×
UNCOV
92
        }
×
93
        
94
        /**
95
         * Callback method that tells the task that it has started executing.
96
         */
97
        public void startExecuting() {
98
                this.isExecuting = true;
1✔
99
        }
1✔
100
        
101
        /**
102
         * Callback method that tells the task that it has stopped executing.
103
         */
104
        public void stopExecuting() {
105
                this.isExecuting = false;
1✔
106
        }
1✔
107
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc