|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object BaseSignalSourceThread org.sadun.util.polling.DirectoryPoller org.sadun.util.polling.ManagedDirectoryPoller
A JMX managed subclass of directory poller, exposing the
ManagedDirectoryPollerMBean
interface.
From v1.5, JMX notifications are also emitted together with the
existing events
.
One or more listeners may be registered to the Poller, allowing MBeans in
Nested Class Summary |
Nested classes inherited from class org.sadun.util.polling.DirectoryPoller |
DirectoryPoller.AutomoveDeleteException, DirectoryPoller.AutomoveException, DirectoryPoller.FileSizeComparator, DirectoryPoller.ModificationTimeComparator, DirectoryPoller.NullFilenameFilter |
Field Summary |
Fields inherited from class org.sadun.util.polling.DirectoryPoller |
DEFAULT_AUTOMOVE_DIRECTORY, pollManagersList |
Constructor Summary | |
ManagedDirectoryPoller()
Constructor for ManagedDirectoryPoller. |
|
ManagedDirectoryPoller(java.io.File directory)
Constructor for ManagedDirectoryPoller. |
|
ManagedDirectoryPoller(java.io.File[] dirs)
Constructor for ManagedDirectoryPoller. |
|
ManagedDirectoryPoller(java.io.File[] dirs,
java.io.FilenameFilter filter)
Constructor for ManagedDirectoryPoller. |
|
ManagedDirectoryPoller(java.io.File[] dirs,
java.io.FilenameFilter filter,
boolean timeBased)
Constructor for ManagedDirectoryPoller. |
|
ManagedDirectoryPoller(java.io.File directory,
java.io.FilenameFilter filter)
Constructor for ManagedDirectoryPoller. |
|
ManagedDirectoryPoller(java.io.File directory,
java.io.FilenameFilter filter,
boolean timeBased)
Constructor for ManagedDirectoryPoller. |
|
ManagedDirectoryPoller(java.io.FilenameFilter filter)
Constructor for ManagedDirectoryPoller. |
|
ManagedDirectoryPoller(java.io.FilenameFilter filter,
boolean timeBased)
Constructor for ManagedDirectoryPoller. |
Method Summary | |
void |
addControlledDirectory(java.lang.String dir)
Add one directory to the controlled set. |
void |
addNotificationListener(NotificationListener listener,
NotificationFilter filter,
java.lang.Object handback)
Implement the NotificationBroadcaster interface, by registering the listener at the internal JMXNotificationsPollManager . |
void |
addNotificationListener(ObjectName listenerMBeanName)
Register a listening MBean (found in the only existing MBean server) via its ObjectName. |
void |
addNotificationListener(java.lang.String mbeanServerName,
ObjectName listenerMBeanName)
Register a listening MBean via its ObjectName. |
void |
addPollManager(PollManager pm)
Adds on PollManager to the poller,
which will be notified on polling events.
|
int |
countControlledDirectories()
|
java.lang.String |
getAcceptedFilenamePattern()
|
java.lang.String |
getAutoMoveDirectoryPath(java.lang.String directory)
|
long |
getBaseTime(java.lang.String directory)
|
java.lang.String |
getControlledDirectories()
|
java.lang.String |
getControlledDirectory(int i)
|
java.lang.String |
getEventsOrdering()
|
java.lang.String |
getFilenameFilterFactory()
|
java.lang.String |
getFilenameFilterFactoryClass()
|
java.lang.String |
getFilesSortComparatorClass()
|
java.lang.String |
getJMXSequenceNumberGeneratorClass()
|
java.lang.String |
getJMXTimerObjectName()
Returns the jMXTimerObjectName. |
MBeanNotificationInfo[] |
getNotificationInfo()
|
java.lang.String |
getPollManagerFactory()
|
java.lang.String |
getPollManagerFactoryClass()
|
void |
handleNotification(Notification arg0,
java.lang.Object arg1)
Handles timer notifications, if a JMXTimer object is used |
boolean |
isRunning()
|
boolean |
isUsingJMXTimer()
Returns the usingJMXTimer. |
java.lang.String |
listControlledDirectories()
|
java.lang.String |
listInstalledPollManagers()
|
void |
postDeregister()
|
void |
postRegister(java.lang.Boolean registrationDone)
|
void |
preDeregister()
|
ObjectName |
preRegister(MBeanServer server,
ObjectName name)
|
void |
removeControlledDirectory(java.lang.String dir)
Remove one directory from the controlled set. |
void |
removeNotificationListener(NotificationListener listener)
Implement the NotificationBroadcaster interface, by removing the listener from the internal JMXNotificationsPollManager . |
void |
removeNotificationListener(java.lang.String mbeanServerName,
ObjectName listenerMBeanName)
Remove a listening MBean via its ObjectName. |
void |
setAcceptedFilenamePattern(java.lang.String filenamePattern)
|
void |
setAutoMoveDirectoryPath(java.lang.String directory,
java.lang.String automoveDirectory)
|
void |
setBaseTime(java.lang.String directory,
long time)
|
void |
setControlledDirectories(java.lang.String dirList)
|
void |
setEventsOrdering(java.lang.String expr)
|
void |
setFilenameFilterFactoryClass(java.lang.String newFilenameFilterFactoryClsName)
|
void |
setFilesSortComparatorClass(java.lang.String fileComparatorClassName)
|
void |
setFilter(java.io.FilenameFilter filter)
Set the current filter. |
void |
setJMXSequenceNumberGeneratorClass(java.lang.String sequenceNumberGeneratorClass)
|
void |
setJMXTimerObjectName(java.lang.String jMXTimerObjectName)
Sets the jMXTimerObjectName. |
void |
setPollManagerFactoryClass(java.lang.String newFactoryClsName)
|
void |
setUsingJMXTimer(boolean usingJMXTimer_NewValue)
Sets the usingJMXTimer. |
void |
shutDown()
|
void |
startUp()
Starts a thread for the poller |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.sadun.util.polling.ManagedDirectoryPollerMBean |
getAutoMove, getFilter, getPollInterval, isBypassLockedFiles, isDebugExceptions, isPollingTimeBased, isSendSingleFileEvent, isStartBySleeping, isTimeBased, isVerbose, removeNotificationListener, setAutoMove, setBypassLockedFiles, setDebugExceptions, setPollingTimeBased, setPollInterval, setSendSingleFileEvent, setStartBySleeping, setTimeBased, setVerbose |
Constructor Detail |
public ManagedDirectoryPoller(java.io.File[] dirs, java.io.FilenameFilter filter)
dirs
- filter
- public ManagedDirectoryPoller(java.io.File[] dirs)
dirs
- public ManagedDirectoryPoller(java.io.File directory, java.io.FilenameFilter filter)
directory
- filter
- public ManagedDirectoryPoller(java.io.File directory)
directory
- public ManagedDirectoryPoller(java.io.FilenameFilter filter)
filter
- public ManagedDirectoryPoller()
public ManagedDirectoryPoller(java.io.File[] dirs, java.io.FilenameFilter filter, boolean timeBased)
dirs
- filter
- timeBased
- public ManagedDirectoryPoller(java.io.File directory, java.io.FilenameFilter filter, boolean timeBased)
directory
- filter
- timeBased
- public ManagedDirectoryPoller(java.io.FilenameFilter filter, boolean timeBased)
filter
- timeBased
- Method Detail |
public void postDeregister()
javax.management.MBeanRegistration#postDeregister()
public void postRegister(java.lang.Boolean registrationDone)
javax.management.MBeanRegistration#postRegister(java.lang.Boolean)
public void preDeregister() throws java.lang.Exception
java.lang.Exception
javax.management.MBeanRegistration#preDeregister()
public ObjectName preRegister(MBeanServer server, ObjectName name) throws java.lang.Exception
java.lang.Exception
javax.management.MBeanRegistration#preRegister(javax.management.MBeanServer, javax.management.ObjectName)
public void startUp()
startUp
in interface ManagedDirectoryPollerMBean
Runnable.run()
public void shutDown()
shutDown
in interface ManagedDirectoryPollerMBean
public java.lang.String getAutoMoveDirectoryPath(java.lang.String directory)
getAutoMoveDirectoryPath
in interface ManagedDirectoryPollerMBean
public void removeControlledDirectory(java.lang.String dir)
removeControlledDirectory
in interface ManagedDirectoryPollerMBean
dir
- the directory to remove
java.lang.IllegalStateException
- if the poller has already started.
java.lang.IllegalArgumentException
- if the directory is not among the controlled onespublic void addControlledDirectory(java.lang.String dir)
addControlledDirectory
in interface ManagedDirectoryPollerMBean
dir
- the directory to add
java.lang.IllegalStateException
- if the poller has already started.
java.lang.IllegalArgumentException
- if String does not contain a directory pathpublic int countControlledDirectories()
countControlledDirectories
in interface ManagedDirectoryPollerMBean
ManagedDirectoryPollerMBean.countControlledDirectories()
public boolean isRunning()
isRunning
in interface ManagedDirectoryPollerMBean
public java.lang.String getControlledDirectory(int i)
getControlledDirectory
in interface ManagedDirectoryPollerMBean
ManagedDirectoryPollerMBean.getControlledDirectory(int)
public void setBaseTime(java.lang.String directory, long time)
setBaseTime
in interface ManagedDirectoryPollerMBean
public long getBaseTime(java.lang.String directory)
getBaseTime
in interface ManagedDirectoryPollerMBean
public java.lang.String listControlledDirectories()
listControlledDirectories
in interface ManagedDirectoryPollerMBean
public java.lang.String getControlledDirectories()
getControlledDirectories
in interface ManagedDirectoryPollerMBean
public void setControlledDirectories(java.lang.String dirList)
setControlledDirectories
in interface ManagedDirectoryPollerMBean
public java.lang.String listInstalledPollManagers()
listInstalledPollManagers
in interface ManagedDirectoryPollerMBean
public void addPollManager(PollManager pm)
DirectoryPoller
PollManager
to the poller,
which will be notified on polling events.
You may add many poll managers, but there is no support for inter-poll manager coordination, so if a PollManager deletes/moves a polled file, the others will still receive the associated event, but may not be able to perform proper processing.
addPollManager
in class DirectoryPoller
public java.lang.String getPollManagerFactoryClass()
getPollManagerFactoryClass
in interface ManagedDirectoryPollerMBean
ManagedDirectoryPollerMBean.getPollManagerFactory()
public void setPollManagerFactoryClass(java.lang.String newFactoryClsName) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException
setPollManagerFactoryClass
in interface ManagedDirectoryPollerMBean
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
ManagedDirectoryPollerMBean.setPollManagerFactoryClass(java.lang.String)
public java.lang.String getPollManagerFactory()
getPollManagerFactory
in interface ManagedDirectoryPollerMBean
ManagedDirectoryPollerMBean.getPollManagerFactory()
public boolean isUsingJMXTimer()
isUsingJMXTimer
in interface ManagedDirectoryPollerMBean
public void setUsingJMXTimer(boolean usingJMXTimer_NewValue)
setUsingJMXTimer
in interface ManagedDirectoryPollerMBean
public java.lang.String getJMXTimerObjectName()
getJMXTimerObjectName
in interface ManagedDirectoryPollerMBean
public void setJMXTimerObjectName(java.lang.String jMXTimerObjectName)
setJMXTimerObjectName
in interface ManagedDirectoryPollerMBean
jMXTimerObjectName
- The jMXTimerObjectName to setpublic void handleNotification(Notification arg0, java.lang.Object arg1)
javax.management.NotificationListener#handleNotification(javax.management.Notification, java.lang.Object)
public void setFilenameFilterFactoryClass(java.lang.String newFilenameFilterFactoryClsName) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException
setFilenameFilterFactoryClass
in interface ManagedDirectoryPollerMBean
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
public java.lang.String getFilenameFilterFactory()
getFilenameFilterFactory
in interface ManagedDirectoryPollerMBean
public java.lang.String getFilenameFilterFactoryClass()
getFilenameFilterFactoryClass
in interface ManagedDirectoryPollerMBean
public void setAcceptedFilenamePattern(java.lang.String filenamePattern)
setAcceptedFilenamePattern
in interface ManagedDirectoryPollerMBean
public void setFilter(java.io.FilenameFilter filter)
DirectoryPoller
setFilter
in class DirectoryPoller
filter
- the new filename filter to use.public java.lang.String getAcceptedFilenamePattern()
getAcceptedFilenamePattern
in interface ManagedDirectoryPollerMBean
public void setAutoMoveDirectoryPath(java.lang.String directory, java.lang.String automoveDirectory)
setAutoMoveDirectoryPath
in interface ManagedDirectoryPollerMBean
public java.lang.String getFilesSortComparatorClass()
getFilesSortComparatorClass
in interface ManagedDirectoryPollerMBean
public void setFilesSortComparatorClass(java.lang.String fileComparatorClassName) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException
setFilesSortComparatorClass
in interface ManagedDirectoryPollerMBean
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
public void setEventsOrdering(java.lang.String expr)
setEventsOrdering
in interface ManagedDirectoryPollerMBean
public java.lang.String getEventsOrdering()
getEventsOrdering
in interface ManagedDirectoryPollerMBean
public java.lang.String getJMXSequenceNumberGeneratorClass()
getJMXSequenceNumberGeneratorClass
in interface ManagedDirectoryPollerMBean
public void setJMXSequenceNumberGeneratorClass(java.lang.String sequenceNumberGeneratorClass) throws MBeanException
setJMXSequenceNumberGeneratorClass
in interface ManagedDirectoryPollerMBean
MBeanException
public MBeanNotificationInfo[] getNotificationInfo()
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, java.lang.Object handback) throws java.lang.IllegalArgumentException
JMXNotificationsPollManager
.
java.lang.IllegalArgumentException
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
JMXNotificationsPollManager
.
ListenerNotFoundException
public void addNotificationListener(ObjectName listenerMBeanName) throws InstanceNotFoundException
addNotificationListener
in interface ManagedDirectoryPollerMBean
listenerMBeanName
- the object name of the mbean which listens to to the poller's JMX notifications
InstanceNotFoundException
public void addNotificationListener(java.lang.String mbeanServerName, ObjectName listenerMBeanName) throws InstanceNotFoundException
addNotificationListener
in interface ManagedDirectoryPollerMBean
listenerMBeanName
- the object name of the mbean which listens to to the poller's JMX notifications
InstanceNotFoundException
public void removeNotificationListener(java.lang.String mbeanServerName, ObjectName listenerMBeanName) throws InstanceNotFoundException, ListenerNotFoundException
removeNotificationListener
in interface ManagedDirectoryPollerMBean
listenerMBeanName
- the object name of the mbean which is not to listen anymore to the poller's JMX notifications
InstanceNotFoundException
ListenerNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |