class ForkClient
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.io.InputStream |
error |
private java.io.DataInputStream |
input |
private java.io.File |
jar |
private java.lang.ClassLoader |
loader |
private java.io.DataOutputStream |
output |
private java.lang.Process |
process |
private java.util.List<ForkResource> |
resources |
Constructor and Description |
---|
ForkClient(java.lang.ClassLoader loader,
java.lang.Object object,
java.util.List<java.lang.String> java) |
Modifier and Type | Method and Description |
---|---|
java.lang.Throwable |
call(java.lang.String method,
java.lang.Object... args) |
void |
close() |
private void |
consumeErrorStream()
Consumes all pending bytes from the standard error stream of the
forked server process, and prints them out to the standard error
stream of this process.
|
private static java.io.File |
createBootstrapJar()
Creates a temporary jar file that can be used to bootstrap the forked
server process.
|
private static void |
fillBootstrapJar(java.io.File file)
Fills in the jar file used to bootstrap the forked server process.
|
boolean |
ping() |
private void |
sendObject(java.lang.Object object,
java.util.List<ForkResource> resources)
Serializes the object first into an in-memory buffer and then
writes it to the output stream with a preceding size integer.
|
private java.lang.Throwable |
waitForResponse(java.util.List<ForkResource> resources) |
private void |
waitForStartBeacon() |
private final java.util.List<ForkResource> resources
private final java.lang.ClassLoader loader
private final java.io.File jar
private final java.lang.Process process
private final java.io.DataOutputStream output
private final java.io.DataInputStream input
private final java.io.InputStream error
public ForkClient(java.lang.ClassLoader loader, java.lang.Object object, java.util.List<java.lang.String> java) throws java.io.IOException, TikaException
java.io.IOException
TikaException
private void waitForStartBeacon() throws java.io.IOException
java.io.IOException
public boolean ping()
public java.lang.Throwable call(java.lang.String method, java.lang.Object... args) throws java.io.IOException, TikaException
java.io.IOException
TikaException
private void sendObject(java.lang.Object object, java.util.List<ForkResource> resources) throws java.io.IOException, TikaException
object
- object to be serializedresources
- list of fork resources, used when adding proxiesjava.io.IOException
- if the object could not be serializedTikaException
public void close()
private java.lang.Throwable waitForResponse(java.util.List<ForkResource> resources) throws java.io.IOException
java.io.IOException
private void consumeErrorStream() throws java.io.IOException
java.io.IOException
- if the error stream could not be readprivate static java.io.File createBootstrapJar() throws java.io.IOException
java.io.IOException
- if the bootstrap archive could not be createdprivate static void fillBootstrapJar(java.io.File file) throws java.io.IOException
.class
files and a manifest with a
Main-Class
entry are written into the archive.file
- file to hold the bootstrap archivejava.io.IOException
- if the bootstrap archive could not be created