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

Classes

enum  ScanState
 

Public Member Functions

void applyConfiguration (boolean fromMemory) throws IOException, JMException
 
void applyCurrentResultLogConfig (boolean toMemory) throws IOException, JMException
 
void close () throws IOException, InstanceNotFoundException
 
ScanDirConfigMXBean createOtherConfigurationMBean (String name, String filename) throws JMException, IOException
 
ScanDirConfigMXBean getConfigurationMBean () throws IOException, InstanceNotFoundException
 
Map< String, DirectoryScannerMXBeangetDirectoryScanners () throws IOException, JMException
 
ScanState getState () throws IOException, InstanceNotFoundException
 
void schedule (long delay, long interval) throws IOException, InstanceNotFoundException
 
void setConfigurationMBean (ScanDirConfigMXBean config) throws IOException, InstanceNotFoundException
 
void start () throws IOException, InstanceNotFoundException
 
void stop () throws IOException, InstanceNotFoundException
 

Detailed Description

The ScanManagerMXBean is responsible for applying a configuration, starting and scheduling directory scans, and reporting application state.

The ScanManagerMXBean is a singleton MBean: there can be at most one instance of such an MBean registered in a given MBeanServer. The name of that MBean is a constant defined in ScanManager.SCAN_MANAGER_NAME.

The ScanManagerMXBean is the entry point of the scandir application management interface. It is from this MBean that all other MBeans will be created and registered.

Author
Sun Microsystems, 2006 - All rights reserved.

Definition at line 66 of file ScanManagerMXBean.java.

Member Function Documentation

◆ applyConfiguration()

void com.sun.jmx.examples.scandir.ScanManagerMXBean.applyConfiguration ( boolean  fromMemory) throws IOException, JMException

◆ applyCurrentResultLogConfig()

void com.sun.jmx.examples.scandir.ScanManagerMXBean.applyCurrentResultLogConfig ( boolean  toMemory) throws IOException, JMException

◆ close()

void com.sun.jmx.examples.scandir.ScanManagerMXBean.close ( ) throws IOException, InstanceNotFoundException

Switches the state to CLOSED. When closed, this MBean cannot be used any more.

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.ScanManager.

Referenced by com.sun.jmx.examples.scandir.ScanDirClient.main(), com.sun.jmx.examples.scandir.ScanDirConfigTest.testAddNotificationListener(), and com.sun.jmx.examples.scandir.ScanDirConfigTest.testSave().

Here is the caller graph for this function:

◆ createOtherConfigurationMBean()

ScanDirConfigMXBean com.sun.jmx.examples.scandir.ScanManagerMXBean.createOtherConfigurationMBean ( String  name,
String  filename 
) throws JMException, IOException

◆ getConfigurationMBean()

ScanDirConfigMXBean com.sun.jmx.examples.scandir.ScanManagerMXBean.getConfigurationMBean ( ) throws IOException, InstanceNotFoundException

Gets the current configuration MBean.

Returns
A proxy to the current configuration MBean.
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.ScanManager.

Referenced by com.sun.jmx.examples.scandir.ScanDirClient.main(), com.sun.jmx.examples.scandir.DirectoryScannerTest.testAddNotificationListener(), com.sun.jmx.examples.scandir.DirectoryScannerTest.testGetRootDirectory(), and com.sun.jmx.examples.scandir.DirectoryScannerTest.testScan().

Here is the caller graph for this function:

◆ getDirectoryScanners()

Map<String,DirectoryScannerMXBean> com.sun.jmx.examples.scandir.ScanManagerMXBean.getDirectoryScanners ( ) throws IOException, JMException

Gets the list of directory scanners configured for this MBean.

Returns
A
Map<String,DirectoryScannerMXBean>
where the key in the map is the value of the name= key of the DirectoryScannerMXBean ObjectName.
Exceptions
IOExceptionA connection problem occurred when accessing the underlying resource.
JMExceptionThe MBeanServer failed to call the underlying MBean.

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

Referenced by com.sun.jmx.examples.scandir.DirectoryScannerTest.testAddNotificationListener(), com.sun.jmx.examples.scandir.DirectoryScannerTest.testGetRootDirectory(), and com.sun.jmx.examples.scandir.DirectoryScannerTest.testScan().

Here is the caller graph for this function:

◆ getState()

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

Returns the current state of the application.

Returns
the current state of the application.
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.ScanManager.

Referenced by com.sun.jmx.examples.scandir.ScanManagerTest.testSchedule(), com.sun.jmx.examples.scandir.ScanManagerTest.testStart(), com.sun.jmx.examples.scandir.ScanManagerTest.testStop(), and com.sun.jmx.examples.scandir.ScanDirAgent.waitForClose().

Here is the caller graph for this function:

◆ schedule()

void com.sun.jmx.examples.scandir.ScanManagerMXBean.schedule ( long  delay,
long  interval 
) throws IOException, InstanceNotFoundException

Schedule a scan session for a later date.

A scan session is a background task that will sequentially call {scan()} on every { DirectoryScannerMXBean} configured for this MBean.

See also
getDirectoryScanners
Parameters
delayThe first scan session will be started after the given delay. 0 means start now.
intervalScan session will be rescheduled periodically at the specified interval. The interval starts at the the end of the scan session: if a scan session takes on average x milliseconds to complete, then a scan session will be started on average every x+interval milliseconds. if (interval == 0) then scan session will not be rescheduled, and will run only once.
Exceptions
IllegalStateExceptionif a scan session is already running or scheduled, or the MBean is closed.
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.ScanManager.

Referenced by com.sun.jmx.examples.scandir.ScanManagerTest.testAddNotificationListener(), com.sun.jmx.examples.scandir.ScanManagerTest.testSchedule(), and com.sun.jmx.examples.scandir.ScanManagerTest.testStop().

Here is the caller graph for this function:

◆ setConfigurationMBean()

void com.sun.jmx.examples.scandir.ScanManagerMXBean.setConfigurationMBean ( ScanDirConfigMXBean  config) throws IOException, InstanceNotFoundException

Instruct the

ScanManagerMXBean

to use another {configuration MBean}. This method doesn't apply the new configuration. If you want to apply the new configuration, you should additionally call applyConfiguration(true|false). Note that you cannot apply a configuration as long as a scan session is scheduled or running. In that case you will need to wait for that session to complete or call stop to stop it.

Parameters
configA proxy to the ScanDirConfigMXBean that holds the new configuration for the application.
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.ScanManager.

◆ start()

void com.sun.jmx.examples.scandir.ScanManagerMXBean.start ( ) throws IOException, InstanceNotFoundException

Starts a scan session immediately. This is equivalent to schedule(0,0).

Exceptions
IllegalStateExceptionif a scan session is already running or scheduled, or the MBean is closed.
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.ScanManager.

Referenced by com.sun.jmx.examples.scandir.DirectoryScannerTest.testAddNotificationListener(), com.sun.jmx.examples.scandir.DirectoryScannerTest.testScan(), and com.sun.jmx.examples.scandir.ScanManagerTest.testStart().

Here is the caller graph for this function:

◆ stop()

void com.sun.jmx.examples.scandir.ScanManagerMXBean.stop ( ) throws IOException, InstanceNotFoundException

Stops current running or scheduled scan sessions if any.

A scan session is a background task that will sequentially call {scan()} on every { DirectoryScannerMXBean} configured for this MBean.

Scan sessions are started/scheduled by calls to start or schedule.

After this method completes the state of the application will be ScanState#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.ScanManager.

Referenced by com.sun.jmx.examples.scandir.ScanManagerTest.testAddNotificationListener(), com.sun.jmx.examples.scandir.DirectoryScannerTest.testAddNotificationListener(), com.sun.jmx.examples.scandir.DirectoryScannerTest.testScan(), com.sun.jmx.examples.scandir.ScanManagerTest.testSchedule(), com.sun.jmx.examples.scandir.ScanManagerTest.testStart(), and com.sun.jmx.examples.scandir.ScanManagerTest.testStop().

Here is the caller graph for this function:

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