org.eclipse.webdav.http.client
Class HttpClient.ConnectionsRecycler
java.lang.Object
java.lang.Thread
org.eclipse.webdav.http.client.HttpClient.ConnectionsRecycler
- All Implemented Interfaces:
- Runnable
- Enclosing class:
- HttpClient
public class HttpClient.ConnectionsRecycler
- extends Thread
The ConnectionsRecycler
manages a collection of
persistent HttpConnection
s. Connections that remain
unused for a given period of time are closed and discarded.
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
HttpClient.ConnectionsRecycler
public HttpClient.ConnectionsRecycler(String name)
- Creates a new
ConnectionsRecycler
with the given
name.
- Parameters:
name
- the name of the new connections recycler
close
public void close()
- Closes this connections recycler. All of its connections are
closed and discarded.
getConnection
public HttpConnection getConnection(URL originServerUrl)
- Returns an unused connection that is connected to the origin
server at the given
URL
. The connection is marked
as in use before it is returned.
- Parameters:
originServerUrl
- the URL
of an origin
server
- Returns:
- an unused connection that is connected to the origin
server at the given
URL
- See Also:
putConnection(HttpConnection)
getConnectionTimeout
public long getConnectionTimeout()
putConnection
public void putConnection(HttpConnection connection)
- Marks the given connection that is in use as unused.
- Parameters:
connection
- a connection that is in use- See Also:
getConnection(URL)
run
public void run()
- Specified by:
run
in interface Runnable
- Overrides:
run
in class Thread
setConnectionTimeout
public void setConnectionTimeout(long connectionTimeout)
Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.