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

openmrs / openmrs-core / 44650025856

20 Nov 2026 12:58AM UTC coverage: 69.12% (-0.2%) from 69.299%
44650025856

push

github

web-flow
TRUNK-6868: Allow the session timeout to be configured (2.8.x) (#6841)

24 of 28 new or added lines in 2 files covered. (85.71%)

83 existing lines in 13 files now uncovered.

26840 of 38831 relevant lines covered (69.12%)

0.69 hits per line

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

48.15
/api/src/main/java/org/openmrs/api/EventListeners.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.api;
11

12
import java.util.List;
13

14
import org.slf4j.Logger;
15
import org.slf4j.LoggerFactory;
16

17
/**
18
 * Holds all OpenMRS event listeners
19
 */
20
public class EventListeners {
21
        
22
        private static final Logger log = LoggerFactory.getLogger(EventListeners.class);
1 ✔
23
        
24
        private static List<GlobalPropertyListener> globalPropertyListeners = null;
1 ✔
25
        
26
        public EventListeners() {
1 ✔
27
        }
1 ✔
28
        
29
        public List<GlobalPropertyListener> getGlobalPropertyListeners() {
30
                return globalPropertyListeners;
1 ✔
31
        }
32
        
33
        /**
34
         * This setter acts more like an "appender".  If the list already has elements, calling this method
35
         * will <b>add to</b> the list of listeners instead of replacing it.
36
         *
37
         * @param globalPropertyListeners
38
         */
39
        public void setGlobalPropertyListeners(List<GlobalPropertyListener> globalPropertyListeners) {
40
                if (globalPropertyListeners == null) {
1 ✔
41
                        return;
×
42
                }
43
                
44
                if (log.isDebugEnabled()) {
1 ✔
45
                        StringBuilder sb = new StringBuilder();
×
46
                        for (GlobalPropertyListener gpl : globalPropertyListeners) {
×
47
                                if (sb.length() > 0) {
×
48
                                        sb.append(", ");
×
49
                                }
50
                                sb.append(gpl.getClass().getName());
×
51
                        }
×
52
                        log.debug("GlobalPropertyListeners set to: " + sb);
×
53
                }
54
                
55
                if (EventListeners.globalPropertyListeners == null) {
1 ✔
56
                        EventListeners.globalPropertyListeners = globalPropertyListeners;
1 ✔
57
                } else {
UNCOV
58
                        for (GlobalPropertyListener gpl : globalPropertyListeners) {
×
UNCOV
59
                                if (!EventListeners.globalPropertyListeners.contains(gpl)) {
×
UNCOV
60
                                        EventListeners.globalPropertyListeners.add(gpl);
×
61
                                }
UNCOV
62
                        }
×
63
                }
64
        }
1 ✔
65
        
66
        /**
67
         * Convenience method called by spring to reset the static list of event
68
         * listeners.<br>
69
         * Without this, the event listener list continues to grow with every Spring
70
         * restart. (and is a memory leak)
71
         *
72
         * @see "applicationContext-service.xml"
73
         * @param nullList
74
         *            if true, nulls the list instead of just clearing it
75
         */
76
        public void setGlobalPropertyListenersToEmpty(boolean nullList) {
77
                if (nullList) {
1 ✔
78
                        EventListeners.globalPropertyListeners = null;
×
79
                } else if (EventListeners.globalPropertyListeners != null) {
1 ✔
UNCOV
80
                        EventListeners.globalPropertyListeners.clear();
×
81
                }
82
        }
1 ✔
83
        
84
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc