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, interrupt
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.dellroad.jct.core.ConsoleSession
execute, getRequest, interrupt
Methods 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:ConsoleSession
Get the owner, i.e., the console component that created this session.- Specified by:
getOwner
in interfaceConsoleSession<Exec,
ExecRequest> - Overrides:
getOwner
in classAbstractConsoleSession<Exec,
ExecRequest> - Returns:
- owning component
-
doExecute
Execute this instance'scommand
in the context of this session.The implementation in
SimpleExec.Session
just invokesSimpleCommandSupport.FoundCommand.execute(org.dellroad.jct.core.ConsoleSession<?, ?>)
. Subclasses can override this method to intercept/wrap individual command execution.- Specified by:
doExecute
in classAbstractConsoleSession<Exec,
ExecRequest> - Returns:
- command return value
- Throws:
InterruptedException
- if the current thread is interrupted
-