use of com.sun.jmx.examples.scandir.config.DirectoryScannerConfig in project jdk8u_jdk by JetBrains.
the class ScanDirConfig method removeDirectoryScanner.
// see ScanDirConfigMXBean
public DirectoryScannerConfig removeDirectoryScanner(String name) throws IOException, InstanceNotFoundException {
final DirectoryScannerConfig scanner;
synchronized (this) {
scanner = config.removeScan(name);
if (scanner == null)
throw new IllegalArgumentException(name + ": scanner not found");
status = MODIFIED;
}
sendNotification(NOTIFICATION_MODIFIED);
return scanner;
}
use of com.sun.jmx.examples.scandir.config.DirectoryScannerConfig in project jdk8u_jdk by JetBrains.
the class ScanManager method applyConfiguration.
// Applies a configuration.
// throws IllegalStateException if lock can't be acquired.
// Unregisters all existing directory scanners, the create and registers
// new directory scanners according to the given config.
// Then pushes the log config to the result log manager.
//
private void applyConfiguration(ScanManagerConfig bean) throws IOException, JMException {
if (bean == null)
return;
if (!sequencer.tryAcquire()) {
throw new IllegalStateException("Can't acquire lock");
}
try {
unregisterScanners();
final DirectoryScannerConfig[] scans = bean.getScanList();
if (scans == null)
return;
for (DirectoryScannerConfig scan : scans) {
addDirectoryScanner(scan);
}
log.setConfig(bean.getInitialResultLogConfig());
} finally {
sequencer.release();
}
}
Aggregations