net.jetrix.listeners
Class ShutdownListener

java.lang.Object
  extended by net.jetrix.services.AbstractService
      extended by net.jetrix.listeners.ShutdownListener
All Implemented Interfaces:
Runnable, Listener, Service

public class ShutdownListener
extends AbstractService
implements Listener

Listens for shutdown commands from the localhost. This is used to stop the server from the shell on Unix.

Version:
$Revision: 786 $, $Date: 2009-02-13 12:11:50 +0100 (Fri, 13 Feb 2009) $
Author:
Emmanuel Bourg

Field Summary
 
Fields inherited from class net.jetrix.services.AbstractService
autoStart, log
 
Constructor Summary
ShutdownListener()
           
 
Method Summary
 String getName()
          Return the name of the listener.
 int getPort()
          Return the listening port.
 boolean isRunning()
          Tell if the service is currently running.
 void run()
           
 void setPort(int port)
          Set the port used the next time the listener is started.
 void start()
          Start the listener.
 void stop()
          Stop the listener.
 
Methods inherited from class net.jetrix.services.AbstractService
isAutoStart, setAutoStart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.jetrix.Service
isAutoStart, setAutoStart
 

Constructor Detail

ShutdownListener

public ShutdownListener()
Method Detail

getName

public String getName()
Description copied from interface: Listener
Return the name of the listener.

Specified by:
getName in interface Listener
Specified by:
getName in interface Service

getPort

public int getPort()
Description copied from interface: Listener
Return the listening port.

Specified by:
getPort in interface Listener

setPort

public void setPort(int port)
Description copied from interface: Listener
Set the port used the next time the listener is started.

Specified by:
setPort in interface Listener

start

public void start()
Description copied from interface: Listener
Start the listener.

Specified by:
start in interface Listener
Specified by:
start in interface Service

stop

public void stop()
Description copied from interface: Listener
Stop the listener.

Specified by:
stop in interface Listener
Specified by:
stop in interface Service

run

public void run()
Specified by:
run in interface Runnable

isRunning

public boolean isRunning()
Description copied from interface: Service
Tell if the service is currently running.

Specified by:
isRunning in interface Service


Copyright © 2001-2010. All Rights Reserved.