Skip to content

Commit 2328725

Browse files
vladakahornace
authored andcommitted
make watchDog private
1 parent a5b20a7 commit 2328725

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/configuration/RuntimeEnvironment.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public final class RuntimeEnvironment {
125125
private transient volatile Boolean ctagsFound;
126126
private final transient Set<String> ctagsLanguages = new HashSet<>();
127127

128-
public WatchDogService watchDog;
128+
private final WatchDogService watchDog;
129129

130130
private final Set<ConfigurationChangedListener> listeners = new CopyOnWriteArraySet<>();
131131

@@ -163,6 +163,13 @@ public void setIndexer(boolean indexer) {
163163
this.indexer = indexer;
164164
}
165165

166+
/**
167+
* @return {@code WatchDogService} instance
168+
*/
169+
public WatchDogService getWatchDog() {
170+
return watchDog;
171+
}
172+
166173
/** Gets the thread pool used for multi-project searches. */
167174
public ExecutorService getSearchExecutor() {
168175
return lzSearchExecutor.get();

opengrok-web/src/main/java/org/opengrok/web/WebappListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public void contextInitialized(final ServletContextEvent servletContextEvent) {
101101

102102
String pluginDirectory = env.getPluginDirectory();
103103
if (pluginDirectory != null && env.isAuthorizationWatchdog()) {
104-
env.watchDog.start(new File(pluginDirectory));
104+
env.getWatchDog().start(new File(pluginDirectory));
105105
}
106106

107107
// Check index(es).
@@ -151,7 +151,7 @@ private void check_index(RuntimeEnvironment env) {
151151
public void contextDestroyed(final ServletContextEvent servletContextEvent) {
152152
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
153153
env.getIndexerParallelizer().bounce();
154-
env.watchDog.stop();
154+
env.getWatchDog().stop();
155155
env.stopExpirationTimer();
156156
try {
157157
env.shutdownRevisionExecutor();

0 commit comments

Comments
 (0)