com.roeschter.jsl
Class SimpleService

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--com.roeschter.jsl.SimpleService
All Implemented Interfaces:
java.lang.Runnable, Stopable

class SimpleService
extends java.lang.Thread
implements Stopable

A simple example for a java service.


Field Summary
(package private) static boolean stop
           
 
Fields inherited from class java.lang.Thread
contextClassLoader, daemon, eetop, group, inheritableThreadLocals, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadLocals, threadQ
 
Constructor Summary
(package private) 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, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, run, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, start, stop, stop, stop0, suspend, suspend0, toString, yield
 
Methods inherited from class java.lang.Object
clone, 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.