com.tivoli.jmx.jar
Interface JarInstallerMBean

All Known Implementing Classes:
JarInstaller

public interface JarInstallerMBean

This MBean works as a deployer of all the jar management system. Its constructor receives in input an array of directories to be monitored and optionally a domain. It can be further configured through two attributes: the granularity period to specify the observation time interval and the purge attribute.

At registration time this MBean instatiates, through the MBeanServer, a javax.management.timer.Timer a com.tivoli.jmx.jar.DirectoryObserver for each directory specified, and an com.tivoli.jmx.jar.MLetManager.

All the DirectoryObservers are added as listeners to the javax.management.timer.Timer while the com.tivoli.jmx.jar.MLetManager is added as listener in all the DirectoryObservers. When the "enable" method is invoked, the javax.management.timer.Timer is started.

Periodically the javax.management.timer.Timer sends a Notification to all the DirectoryObservers in order to perform the directory check to verify, for instance, if a new jar has been added. In turn., if a change is observed, the com.tivoli.jmx.jar.MLetManager might receive a notification to register or unregister an javax.management.loading.MLet.

This process can be stopped through the "disable" method since it stops the javax.management.timer.Timer.

At deregistration time the javax.management.timer.Timer, the com.tivoli.jmx.jar.MLetManager and all the DirectoryObservers are deregistered according to the "purge" attribute value. In case the "purge" attribute is set to true, the com.tivoli.jmx.jar.MLetManager provides, in turn, to deregister all the MLets.

Version:
1.3
Author:
Max Parlione

Method Summary
 void disable()
          Disables the polling activity
 void enable()
          The directories start to be monitored.
 java.io.File[] getDirectories()
          Returns the observed directories
 long getGranularityPeriod()
          Sets the polling time.
 boolean getPurge()
          Returns the purge flag.
 boolean isActive()
          Returns the status.
 void setGranularityPeriod(long granularityPeriod)
          Sets the polling time.
 void setPurge(boolean purge)
          Sets the purge flag.
 

Method Detail

getDirectories

public java.io.File[] getDirectories()
Returns the observed directories
Returns:
the directories observed

setGranularityPeriod

public void setGranularityPeriod(long granularityPeriod)
Sets the polling time.
Parameters:
granularityPeriod - the granularity period to poll the directories

getGranularityPeriod

public long getGranularityPeriod()
Sets the polling time.
Returns:
The granularity period to poll the directories

isActive

public boolean isActive()
Returns the status.
Parameters:
the - current status

enable

public void enable()
            throws java.lang.Exception
The directories start to be monitored.

disable

public void disable()
             throws java.lang.Exception
Disables the polling activity

setPurge

public void setPurge(boolean purge)
Sets the purge flag.
Parameters:
purge - True enables the deregistration of all the MLet registered by the JarInstaller MBean

getPurge

public boolean getPurge()
Returns the purge flag.
Returns:
purge True enables the deregistration of all the MLet registered by the JarInstaller MBean