public class FileObserverService extends JVMService
Property Keyword | Datatype | Default | Description |
---|---|---|---|
FileObserver.Flags | String | CREATION | The flag that specifies the type of observation. Possible value are: ATTRIBUE, CREATION, DIRECTORY, LASTACCESS, LASTWRITE, SIZE, SECURITY For multiple specification use a | for separation.
|
FileObserver.Directories | Path specification | none | This value gives a list of directories that should be observer. For multiple specification use a the path separator character for separation. |
FileObserver.Files | Path specification | none | This value gives a list of fully qualified files that should be observer. For multiple specification use a the path separator character for separation. |
FileObserver.WatchSubTree | boolean | false | If true the observer will have a look to the whole directory structure. |
FileObserver.ListenerClass | class name | none | A space separated list of listeners. The constructor will be called by passing the Properties object that contains all properties given by the service configuration. |
FileObserver.Timeout | int | 2000 | The timeout in milliseconds for the observer to interrupt the watch. |
FileObserver.WaitHint | int | 15000 | The timeout the service sends to system, that is needed for stop or startup. |
Modifier and Type | Field and Description |
---|---|
protected static java.util.Map<java.lang.String,java.lang.String> |
FLAG_MAP |
protected javax.swing.event.EventListenerList |
listeners |
protected FileObserverBinding |
observer |
protected java.util.Properties |
properties |
static java.lang.String |
version |
protected int |
waitHint |
appThread, CONTROLS_PARAMCHANGE, CONTROLS_PAUSABLE, CONTROLS_SHUTDOWN, CONTROLS_STOPPABLE, ERR_OUT, STD_OUT, WAIT_HINT
Constructor and Description |
---|
FileObserverService()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getVersion() |
int |
getWaitHint()
Get the time in milliseconds in that is needed for application to stop.
|
void |
init(java.lang.String[] param)
Set the application parameters.
|
static void |
main(java.lang.String[] args)
This main method should be used from JVMService.exe only !!!
|
void |
pause()
Pause the FileServerService thread.
|
void |
restart()
Restart the FileServerService thread.
|
void |
resume()
Resume the FileServerService thread.
|
void |
setEnvironment(java.lang.String key,
java.lang.String value)
Set environment variables.
|
void |
start()
Start the application.
|
void |
stop()
Stop the FileServerService thread.
|
errOut, errOut, getCallingClassName, getLogLevel, getLogType, requestStopService, sendServiceRunning, setControlsAccepted, stdOut, stdOut
public static final java.lang.String version
protected static final java.util.Map<java.lang.String,java.lang.String> FLAG_MAP
protected FileObserverBinding observer
protected java.util.Properties properties
protected javax.swing.event.EventListenerList listeners
protected int waitHint
public java.lang.String getVersion()
getVersion
in class JVMService
public void setEnvironment(java.lang.String key, java.lang.String value)
setEnvironment
in class JVMService
key
- The name of the variable.value
- The value of the variable.public void init(java.lang.String[] param)
init
in class JVMService
param
- The array containig the parameter strings.public void start()
start
in class JVMService
public void stop()
stop
in class JVMService
public void restart()
public void pause()
pause
in class JVMService
public void resume()
resume
in class JVMService
public int getWaitHint()
getWaitHint
in class JVMService
public static void main(java.lang.String[] args)
args
- arguments coming from the configuration file.