KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > services > deamons > filewatcher > JahiaFileWatcherService


1 //
2
// ____.
3
// __/\ ______| |__/\. _______
4
// __ .____| | \ | +----+ \
5
// _______| /--| | | - \ _ | : - \_________
6
// \\______: :---| : : | : | \________>
7
// |__\---\_____________:______: :____|____:_____\
8
// /_____|
9
//
10
// . . . i n j a h i a w e t r u s t . . .
11
//
12
//
13
//
14
// JahiaFileWatcherService
15
//
16
// NK 12.01.2001
17
//
18
//
19

20
21 package org.jahia.services.deamons.filewatcher;
22
23
24 import org.jahia.exceptions.JahiaException;
25 import org.jahia.services.JahiaService;
26
27 import java.util.Observer JavaDoc;
28
29
30 /**
31  * This Service hold a pool of instance of jahia.tools.FileWatcher Class.
32  * Each Thread are identified by a name and accessible through this name.
33  * Threads are added in an Hashtable registry.
34  *
35  * @author Khue ng
36  * @version 1.0
37  */

38 public abstract class JahiaFileWatcherService extends JahiaService {
39
40
41     /**
42      * addFileWatcher
43      *
44      * @param (String) threadName, the Name to identify this thread
45      * @param (String) fullFolderPath, the real path to the folder to watch
46      * @param (boolean) checkDate, check new fle by last modif date
47      * @param (long) intetal, the interval in millis
48      */

49     public abstract void addFileWatcher (String JavaDoc threadName,
50                                          String JavaDoc fullFolderPath,
51                                          boolean checkDate,
52                                          long interval,
53                                          boolean fileOny
54                                          ) throws JahiaException;
55
56
57     /**
58      * Call the start method of the thread
59      *
60      * @param (String) threadName, the Name to identify this thread
61      */

62     public abstract void startFileWatcher (String JavaDoc threadName) throws JahiaException;
63
64     /**
65      * Stops the file watcher thread. Should be called when shutting down the
66     * application.
67      * @param threadName String the name of the thread to shutdown.
68      * @throws JahiaException
69      */

70     public abstract void stopFileWatcher(String JavaDoc threadName) throws JahiaException;
71
72
73     /**
74      * Register an Observer Thread with an Observable Thread
75      *
76      * @param (String) threadName, the Name of Observable object
77      * @param (Observer) the observer object
78      */

79     public abstract void registerObserver (String JavaDoc threadName,
80                                            Observer JavaDoc obs
81                                            );
82
83     public abstract void shutdown ()
84         throws JahiaException;
85
86
87 } // end JahiaFileWatcherService
88
Popular Tags