|
JCas v0.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread cas.ConnectionThread
Handles a single connection and waits for assignment.
Nested Class Summary | |
static class |
ConnectionThread.JCasJaasCallbackHandler
The callback handler for JAAS authentication. |
Field Summary | |
protected ConnectionThread.JCasJaasCallbackHandler |
callbackHandler
The callback handler for JAAS authentication. |
protected JCasConfiguration |
configuration
The configuration |
protected long |
maxRequests
max requests |
protected long |
requestCount
Counts the requests |
protected long |
requestStart
Time of request start |
protected boolean |
runThread
Indication if the thread should run. |
protected Socket |
socket
The socket |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
ConnectionThread(JCasConfiguration configuration)
Creates a new instance of ConnectionThread |
Method Summary | |
protected boolean |
checkCookie(JCasSchemeTag scheme,
JCasRequest request,
JCasResponse response)
Checks the cookie if it was given and validates it. |
boolean |
checkRequestTime()
Checks the running time of the current request and aborts it if necessary. |
protected boolean |
doCustomAuth(JCasSchemeTag scheme,
JCasRequest request,
JCasResponse response)
Performs custom authorization. |
protected boolean |
doExtendedAuth(JCasSchemeTag scheme,
JCasRequest request,
JCasResponse response)
Performs extended authorization. |
protected boolean |
doJaas(JCasSchemeTag scheme,
JCasRequest request,
JCasResponse response)
Performs system authorization. |
protected boolean |
doSystemAuth(JCasSchemeTag scheme,
JCasRequest request,
JCasResponse response)
Performs system authorization. |
long |
getRequestCount()
Returns the number of handled requests. |
protected JCasResponse |
handleAdminRequest(JCasAdminRequest request)
Handles the admin request. |
protected void |
handleConnection()
Handles a single connection. |
protected JCasResponse |
handleRequest(JCasRequest request)
Handles the request. |
boolean |
isAvailable()
Returns true if thread does not handle a connection. |
protected void |
logRequest(JCasAdminRequest request,
JCasResponse response)
Logs the admin request. |
protected void |
logRequest(JCasRequest request,
JCasResponse response)
Logs the request. |
void |
propertyChange(PropertyChangeEvent evt)
|
void |
run()
Runs the thread and handles connections. |
protected void |
sendResponse(JCasResponse response,
PrintWriter out)
Sends the response. |
protected void |
setCookieTag(JCasRequest request)
Sets the cookie tag on the request. |
boolean |
setSocket(Socket socket,
boolean stopThread)
Sets the connection socket and starts communicating on that socket. |
protected void |
updateCookie(JCasSchemeTag scheme,
JCasRequest request,
JCasResponse response)
Checks the cookie if it was given and validates it. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected JCasConfiguration configuration
protected Socket socket
protected boolean runThread
protected long requestStart
protected long requestCount
protected long maxRequests
protected ConnectionThread.JCasJaasCallbackHandler callbackHandler
Constructor Detail |
public ConnectionThread(JCasConfiguration configuration)
Method Detail |
public boolean setSocket(Socket socket, boolean stopThread)
socket | stopThread | Effect on thread | return value |
---|---|---|---|
not null | true/false | Thread should handle connection | true if socket was accepted, false if thread is busy of exception if thread already stopped |
null | true | Thread should stop | Always true |
null | false | Internal use: Thread closes connection, update status | Always true |
public boolean isAvailable()
public void run()
run
in interface Runnable
protected void handleConnection()
public long getRequestCount()
protected JCasResponse handleRequest(JCasRequest request)
protected JCasResponse handleAdminRequest(JCasAdminRequest request)
protected void sendResponse(JCasResponse response, PrintWriter out) throws IOException
IOException
protected boolean checkCookie(JCasSchemeTag scheme, JCasRequest request, JCasResponse response)
protected void updateCookie(JCasSchemeTag scheme, JCasRequest request, JCasResponse response)
protected void setCookieTag(JCasRequest request)
protected boolean doSystemAuth(JCasSchemeTag scheme, JCasRequest request, JCasResponse response)
protected boolean doCustomAuth(JCasSchemeTag scheme, JCasRequest request, JCasResponse response)
protected boolean doExtendedAuth(JCasSchemeTag scheme, JCasRequest request, JCasResponse response)
protected boolean doJaas(JCasSchemeTag scheme, JCasRequest request, JCasResponse response)
protected void logRequest(JCasRequest request, JCasResponse response)
protected void logRequest(JCasAdminRequest request, JCasResponse response)
public boolean checkRequestTime()
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
|
JCas v0.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |