|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.tivoli.jmx.jar.DirectoryObserver
Observes a directory.
Gets a directory list and verifies whether these files that comply with the current filter have been added, removed or modified. The following ObserverNotification are sent:
An added
notification
when a file has been added
An removed
notification
when a file has been removed
An modified
notification
when a file has been modified
An error
notification
when the directory does not exist
The files to be considered can be fitered according to an array of file suffixes. In case the array is null, all the files in the directory will be considered.
Constructor Summary | |
DirectoryObserver()
Creates a DirectoryObserver |
|
DirectoryObserver(java.io.File directory,
java.lang.String[] filter)
Creates a DirectoryObserver |
Method Summary | |
java.io.File |
getDirectory()
The directory to be observed |
java.lang.String[] |
getFilter()
The suffixes used to filter the direcory |
javax.management.MBeanNotificationInfo[] |
getNotificationInfo()
Returns an array of notification types emitted. |
void |
handleNotification(javax.management.Notification notification,
java.lang.Object handback)
Gets a directory list and verifies whether these files that comply with the current filter have been added, removed or modified. |
void |
observe()
Gets a directory list and verifies whether these files that comply with the current filter have been added, removed or modified. |
void |
setDirectory(java.io.File directory)
The directory to be observed |
void |
setFilter(java.lang.String[] filter)
The suffixes used to filter the direcory |
Constructor Detail |
public DirectoryObserver()
public DirectoryObserver(java.io.File directory, java.lang.String[] filter)
directory
- the directory to be observedfilter
- the filter to be applied to the directoryMethod Detail |
public void setDirectory(java.io.File directory)
file
- the directory to be observedpublic java.io.File getDirectory()
public void handleNotification(javax.management.Notification notification, java.lang.Object handback)
An added
notification
when a file has been added
An removed
notification
when a file has been removed
An modified
notification
when a file has been modified
An error
notification
when the directory does not exist
.
Invokes observe
method
notification
- the timer notificationhandback
- ignored in thi implementationpublic java.lang.String[] getFilter()
public void setFilter(java.lang.String[] filter)
public void observe()
An added
notification
when a file has been added
An removed
notification
when a file has been removed
An modified
notification
when a file has been modified
An error
notification
when the directory does not exist
.
public javax.management.MBeanNotificationInfo[] getNotificationInfo()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |