org.sadun.util.polling
Class InstrumentedManagedDirectoryPoller

java.lang.Object
  extended byorg.sadun.util.polling.InstrumentedManagedDirectoryPoller
All Implemented Interfaces:
InstrumentedManagedDirectoryPollerMBean, ManagedDirectoryPollerMBean
Direct Known Subclasses:
InstrumentedManagedDirectoryPollerService

public class InstrumentedManagedDirectoryPoller
extends java.lang.Object
implements InstrumentedManagedDirectoryPollerMBean

An instrumentation of ManagedDirectoryPoller which implements InstrumentedManagedDirectoryPollerMBean and prints every invoked method on standard output. Useful only for debugging purposes.

Author:
Cristiano Sadun

Field Summary
protected  ManagedDirectoryPollerMBean mdp
           
 
Constructor Summary
  InstrumentedManagedDirectoryPoller()
           
protected InstrumentedManagedDirectoryPoller(ManagedDirectoryPollerMBean mdp)
           
 
Method Summary
 void addControlledDirectory(java.lang.String dir)
           
 void addNotificationListener(ObjectName objectName)
           
 void addNotificationListener(java.lang.String mbeanServerName, ObjectName objectName)
           
 int countControlledDirectories()
           
 java.lang.String getAcceptedFilenamePattern()
           
 boolean getAutoMove()
           
 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.io.FilenameFilter getFilter()
           
 java.lang.String getJMXSequenceNumberGeneratorClass()
           
 java.lang.String getJMXTimerObjectName()
           
 long getPollInterval()
           
 java.lang.String getPollManagerFactory()
           
 java.lang.String getPollManagerFactoryClass()
           
 java.lang.String getPropertyValues()
          Read the (other) property values in the MBean.
 void handleNotification(Notification arg0, java.lang.Object arg1)
           
 boolean isBypassLockedFiles()
           
 boolean isDebugExceptions()
           
 boolean isPollingTimeBased()
           
 boolean isRunning()
           
 boolean isSendSingleFileEvent()
           
 boolean isStartBySleeping()
           
 boolean isTimeBased()
           
 boolean isUsingJMXTimer()
           
 boolean isVerbose()
           
 java.lang.String listControlledDirectories()
           
 java.lang.String listInstalledPollManagers()
           
 void postDeregister()
           
 void postRegister(java.lang.Boolean arg0)
           
 void preDeregister()
           
 ObjectName preRegister(MBeanServer arg0, ObjectName arg1)
           
 void removeControlledDirectory(java.lang.String dir)
           
 void removeNotificationListener(ObjectName objectName)
           
 void removeNotificationListener(java.lang.String mbeanServerName, ObjectName objectName)
           
 void setAcceptedFilenamePattern(java.lang.String filenamePattern)
           
 void setAutoMove(boolean v)
           
 void setAutoMoveDirectoryPath(java.lang.String directory, java.lang.String automoveDirectory)
           
 void setBaseTime(java.lang.String directory, long time)
           
 void setBypassLockedFiles(boolean supportSlowTransfer)
           
 void setControlledDirectories(java.lang.String commaSeparatedList)
           
 void setDebugExceptions(boolean debugExceptions)
           
 void setEventsOrdering(java.lang.String expr)
           
 void setFilenameFilterFactoryClass(java.lang.String filenameFilterFactoryClsName)
           
 void setFilesSortComparatorClass(java.lang.String fileComparatorClassName)
           
 void setJMXSequenceNumberGeneratorClass(java.lang.String sequenceNumberGeneratorClass)
           
 void setJMXTimerObjectName(java.lang.String jMXTimerObjectName)
           
 void setPollingTimeBased(boolean v)
           
 void setPollInterval(long pollInterval)
           
 void setPollManagerFactoryClass(java.lang.String pollManagerFactoryClsName)
           
 void setSendSingleFileEvent(boolean v)
           
 void setStartBySleeping(boolean v)
           
 void setTimeBased(boolean v)
           
 void setUsingJMXTimer(boolean v)
           
 void setVerbose(boolean v)
           
 void shutDown()
           
 void startUp()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mdp

protected ManagedDirectoryPollerMBean mdp
Constructor Detail

InstrumentedManagedDirectoryPoller

public InstrumentedManagedDirectoryPoller()

InstrumentedManagedDirectoryPoller

protected InstrumentedManagedDirectoryPoller(ManagedDirectoryPollerMBean mdp)
Method Detail

setVerbose

public void setVerbose(boolean v)
Specified by:
setVerbose in interface ManagedDirectoryPollerMBean

isVerbose

public boolean isVerbose()
Specified by:
isVerbose in interface ManagedDirectoryPollerMBean

setAutoMove

public void setAutoMove(boolean v)
Specified by:
setAutoMove in interface ManagedDirectoryPollerMBean

getAutoMove

public boolean getAutoMove()
Specified by:
getAutoMove in interface ManagedDirectoryPollerMBean

getAutoMoveDirectoryPath

public java.lang.String getAutoMoveDirectoryPath(java.lang.String directory)
                                          throws MBeanException
Specified by:
getAutoMoveDirectoryPath in interface ManagedDirectoryPollerMBean
Throws:
MBeanException

startUp

public void startUp()
             throws MBeanException
Specified by:
startUp in interface ManagedDirectoryPollerMBean
Throws:
MBeanException

isRunning

public boolean isRunning()
                  throws MBeanException
Specified by:
isRunning in interface ManagedDirectoryPollerMBean
Throws:
MBeanException

getPollInterval

public long getPollInterval()
Specified by:
getPollInterval in interface ManagedDirectoryPollerMBean

setPollInterval

public void setPollInterval(long pollInterval)
Specified by:
setPollInterval in interface ManagedDirectoryPollerMBean

shutDown

public void shutDown()
              throws MBeanException
Specified by:
shutDown in interface ManagedDirectoryPollerMBean
Throws:
MBeanException

removeControlledDirectory

public void removeControlledDirectory(java.lang.String dir)
                               throws MBeanException
Specified by:
removeControlledDirectory in interface ManagedDirectoryPollerMBean
Throws:
MBeanException

addControlledDirectory

public void addControlledDirectory(java.lang.String dir)
                            throws MBeanException
Specified by:
addControlledDirectory in interface ManagedDirectoryPollerMBean
Throws:
MBeanException

getControlledDirectory

public java.lang.String getControlledDirectory(int i)
                                        throws MBeanException
Specified by:
getControlledDirectory in interface ManagedDirectoryPollerMBean
Throws:
MBeanException

countControlledDirectories

public int countControlledDirectories()
                               throws MBeanException
Specified by:
countControlledDirectories in interface ManagedDirectoryPollerMBean
Throws:
MBeanException

setStartBySleeping

public void setStartBySleeping(boolean v)
Specified by:
setStartBySleeping in interface ManagedDirectoryPollerMBean

isStartBySleeping

public boolean isStartBySleeping()
Specified by:
isStartBySleeping in interface ManagedDirectoryPollerMBean

setSendSingleFileEvent

public void setSendSingleFileEvent(boolean v)
Specified by:
setSendSingleFileEvent in interface ManagedDirectoryPollerMBean

isSendSingleFileEvent

public boolean isSendSingleFileEvent()
Specified by:
isSendSingleFileEvent in interface ManagedDirectoryPollerMBean

setBaseTime

public void setBaseTime(java.lang.String directory,
                        long time)
Specified by:
setBaseTime in interface ManagedDirectoryPollerMBean

getBaseTime

public long getBaseTime(java.lang.String directory)
Specified by:
getBaseTime in interface ManagedDirectoryPollerMBean

getControlledDirectories

public java.lang.String getControlledDirectories()
Specified by:
getControlledDirectories in interface ManagedDirectoryPollerMBean

