com.Prominic.jFTPd
Class FTPdAsService

java.lang.Object
  extended by java.lang.Thread
      extended by com.Prominic.jFTPd.FTPdAsService
All Implemented Interfaces:
com.kcmultimedia.jvmi2.SCMEventListener, java.lang.Runnable

public class FTPdAsService
extends java.lang.Thread
implements com.kcmultimedia.jvmi2.SCMEventListener

Class used by jvmi2 wrapper. Jvmi2 is helpfull for starting java programs as services on Windows OS. It implements the required event handlers to treat start/stop events.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private static java.lang.String[] args
           
private static FTPHandler handler
           
private static boolean running
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FTPdAsService(java.lang.String[] arguments)
          Default Constructor.
 
Method Summary
 void handleSCMEvent(com.kcmultimedia.jvmi2.SCMEvent arg1)
          Event handler, which receives events sent out by Windows.
static boolean isRunning()
          Returns the service running state.
static void main(java.lang.String[] args)
          Main method called by jvmi when service is started.
 void run()
          Starts up the service thread.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

handler

private static FTPHandler handler

running

private static boolean running

args

private static java.lang.String[] args
Constructor Detail

FTPdAsService

public FTPdAsService(java.lang.String[] arguments)
Default Constructor. Takes the command line arguments which were configured when jFTPd was installed as a service using jvmi2. Creation date: (07-Aug-02 16:48:05)

Parameters:
args - java.lang.String[]
Method Detail

handleSCMEvent

public void handleSCMEvent(com.kcmultimedia.jvmi2.SCMEvent arg1)
Event handler, which receives events sent out by Windows. jFTPd has to respond to a "net stop jftpd" and this method handles those kind of events.

Specified by:
handleSCMEvent in interface com.kcmultimedia.jvmi2.SCMEventListener
Parameters:
arg1 - - SCMEvent such as SCMEvent.JS_SERVICE_STOPPED, SCMEvent.JS_SHUTDOWN, SCMEvent.JS_CLOSE and SCMEvent.JS_LOGOFF.

isRunning

public static boolean isRunning()
Returns the service running state.


main

public static void main(java.lang.String[] args)
Main method called by jvmi when service is started. It starts up the this service thread.

Parameters:
args - - Takes the command line arguments which were configured when jFTPd was installed as a service using jvmi2.

run

public void run()
Starts up the service thread. Creation date: (07-Aug-02 16:42:01)

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread