Class CswsConnector.ExecuteMethodThread
- java.lang.Object
-
- java.lang.Thread
-
- org.apache.manifoldcf.crawler.connectors.csws.CswsConnector.ExecuteMethodThread
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- CswsConnector
protected static class CswsConnector.ExecuteMethodThread extends java.lang.ThreadThis thread does the actual socket communication with the server. It's set up so that it can be abandoned at shutdown time. The way it works is as follows: - it starts the transaction - it receives the response, and saves that for the calling class to inspect - it transfers the data part to an input stream provided to the calling class - it shuts the connection down If there is an error, the sequence is aborted, and an exception is recorded for the calling class to examine. The calling class basically accepts the sequence above. It starts the thread, and tries to get a response code. If instead an exception is seen, the exception is thrown up the stack.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanabortThreadprotected java.io.InputStreambodyStreamprotected org.apache.http.client.methods.HttpRequestBaseexecuteMethodprotected java.lang.ThrowablegeneralExceptionprotected org.apache.http.client.HttpClienthttpClientClient and method, all preconfiguredprotected org.apache.http.HttpResponseresponseprotected java.lang.ThrowableresponseExceptionprotected java.lang.ThrowableshutdownExceptionprotected booleanstreamCreatedprotected java.lang.ThrowablestreamExceptionprotected org.apache.manifoldcf.connectorcommon.common.XThreadInputStreamthreadStream
-
Constructor Summary
Constructors Constructor Description ExecuteMethodThread(org.apache.http.client.HttpClient httpClient, org.apache.http.client.methods.HttpRequestBase executeMethod)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabort()protected voidcheckException(java.lang.Throwable exception)voidfinishUp()java.lang.StringgetFirstHeader(java.lang.String headerName)intgetResponseCode()longgetResponseContentLength()java.io.InputStreamgetSafeInputStream()voidrun()-
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
-
-
-
-
Field Detail
-
httpClient
protected final org.apache.http.client.HttpClient httpClient
Client and method, all preconfigured
-
executeMethod
protected final org.apache.http.client.methods.HttpRequestBase executeMethod
-
response
protected org.apache.http.HttpResponse response
-
responseException
protected java.lang.Throwable responseException
-
threadStream
protected org.apache.manifoldcf.connectorcommon.common.XThreadInputStream threadStream
-
bodyStream
protected java.io.InputStream bodyStream
-
streamCreated
protected boolean streamCreated
-
streamException
protected java.lang.Throwable streamException
-
abortThread
protected boolean abortThread
-
shutdownException
protected java.lang.Throwable shutdownException
-
generalException
protected java.lang.Throwable generalException
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.lang.Thread
-
getResponseCode
public int getResponseCode() throws java.lang.InterruptedException, java.io.IOException, org.apache.http.HttpException- Throws:
java.lang.InterruptedExceptionjava.io.IOExceptionorg.apache.http.HttpException
-
getResponseContentLength
public long getResponseContentLength() throws java.lang.InterruptedException, java.io.IOException, org.apache.http.HttpException- Throws:
java.lang.InterruptedExceptionjava.io.IOExceptionorg.apache.http.HttpException
-
getFirstHeader
public java.lang.String getFirstHeader(java.lang.String headerName) throws java.lang.InterruptedException, java.io.IOException, org.apache.http.HttpException- Throws:
java.lang.InterruptedExceptionjava.io.IOExceptionorg.apache.http.HttpException
-
getSafeInputStream
public java.io.InputStream getSafeInputStream() throws java.lang.InterruptedException, java.io.IOException, org.apache.http.HttpException- Throws:
java.lang.InterruptedExceptionjava.io.IOExceptionorg.apache.http.HttpException
-
abort
public void abort()
-
finishUp
public void finishUp() throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
checkException
protected void checkException(java.lang.Throwable exception) throws java.io.IOException, org.apache.http.HttpException- Throws:
java.io.IOExceptionorg.apache.http.HttpException
-
-