Package aQute.remote.agent
Class ConsoleRedirector
java.lang.Object
aQute.remote.agent.ConsoleRedirector
- All Implemented Interfaces:
Redirector,Closeable,AutoCloseable
The Console Redirector redirects System.in, System.out, and System.err to the
supervisor. This is of course quite tricky. We have to replace System.*
fields and this can only be done if the security allows it. It also requires
that if we have multiple agents we need to share the redirecting.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ConsoleRedirector
Constructor.- Parameters:
agent- the agent we're redirecting for- Throws:
IOException
-
-
Method Details
-
close
Clean up- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getPort
public int getPort()Description copied from interface:RedirectorThe port (or pseudo port) this one is connected to- Specified by:
getPortin interfaceRedirector- Returns:
- the port
-
stdin
Description copied from interface:RedirectorProvide input- Specified by:
stdinin interfaceRedirector- Parameters:
s- the input- Throws:
IOException
-
getOut
Description copied from interface:RedirectorGet the output stream- Specified by:
getOutin interfaceRedirector
-