Package org.dellroad.jct.core.simple
Class SimpleExec.Session
java.lang.Object
org.dellroad.jct.core.AbstractConsoleSession<Exec,ExecRequest>
org.dellroad.jct.core.AbstractExecSession
org.dellroad.jct.core.simple.SimpleExec.Session
- All Implemented Interfaces:
ConsoleSession<Exec,,ExecRequest> ExecSession
- Enclosing class:
- SimpleExec
Default
ExecSession implementation used by SimpleExec.-
Field Summary
FieldsFields inherited from class org.dellroad.jct.core.AbstractConsoleSession
owner, request -
Constructor Summary
ConstructorsConstructorDescriptionSession(SimpleExec exec, ExecRequest request, SimpleCommandSupport.FoundCommand command) Constructor. -
Method Summary
Methods inherited from class org.dellroad.jct.core.AbstractConsoleSession
doInterrupt, execute, getRequest, interruptMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.dellroad.jct.core.ConsoleSession
execute, getRequest, interruptMethods inherited from interface org.dellroad.jct.core.ExecSession
getErrorStream, getInputStream, getOutputStream
-
Field Details
-
command
-
-
Constructor Details
-
Session
public Session(SimpleExec exec, ExecRequest request, SimpleCommandSupport.FoundCommand command) throws IOException Constructor.- Parameters:
exec- session ownerrequest- command execution requestcommand- the command to execute- Throws:
IOException- if an I/O error occursIllegalArgumentException- if any parameter is null
-
-
Method Details
-
getOwner
Description copied from interface:ConsoleSessionGet the owner, i.e., the console component that created this session.- Specified by:
getOwnerin interfaceConsoleSession<Exec,ExecRequest> - Overrides:
getOwnerin classAbstractConsoleSession<Exec,ExecRequest> - Returns:
- owning component
-
doExecute
Execute this instance'scommandin the context of this session.The implementation in
SimpleExec.Sessionjust invokesSimpleCommandSupport.FoundCommand.execute(org.dellroad.jct.core.ConsoleSession<?, ?>). Subclasses can override this method to intercept/wrap individual command execution.- Specified by:
doExecutein classAbstractConsoleSession<Exec,ExecRequest> - Returns:
- command return value
- Throws:
InterruptedException- if the current thread is interrupted
-