|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SK.gnome.dwarf.GenericService SK.gnome.dwarf.thread.ThreadService SK.gnome.dwarf.main.Command SK.gnome.dwarf.main.cmd.ShutdownCmd
Shuts down the main server.
This command shuts down the main server by invoking the Main.shutdown(true) method in a new thread.
The setDelay
method can be used for delayed shutdown (which
is default).
Field Summary | |
protected int |
delay
The shutdown delay. |
Fields inherited from class SK.gnome.dwarf.thread.ThreadService |
daemon, thread |
Fields inherited from class SK.gnome.dwarf.GenericService |
initParameters, parent |
Fields inherited from interface SK.gnome.dwarf.Service |
INITIALIZED, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN, LOG_XFER, SHUTDOWN, STARTED, STOPPED |
Constructor Summary | |
ShutdownCmd(java.lang.String name)
Creates a new ShutdownCmd. |
Method Summary | |
protected void |
execute(javax.security.auth.Subject subject,
Service service,
java.lang.String[] args,
java.io.Writer out)
Executes the command. |
java.lang.String |
getDescription()
Returns the command description. |
void |
printHelp(java.io.PrintWriter out)
Prints the command help. |
void |
setDelay(int value)
Sets the shutdown delay time. |
Methods inherited from class SK.gnome.dwarf.thread.ThreadService |
enableThread, finish, loop, run, setDaemon, shutdown, start, stop |
Methods inherited from class SK.gnome.dwarf.GenericService |
getAuthenticator, getAuthFacility, getFullName, getInitParameter, getInitParameterNames, getLogFacility, getLogger, getName, getParameters, getPrincipal, getShutdownTimeout, getState, init, log, log, login, logout, setAuthFacility, setInitParameters, setLogFacility, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int delay
The value in seconds specifies how long should the command wait before it really calls the shutdown method of the main server. Delay is suitable in the case that this command is invoked remotely and it takes some time to send the command output to the user through a slow network connection.
Default value: 5 seconds.
Constructor Detail |
public ShutdownCmd(java.lang.String name)
Method Detail |
public void setDelay(int value)
value
- the delay time in secondsdelay
public java.lang.String getDescription()
Command
It should return a short one-line command description.
getDescription
in class Command
public void printHelp(java.io.PrintWriter out)
Command
By default it prints the string returned from the Command.getDescription()
method.
It may be overriden to provide more detailed help on the command usage.
printHelp
in class Command
out
- the output Writerprotected void execute(javax.security.auth.Subject subject, Service service, java.lang.String[] args, java.io.Writer out) throws CommandException
Command
Executes the command action. This method is called by the console's
Console.execute(Subject, String, Writer)
method. The service parameter
contains a reference to the current working service of the subject executing the
command. Command arguments are passed in via the string array args and the command
output is redirected to the out stream. The command should throw a
CommandException
in the case of an error.
execute
in class Command
subject
- the subject executing the commandservice
- the current working serviceargs
- the command argumentsout
- the output stream
CommandException
- if the command fails for any reason
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |