com.roeschter.jsl
Class SimpleService

java.lang.Object
  extended by java.lang.Thread
      extended by com.roeschter.jsl.SimpleService
All Implemented Interfaces:
Stopable, java.lang.Runnable

 class SimpleService
extends java.lang.Thread
implements Stopable

A simple example for a java service.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
(package private) static boolean stop
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SimpleService()
           
 
Method Summary
static void main(java.lang.String[] argv)
          The main method called when the service starts.
 void onServiceStop()
          Here the telnet server implements the Stopable interface On exit close the server cocket on port 23
static void stopit()
           
 int timeToWait()
          Don't wait if onServiceStop does not return.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, 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, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

stop

static boolean stop
Constructor Detail

SimpleService

SimpleService()
Method Detail

onServiceStop

public void onServiceStop()
Here the telnet server implements the Stopable interface On exit close the server cocket on port 23

Specified by:
onServiceStop in interface Stopable

timeToWait

public int timeToWait()
Don't wait if onServiceStop does not return. Terminate immediately.

Specified by:
timeToWait in interface Stopable

stopit

public static void stopit()

main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
The main method called when the service starts.

Throws:
java.lang.Exception