Crossfire JXClient, Trunk
|
Public Member Functions | |
DirectoryScannerConfig | getConfiguration () throws IOException, InstanceNotFoundException |
String | getCurrentScanInfo () throws IOException, InstanceNotFoundException |
String | getRootDirectory () throws IOException, InstanceNotFoundException |
ScanState | getState () throws IOException, InstanceNotFoundException |
void | scan () throws IOException, InstanceNotFoundException |
void | stop () throws IOException, InstanceNotFoundException |
A DirectoryScannerMXBean
is an MBean that scans a file system starting at a given root directory, and then looks for files that match a given criteria.
When such a file is found, the DirectoryScannerMXBean
takes the actions for which it was configured: see scan().
DirectoryScannerMXBeans
are created, initialized, and registered by the ScanManagerMXBean. The ScanManagerMXBean will also schedule and run them in background by calling their scan method.
Definition at line 63 of file DirectoryScannerMXBean.java.
DirectoryScannerConfig com.sun.jmx.examples.scandir.DirectoryScannerMXBean.getConfiguration | ( | ) | throws IOException, InstanceNotFoundException |
The configuration data from which this DirectoryScanner was created.
You cannot change this configuration here. You can however modify the ScanDirConfigMXBean configuration, and ask the ScanManagerMXBean to apply it. This will get all DirectoryScannerMXBean
replaced by new MBeans created from the modified configuration.
DirectoryScannerMXBean
configuration data. IOException | A connection problem occurred when accessing the underlying resource. |
InstanceNotFoundException | The underlying MBean is not registered in the MBeanServer. |
Implemented in com.sun.jmx.examples.scandir.DirectoryScanner.
String com.sun.jmx.examples.scandir.DirectoryScannerMXBean.getCurrentScanInfo | ( | ) | throws IOException, InstanceNotFoundException |
A short string describing what's happening in current/latest scan.
IOException | A connection problem occurred when accessing the underlying resource. |
InstanceNotFoundException | The underlying MBean is not registered in the MBeanServer. |
Implemented in com.sun.jmx.examples.scandir.DirectoryScanner.
String com.sun.jmx.examples.scandir.DirectoryScannerMXBean.getRootDirectory | ( | ) | throws IOException, InstanceNotFoundException |
Gets the root directory at which this DirectoryScannerMXBean
will start scanning the file system.
This is a shortcut to getConfiguration().{getRootDirectory()}.
DirectoryScannerMXBean
root directory. IOException | A connection problem occurred when accessing the underlying resource. |
InstanceNotFoundException | The underlying MBean is not registered in the MBeanServer. |
Implemented in com.sun.jmx.examples.scandir.DirectoryScanner.
Referenced by com.sun.jmx.examples.scandir.DirectoryScannerTest.testGetRootDirectory().
ScanState com.sun.jmx.examples.scandir.DirectoryScannerMXBean.getState | ( | ) | throws IOException, InstanceNotFoundException |
Get The DirectoryScanner state.
DirectoryScanner
. IOException | A connection problem occurred when accessing the underlying resource. |
InstanceNotFoundException | The underlying MBean is not registered in the MBeanServer. |
Implemented in com.sun.jmx.examples.scandir.DirectoryScanner.
Referenced by com.sun.jmx.examples.scandir.DirectoryScannerTest.testScan().
void com.sun.jmx.examples.scandir.DirectoryScannerMXBean.scan | ( | ) | throws IOException, InstanceNotFoundException |
Scans the file system starting at the specified root directory.
If a file that matches this DirectoryScannerMXBean
getConfiguration criteria is found, the DirectoryScannerMXBean
takes the {actions} for which it was #getConfiguration configured}: emit a notification, and or log a { com.sun.jmx.examples.scandir.config.ResultRecord} for this file, and or delete that file.
The code that would actually delete the file is commented out - so that nothing valuable is lost if this example is run by mistake on the wrong set of directories.
This method returns only when the directory scan is completed, or if it was stopped by another thread.
IllegalStateException | if already ScanState#RUNNING |
IOException | A connection problem occurred when accessing the underlying resource. |
InstanceNotFoundException | The underlying MBean is not registered in the MBeanServer. |
Implemented in com.sun.jmx.examples.scandir.DirectoryScanner.
Referenced by com.sun.jmx.examples.scandir.ScanManager.scanAllDirectories().
void com.sun.jmx.examples.scandir.DirectoryScannerMXBean.stop | ( | ) | throws IOException, InstanceNotFoundException |
Stops the current scan if running. After this method completes the state of the application will be STOPPED.
IOException | A connection problem occurred when accessing the underlying resource. |
InstanceNotFoundException | The underlying MBean is not registered in the MBeanServer. |
Implemented in com.sun.jmx.examples.scandir.DirectoryScanner.