File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
opengrok-indexer/src/main/java/org/opengrok/indexer/framework
opengrok-web/src/main/webapp Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -337,6 +337,9 @@ private String getClassName(JarEntry f) {
337
337
338
338
/**
339
339
* Perform custom operations before the plugins are loaded.
340
+ * <p>
341
+ * If this function returns {@code null}, the reloading is completely skipped and {@link #afterReload(Object)}
342
+ * is never called.
340
343
*
341
344
* @return the implementor can generate custom data which will be later passed to {@link #afterReload(Object)}
342
345
*/
@@ -347,6 +350,9 @@ private String getClassName(JarEntry f) {
347
350
* <p>
348
351
* When this is invoked, all plugins has been loaded into the memory and for each available plugin
349
352
* the {@link #classLoaded(Object, Object)} was invoked.
353
+ * <p>
354
+ * When {@link #beforeReload()} returns {@code null}, the reloading is skipped, and this method is
355
+ * never called.
350
356
*
351
357
* @param data a custom data created with {@link #beforeReload()}
352
358
*/
@@ -363,6 +369,12 @@ public final void reload() {
363
369
// notify the implementing class that the reload is about to begin
364
370
final DataType localData = beforeReload ();
365
371
372
+ if (localData == null ) {
373
+ // the implementor does not want to reload the plugins
374
+ LOGGER .log (Level .WARNING , "Loading plugins from {0} as instructed by the implementer's class" , pluginDirectory );
375
+ return ;
376
+ }
377
+
366
378
try {
367
379
if (pluginDirectory == null || !pluginDirectory .isDirectory () || !pluginDirectory .canRead ()) {
368
380
LOGGER .log (Level .WARNING , "Plugin directory not found or not readable: {0}." , pluginDirectory );
Original file line number Diff line number Diff line change @@ -247,13 +247,8 @@ Click <a href="<%= rawPath %>">download <%= basename %></a><%
247
247
}
248
248
} else {
249
249
// requesting a previous revision or needed to generate xref on the fly (economy mode).
250
- <<<<<< < HEAD
251
- AnalyzerFactory a = AnalyzerGuru . find(basename);
252
- Genre g = AnalyzerGuru . getGenre(a);
253
- ====== =
254
250
AnalyzerFactory a = cfg. getEnv(). getAnalyzerGuru(). find(basename);
255
251
AbstractAnalyzer . Genre g = cfg. getEnv(). getAnalyzerGuru(). getGenre(a);
256
- >>>>>> > Introducing an plugin framework for analyzers
257
252
String error = null ;
258
253
if (g == Genre . PLAIN || g == Genre . HTML || g == null ) {
259
254
InputStream in = null ;
You can’t perform that action at this time.
0 commit comments