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

evolvedbinary / elemental / 982

29 Apr 2025 08:34PM UTC coverage: 56.409% (+0.007%) from 56.402%
982

push

circleci

adamretter
[feature] Improve README.md badges

28451 of 55847 branches covered (50.94%)

Branch coverage included in aggregate %.

77468 of 131924 relevant lines covered (58.72%)

0.59 hits per line

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

81.82
/exist-core/src/main/java/org/exist/storage/BrokerPoolService.java
1
/*
2
 * Elemental
3
 * Copyright (C) 2024, Evolved Binary Ltd
4
 *
5
 * admin@evolvedbinary.com
6
 * https://www.evolvedbinary.com | https://www.elemental.xyz
7
 *
8
 * Use of this software is governed by the Business Source License 1.1
9
 * included in the LICENSE file and at www.mariadb.com/bsl11.
10
 *
11
 * Change Date: 2028-04-27
12
 *
13
 * On the date above, in accordance with the Business Source License, use
14
 * of this software will be governed by the Apache License, Version 2.0.
15
 *
16
 * Additional Use Grant: Production use of the Licensed Work for a permitted
17
 * purpose. A Permitted Purpose is any purpose other than a Competing Use.
18
 * A Competing Use means making the Software available to others in a commercial
19
 * product or service that: substitutes for the Software; substitutes for any
20
 * other product or service we offer using the Software that exists as of the
21
 * date we make the Software available; or offers the same or substantially
22
 * similar functionality as the Software.
23
 */
24
package org.exist.storage;
25

26
import org.exist.storage.txn.Txn;
27
import org.exist.util.Configuration;
28

29
/**
30
 * Interface for a class which provides
31
 * services to a BrokerPool instance
32
 *
33
 * @author <a href="mailto:adam@evolvedbinary.com">Adam Retter</a>
34
 */
35
public interface BrokerPoolService {
36

37
    /**
38
     * Configure this service
39
     *
40
     * By default there is nothing to configure.
41
     *
42
     * @param configuration BrokerPool configuration
43
     *
44
     * @throws BrokerPoolServiceException if an error occurs when configuring the service
45
     */
46
    default void configure(final Configuration configuration) throws BrokerPoolServiceException {
47
        //nothing to configure
48
    }
1✔
49

50
    /**
51
     * Prepare this service
52
     *
53
     * Prepare is called before the BrokerPool enters
54
     * system (single user) mode. As yet there are still
55
     * no brokers
56
     *
57
     * @param brokerPool The BrokerPool instance that is being prepared
58
     *
59
     * @throws BrokerPoolServiceException if an error occurs when preparing the service
60
     */
61
    default void prepare(final BrokerPool brokerPool) throws BrokerPoolServiceException {
62
        //nothing to prepare
63
    }
1✔
64

65
    /**
66
     * Start any part of this service that should happen before
67
     * system (single-user) mode.
68
     *
69
     * As this point the database is not generally available
70
     * and the only system broker is passed to this function
71
     *
72
     * @param systemBroker The system mode broker
73
     * @param transaction The transaction for the system service
74
     *
75
     * @throws BrokerPoolServiceException if an error occurs when starting the pre-system service
76
     */
77
    default void startPreSystem(final DBBroker systemBroker, final Txn transaction) throws BrokerPoolServiceException {
78
        // nothing to start
79
    }
1✔
80

81
    /**
82
     * Start any part of this service that should happen during
83
     * system (single-user) mode.
84
     *
85
     * As this point the database is not generally available
86
     * and the only system broker is passed to this function
87
     *
88
     * @param systemBroker The system mode broker
89
     * @param transaction The transaction for the system service
90
     *
91
     * @throws BrokerPoolServiceException if an error occurs when starting the system service
92
     */
93
    default void startSystem(final DBBroker systemBroker, final Txn transaction) throws BrokerPoolServiceException {
94
        // nothing to start
95
    }
1✔
96

97
    /**
98
     * Start any part of this service that should happen at the
99
     * end of system (single-user) mode and directly before multi-user
100
     * mode
101
     *
102
     * As this point the database is not generally available,
103
     * {@link #startSystem(DBBroker, Txn)} has already been called
104
     * for all services, any reindexing and recovery has completed
105
     * but there is still only a system broker which is passed to this
106
     * function
107
     *
108
     * @param systemBroker The system mode broker
109
     * @param transaction The transaction for the pre-multi-user system service
110
     *
111
     * @throws BrokerPoolServiceException if an error occurs when starting the pre-multi-user system service
112
     */
113
    default void startPreMultiUserSystem(final DBBroker systemBroker, final Txn transaction) throws BrokerPoolServiceException {
114
        //nothing to start
115
    }
1✔
116

117
    /**
118
     * Start any part of this service that should happen at the
119
     * start of multi-user mode.
120
     *
121
     * As this point the database is generally available,
122
     * {@link #startPreMultiUserSystem(DBBroker, Txn)} has already been called
123
     * for all services. You may be competing with other services and/or
124
     * users for database access
125
     *
126
     * @param brokerPool The multi-user available broker pool instance
127
     *
128
     * @throws BrokerPoolServiceException if an error occurs when starting the multi-user service
129
     */
130
    default void startMultiUser(final BrokerPool brokerPool) throws BrokerPoolServiceException {
131
        //nothing to start
132
    }
1✔
133

134
    /**
135
     * Stop any part of this service that should happen at the
136
     * end of multi-user mode.
137
     *
138
     * As this point the database is about to shutdown but has not yet
139
     * transitioned to single-user mode.
140
     * You may still be competing with other services and/or
141
     * users for database access.
142
     *
143
     * @param brokerPool The multi-user available broker pool instance
144
     *
145
     * @throws BrokerPoolServiceException if an error occurs when stopping the multi-user service
146
     */
147
    default void stopMultiUser(final BrokerPool brokerPool) throws BrokerPoolServiceException {
148
        //nothing to stop
149
    }
1✔
150

151
    /**
152
     * Stop any part of this service that should happen during
153
     * system (single-user) mode.
154
     *
155
     * By default there is nothing to stop
156
     *
157
     * As this point the database is not generally available
158
     * and the only system broker is passed to this function
159
     *
160
     * @param systemBroker The system mode broker
161
     *
162
     * @throws BrokerPoolServiceException if an error occurs when stopping the service
163
     *
164
     * @deprecated Use {@link #stopSystem(DBBroker)} instead.
165
     */
166
    @Deprecated
167
    default void stop(final DBBroker systemBroker) throws BrokerPoolServiceException {
168
        stopSystem(systemBroker);
×
169
    }
×
170

171
    /**
172
     * Stop any part of this service that should happen during
173
     * system (single-user) mode.
174
     *
175
     * By default there is nothing to stop
176
     *
177
     * As this point the database is not generally available
178
     * and the only system broker is passed to this function
179
     *
180
     * @param systemBroker The system mode broker
181
     *
182
     * @throws BrokerPoolServiceException if an error occurs when stopping the service
183
     */
184
    default void stopSystem(final DBBroker systemBroker) throws BrokerPoolServiceException {
185
        //nothing to actually stop
186
    }
1✔
187

188
    /**
189
     * Shutdown this service.
190
     *
191
     * By default there is nothing to shutdown
192
     */
193
    default void shutdown() {
194
        //nothing to actually shutdown
195
    }
1✔
196
}
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

© 2025 Coveralls, Inc