Package org.openas2.support
Class FileMonitorAdapter
- java.lang.Object
-
- org.openas2.support.FileMonitorAdapter
-
- All Implemented Interfaces:
FileMonitorListener
public abstract class FileMonitorAdapter extends java.lang.Object implements FileMonitorListener
-
-
Field Summary
Fields Modifier and Type Field Description static intMINIMAL_SCHEDULE_INTERVAL-
Fields inherited from interface org.openas2.support.FileMonitorListener
EVENT_MODIFIED
-
-
Constructor Summary
Constructors Constructor Description FileMonitorAdapter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidonConfigFileChanged()A template method which is triggered once observing file is changed.voidonFileEvent(java.io.File file, int eventID)voidscheduleIfNeed(java.util.concurrent.ScheduledExecutorService executor, java.io.File file, int refreshInterval, java.util.concurrent.TimeUnit unit)Schedule a watch for file changes.
-
-
-
Field Detail
-
MINIMAL_SCHEDULE_INTERVAL
public static final int MINIMAL_SCHEDULE_INTERVAL
- See Also:
- Constant Field Values
-
-
Method Detail
-
scheduleIfNeed
public void scheduleIfNeed(java.util.concurrent.ScheduledExecutorService executor, java.io.File file, int refreshInterval, java.util.concurrent.TimeUnit unit)Schedule a watch for file changes. If schedule interval less thenMINIMAL_SCHEDULE_INTERVALno tasks will be scheduled- Parameters:
executor- a executorfile- an existing filerefreshInterval- refresh intervalunit- a time unit
-
onFileEvent
public void onFileEvent(java.io.File file, int eventID)- Specified by:
onFileEventin interfaceFileMonitorListener
-
onConfigFileChanged
public abstract void onConfigFileChanged() throws OpenAS2ExceptionA template method which is triggered once observing file is changed.- Throws:
OpenAS2Exception- - an internally handled error has occurred
-
-