org.eclipse.webdav.http.client
Class HttpClient.ConnectionsRecycler

java.lang.Object
  extended by java.lang.Thread
      extended by 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 HttpConnections. Connections that remain unused for a given period of time are closed and discarded.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
HttpClient.ConnectionsRecycler(String name)
          Creates a new ConnectionsRecycler with the given name.
 
Method Summary
 void close()
          Closes this connections recycler.
 HttpConnection getConnection(URL originServerUrl)
          Returns an unused connection that is connected to the origin server at the given URL.
 long getConnectionTimeout()
           
 void putConnection(HttpConnection connection)
          Marks the given connection that is in use as unused.
 void run()
           
 void setConnectionTimeout(long connectionTimeout)
           
 
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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpClient.ConnectionsRecycler

public HttpClient.ConnectionsRecycler(String name)
Creates a new ConnectionsRecycler with the given name.

Parameters:
name - the name of the new connections recycler
Method Detail

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.