Crossfire JXClient, Trunk
|
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, DirectoryScannerMXBean > | getDirectoryScanners () 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 |
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.
Definition at line 66 of file ScanManagerMXBean.java.
void com.sun.jmx.examples.scandir.ScanManagerMXBean.applyConfiguration | ( | boolean | fromMemory | ) | throws IOException, JMException |
Apply the configuration handled by the {configuration MBean}. When the configuration is applied, all the DirectoryScannerMXBean created by this MBean will be unregistered, and new {} will be created and registered from the new ScanDirConfigMXBean#getConfiguration configuration data}.
The initial result log configuration held by the {configuration MBean} will also be pushed to the ResultLogManagerMXBean}. If you don't want to lose your current ResultLogManagerMXBean} configuration, you should therefore call #applyCurrentResultLogConfig applyCurrentResultLogConfig} before calling #applyConfiguration applyConfiguration}
fromMemory | if true
false
ScanManagerMXBean
|
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().
void com.sun.jmx.examples.scandir.ScanManagerMXBean.applyCurrentResultLogConfig | ( | boolean | toMemory | ) | throws IOException, JMException |
Implemented in com.sun.jmx.examples.scandir.ScanManager.
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.
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.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().
ScanDirConfigMXBean com.sun.jmx.examples.scandir.ScanManagerMXBean.createOtherConfigurationMBean | ( | String | name, |
String | filename | ||
) | throws JMException, IOException |
This method creates a new alternate ScanDirConfigMXBean.
You will need to call setConfigurationMBean if you want this new ScanDirConfigMXBean to become the current configuration MBean.
This new ScanDirConfigMXBean will be unregistered automatically by the
when the
is unregistered.
name | The short name for the new ScanDirConfigMXBean. This name will be used in the ObjectName name= key of the new ScanDirConfigMXBean. |
filename | The path of the file from which the new {} can ScanDirConfigMXBean#load load} or ScanDirConfigMXBean#save save} its configuration data. Note that even if the file exists and contain a valid configuration, you will still need to call { ScanDirConfigMXBean#load load} to make the { ScanDirConfigMXBean} load its configuration data. IOException A connection problem occurred when accessing the underlying resource. JMException The MBeanServer failed to call the underlying MBean. A proxy to the created ScanDirConfigMXBean}. |
Implemented in com.sun.jmx.examples.scandir.ScanManager.
Referenced by com.sun.jmx.examples.scandir.ScanDirConfigTest.testAddNotificationListener(), and com.sun.jmx.examples.scandir.ScanDirConfigTest.testSave().
ScanDirConfigMXBean com.sun.jmx.examples.scandir.ScanManagerMXBean.getConfigurationMBean | ( | ) | throws IOException, InstanceNotFoundException |
Gets the current configuration MBean.
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.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().
Map<String,DirectoryScannerMXBean> com.sun.jmx.examples.scandir.ScanManagerMXBean.getDirectoryScanners | ( | ) | throws IOException, JMException |
Gets the list of directory scanners configured for this MBean.
name=
key of the DirectoryScannerMXBean ObjectName. IOException | A connection problem occurred when accessing the underlying resource. |
JMException | The 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().
ScanState com.sun.jmx.examples.scandir.ScanManagerMXBean.getState | ( | ) | throws IOException, InstanceNotFoundException |
Returns the current state of the application.
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.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().
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.
delay | The first scan session will be started after the given delay. 0 means start now. |
interval | Scan 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. |
IllegalStateException | if a scan session is already running or scheduled, or the MBean is closed. |
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.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().
void com.sun.jmx.examples.scandir.ScanManagerMXBean.setConfigurationMBean | ( | ScanDirConfigMXBean | config | ) | throws IOException, InstanceNotFoundException |
Instruct the
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.
config | A proxy to the ScanDirConfigMXBean that holds the new configuration for the application. |
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.ScanManager.
void com.sun.jmx.examples.scandir.ScanManagerMXBean.start | ( | ) | throws IOException, InstanceNotFoundException |
Starts a scan session immediately. This is equivalent to schedule(0,0).
IllegalStateException | if a scan session is already running or scheduled, or the MBean is closed. |
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.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().
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.
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.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().