setControlledDirectories

public void setControlledDirectories(java.lang.String commaSeparatedList)
Specified by:
setControlledDirectories in interface ManagedDirectoryPollerMBean

listControlledDirectories

public java.lang.String listControlledDirectories()
Specified by:
listControlledDirectories in interface ManagedDirectoryPollerMBean

listInstalledPollManagers

public java.lang.String listInstalledPollManagers()
Specified by:
listInstalledPollManagers in interface ManagedDirectoryPollerMBean

isTimeBased

public boolean isTimeBased()
Specified by:
isTimeBased in interface ManagedDirectoryPollerMBean

isPollingTimeBased

public boolean isPollingTimeBased()
Specified by:
isPollingTimeBased in interface ManagedDirectoryPollerMBean

setPollingTimeBased

public void setPollingTimeBased(boolean v)
Specified by:
setPollingTimeBased in interface ManagedDirectoryPollerMBean

setPollManagerFactoryClass

public void setPollManagerFactoryClass(java.lang.String pollManagerFactoryClsName)
                                throws java.lang.InstantiationException,
                                       java.lang.IllegalAccessException,
                                       java.lang.ClassNotFoundException
Specified by:
setPollManagerFactoryClass in interface ManagedDirectoryPollerMBean
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException

getPollManagerFactoryClass

public java.lang.String getPollManagerFactoryClass()
Specified by:
getPollManagerFactoryClass in interface ManagedDirectoryPollerMBean

getPollManagerFactory

public java.lang.String getPollManagerFactory()
Specified by:
getPollManagerFactory in interface ManagedDirectoryPollerMBean

setUsingJMXTimer

public void setUsingJMXTimer(boolean v)
Specified by:
setUsingJMXTimer in interface ManagedDirectoryPollerMBean

isUsingJMXTimer

public boolean isUsingJMXTimer()
Specified by:
isUsingJMXTimer in interface ManagedDirectoryPollerMBean

getJMXTimerObjectName

public java.lang.String getJMXTimerObjectName()
Specified by:
getJMXTimerObjectName in interface ManagedDirectoryPollerMBean

setJMXTimerObjectName

public void setJMXTimerObjectName(java.lang.String jMXTimerObjectName)
Specified by:
setJMXTimerObjectName in interface ManagedDirectoryPollerMBean

getFilter

public java.io.FilenameFilter getFilter()
Specified by:
getFilter in interface ManagedDirectoryPollerMBean

getAcceptedFilenamePattern

public java.lang.String getAcceptedFilenamePattern()
Specified by:
getAcceptedFilenamePattern in interface ManagedDirectoryPollerMBean

getFilenameFilterFactory

public java.lang.String getFilenameFilterFactory()
Specified by:
getFilenameFilterFactory in interface ManagedDirectoryPollerMBean

getFilenameFilterFactoryClass

public java.lang.String getFilenameFilterFactoryClass()
Specified by:
getFilenameFilterFactoryClass in interface ManagedDirectoryPollerMBean

setAcceptedFilenamePattern

public void setAcceptedFilenamePattern(java.lang.String filenamePattern)
Specified by:
setAcceptedFilenamePattern in interface ManagedDirectoryPollerMBean

setFilenameFilterFactoryClass

public void setFilenameFilterFactoryClass(java.lang.String filenameFilterFactoryClsName)
                                   throws java.lang.InstantiationException,
                                          java.lang.IllegalAccessException,
                                          java.lang.ClassNotFoundException
Specified by:
setFilenameFilterFactoryClass in interface ManagedDirectoryPollerMBean
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException

postDeregister

public void postDeregister()

postRegister

public void postRegister(java.lang.Boolean arg0)

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Throws:
java.lang.Exception

preRegister

public ObjectName preRegister(MBeanServer arg0,
                              ObjectName arg1)
                       throws java.lang.Exception
Throws:
java.lang.Exception

handleNotification

public void handleNotification(Notification arg0,
                               java.lang.Object arg1)

getPropertyValues

public java.lang.String getPropertyValues()
Description copied from interface: InstrumentedManagedDirectoryPollerMBean
Read the (other) property values in the MBean.

Specified by:
getPropertyValues in interface InstrumentedManagedDirectoryPollerMBean
Returns:
a String containing the (other) property values in the MBean.

setAutoMoveDirectoryPath

public void setAutoMoveDirectoryPath(java.lang.String directory,
                                     java.lang.String automoveDirectory)
Specified by:
setAutoMoveDirectoryPath in interface ManagedDirectoryPollerMBean

getFilesSortComparatorClass

public java.lang.String getFilesSortComparatorClass()
Specified by:
getFilesSortComparatorClass in interface ManagedDirectoryPollerMBean

setFilesSortComparatorClass

public void setFilesSortComparatorClass(java.lang.String fileComparatorClassName)
                                 throws java.lang.InstantiationException,
                                        java.lang.IllegalAccessException,
                                        java.lang.ClassNotFoundException
Specified by:
setFilesSortComparatorClass in interface ManagedDirectoryPollerMBean
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException

setEventsOrdering

public void setEventsOrdering(java.lang.String expr)
Specified by:
setEventsOrdering in interface ManagedDirectoryPollerMBean

getEventsOrdering

public java.lang.String getEventsOrdering()
Specified by:
getEventsOrdering in interface ManagedDirectoryPollerMBean

getJMXSequenceNumberGeneratorClass

public java.lang.String getJMXSequenceNumberGeneratorClass()
Specified by:
getJMXSequenceNumberGeneratorClass in interface ManagedDirectoryPollerMBean

setJMXSequenceNumberGeneratorClass

public void setJMXSequenceNumberGeneratorClass(java.lang.String sequenceNumberGeneratorClass)
                                        throws MBeanException
Specified by:
setJMXSequenceNumberGeneratorClass in interface ManagedDirectoryPollerMBean
Throws:
MBeanException

addNotificationListener

public void addNotificationListener(ObjectName objectName)
                             throws InstanceNotFoundException
Specified by:
addNotificationListener in interface ManagedDirectoryPollerMBean
Throws:
InstanceNotFoundException

addNotificationListener

public void addNotificationListener(java.lang.String mbeanServerName,
                                    ObjectName objectName)
                             throws InstanceNotFoundException
Specified by:
addNotificationListener in interface ManagedDirectoryPollerMBean
Throws:
InstanceNotFoundException

removeNotificationListener

public void removeNotificationListener(ObjectName objectName)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException
Specified by:
removeNotificationListener in interface ManagedDirectoryPollerMBean
Throws:
InstanceNotFoundException
ListenerNotFoundException

removeNotificationListener

public void removeNotificationListener(java.lang.String mbeanServerName,
                                       ObjectName objectName)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException
Specified by:
removeNotificationListener in interface ManagedDirectoryPollerMBean
Throws:
InstanceNotFoundException
ListenerNotFoundException

isBypassLockedFiles

public boolean isBypassLockedFiles()
Specified by:
isBypassLockedFiles in interface ManagedDirectoryPollerMBean

setBypassLockedFiles

public void setBypassLockedFiles(boolean supportSlowTransfer)
Specified by:
setBypassLockedFiles in interface ManagedDirectoryPollerMBean

isDebugExceptions

public boolean isDebugExceptions()
Specified by:
isDebugExceptions in interface ManagedDirectoryPollerMBean

setDebugExceptions

public void setDebugExceptions(boolean debugExceptions)
Specified by:
setDebugExceptions in interface ManagedDirectoryPollerMBean

setTimeBased

public void setTimeBased(boolean v)
Specified by:
setTimeBased in interface ManagedDirectoryPollerMBean


Copyright © 1999, 2000 Cristiano Sadun. This software is released under GPL.