jhomenet.shell.server.local
Class LocalSession

java.lang.Object
  extended by java.lang.Thread
      extended by jhomenet.shell.server.Session
          extended by jhomenet.shell.server.local.LocalSession
All Implemented Interfaces:
java.lang.Runnable, ConsoleListener

public class LocalSession
extends Session
implements ConsoleListener

Version:
$Revision: 1.7 $ Filename: $Source: /cvsroot/jhomenet/files/src/jhomenet/shell/server/local/LocalSession.java,v $ Description:
Author:
$Author: dhirwinjr $

Nested Class Summary
 
Nested classes/interfaces inherited from class jhomenet.shell.server.Session
Session.Login
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  boolean pauseSession
          Flag used to pause and restart the local session
 
Fields inherited from class jhomenet.shell.server.Session
commandHistory, CURRENT_COMMAND, CURRENT_DIRECTORY, currentCommand, err, in, inCommand, lastCommand, loginStack, myThreadID, out, paramsArray, paramsVector, password, prompt, PROMPT, properties, retArray, server, shutdown, systemInterface, userName, welcomeMessage
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LocalSession(SystemInputStream in, SystemPrintStream out, SystemPrintStream err, Server server)
          Default constructor.
 
Method Summary
 void currentCommandFinished()
          Notifies this session that the current command has completed.
 void exceptionThrown(java.lang.Exception e)
          Notifies this session that exception was thrown when executing a command.
 void login()
          Logs a user into the system.
 void newCommand(ConsoleEvent event)
           
 void sessionEnding()
          Cleans up any resources associated with this session when it terminates.
 
Methods inherited from class jhomenet.shell.server.Session
addToHistory, broadcast, endSession, execute, forceEndSession, getEnvironment, getErrStream, getFromEnvironment, getHistoryNumber, getNextCommand, getOutputStream, getParams, getUserName, inCommand, parseLogin, printHistory, run, stepDownHistory, stepUpHistory, su, updatePrompt
 
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

pauseSession

protected boolean pauseSession
Flag used to pause and restart the local session

Constructor Detail

LocalSession

public LocalSession(SystemInputStream in,
                    SystemPrintStream out,
                    SystemPrintStream err,
                    Server server)
Default constructor.

Parameters:
in -
out -
err -
server -
Method Detail

login

public void login()
           throws java.io.IOException
Description copied from class: Session
Logs a user into the system. This method is responsible for identifying and verifying the user. Typically this is done with a user location and password.

Specified by:
login in class Session
Throws:
java.io.IOException
See Also:
Session.login()

currentCommandFinished

public void currentCommandFinished()
Description copied from class: Session
Notifies this session that the current command has completed. For example, the user types "ls". The command is received and parsed, then the appropriate command is called in the shell. Finally, this session may need to again display the system prompt or perform other session-specific functions. Only call this from a synchronized block!!!

Specified by:
currentCommandFinished in class Session
See Also:
Session.currentCommandFinished()

sessionEnding

public void sessionEnding()
Description copied from class: Session
Cleans up any resources associated with this session when it terminates.

Specified by:
sessionEnding in class Session
See Also:
Session.sessionEnding()

exceptionThrown

public void exceptionThrown(java.lang.Exception e)
Description copied from class: Session
Notifies this session that exception was thrown when executing a command. This method will attempt to notify the user. Any exceptions raised specifically by shell commands should try to give as descriptive a message to the exception as possible.

Specified by:
exceptionThrown in class Session
Parameters:
e - the exception thrown
See Also:
Session.exceptionThrown(java.lang.Exception)

newCommand

public void newCommand(ConsoleEvent event)
Specified by:
newCommand in interface ConsoleListener


Copyright © 2004-2005 David Irwin. All Rights Reserved.