Crossfire JXClient, Trunk
Public Member Functions | List of all members
com.sun.jmx.examples.scandir.DirectoryScannerMXBean Interface Reference
Inheritance diagram for com.sun.jmx.examples.scandir.DirectoryScannerMXBean:
Inheritance graph
Collaboration diagram for com.sun.jmx.examples.scandir.DirectoryScannerMXBean:
Collaboration graph

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
 

Detailed Description

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.

Author
Sun Microsystems, 2006 - All rights reserved.

Definition at line 63 of file DirectoryScannerMXBean.java.

Member Function Documentation

◆ getConfiguration()

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.

Returns
This DirectoryScannerMXBean configuration data.
Exceptions
IOExceptionA connection problem occurred when accessing the underlying resource.
InstanceNotFoundExceptionThe underlying MBean is not registered in the MBeanServer.

Implemented in com.sun.jmx.examples.scandir.DirectoryScanner.

◆ getCurrentScanInfo()

String com.sun.jmx.examples.scandir.DirectoryScannerMXBean.getCurrentScanInfo ( ) throws IOException, InstanceNotFoundException

A short string describing what's happening in current/latest scan.

Returns
a short info string.
Exceptions
IOExceptionA connection problem occurred when accessing the underlying resource.
InstanceNotFoundExceptionThe underlying MBean is not registered in the MBeanServer.

Implemented in com.sun.jmx.examples.scandir.DirectoryScanner.

◆ getRootDirectory()

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()}.

Returns
This DirectoryScannerMXBean root directory.
Exceptions
IOExceptionA connection problem occurred when accessing the underlying resource.
InstanceNotFoundExceptionThe 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().

Here is the caller graph for this function:

◆ getState()

ScanState com.sun.jmx.examples.scandir.DirectoryScannerMXBean.getState ( ) throws IOException, InstanceNotFoundException

Get The DirectoryScanner state.

Returns
the current state of the DirectoryScanner.
Exceptions
IOExceptionA connection problem occurred when accessing the underlying resource.
InstanceNotFoundExceptionThe 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().

Here is the caller graph for this function:

◆ scan()

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.

Exceptions
IllegalStateExceptionif already ScanState#RUNNING
IOExceptionA connection problem occurred when accessing the underlying resource.
InstanceNotFoundExceptionThe 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().

Here is the caller graph for this function:

◆ stop()

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.

Exceptions
IOExceptionA connection problem occurred when accessing the underlying resource.
InstanceNotFoundExceptionThe underlying MBean is not registered in the MBeanServer.

Implemented in com.sun.jmx.examples.scandir.DirectoryScanner.


The documentation for this interface was generated from the following file: