Class InputStreamConnector
java.lang.Object
java.lang.Thread
com.oracle.bedrock.runtime.remote.windows.winrm.InputStreamConnector
- All Implemented Interfaces:
Closeable,AutoCloseable,Runnable
A
Thread that connects an InputStream to the
stdin stream of an executing command.
Copyright (c) 2015. All Rights Reserved. Oracle Corporation.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
- Author:
- Jonathan Knight
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInputStreamConnector(WindowsSession session, InputStream inputStream) Create anInputStreamConnectorthat listens to the specifiedInputStreamand pipes lines read from it to the stdin stream of the current command. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close thisInputStreamConnectorObtain theInputStreamthis connector pipes to the remote process stdin.Obtain theWindowsSessionrunning the remote process.protected booleanpollForInput(BufferedReader reader) Read a line from the specifiedBufferedReaderand send the data to the stdin stream of the remote process.voidrun()The run loop for thisInputStreamConnector.Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Constructor Details
-
InputStreamConnector
Create anInputStreamConnectorthat listens to the specifiedInputStreamand pipes lines read from it to the stdin stream of the current command.- Parameters:
session- theWindowsSessionrunning the commandinputStream- theInputStreamto pipe to the stdin stream of the command
-
-
Method Details
-
getInputStream
Obtain theInputStreamthis connector pipes to the remote process stdin.- Returns:
- the
InputStreamthis connector pipes to the remote process stdin
-
getSession
Obtain theWindowsSessionrunning the remote process.- Returns:
- the
WindowsSessionrunning the remote process
-
close
Close thisInputStreamConnector- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
run
public void run()The run loop for thisInputStreamConnector. -
pollForInput
Read a line from the specifiedBufferedReaderand send the data to the stdin stream of the remote process.- Parameters:
reader- theBufferedReaderto read a line of data from- Returns:
- true if a line was read or false if EOF was
read from the
BufferedReader.
-