com.microsoft.tfs.core.httpclient
Class ActiveHttpMethods

java.lang.Object
  extended by com.microsoft.tfs.core.httpclient.ActiveHttpMethods

public abstract class ActiveHttpMethods
extends java.lang.Object

Tracks which HttpConnectionss are currently being used inside which monitor objects (for example, a com.microsoft.tfs.util.tasks.TaskMonitor) to facilitate cancellation by some other thread.

Normal usage is like:

  1. Application code begins a command, calls setMonitor(Object)
  2. HttpClient calls setMethod(HttpMethod) before executing some HttpMethod
  3. The method finishes, HttpClient calls clearMethod()
  4. Possibly more methods execute repeating steps 2 and 3
  5. Application code finishes the command, calls clearMonitor()

The following access rules must be followed:

This class is optional for applications, they are not required register monitors at all, but cancellation might not be available if they don't.

Thread-safety:
thread-safe

Constructor Summary
ActiveHttpMethods()
           
 
Method Summary
static void clearMethod()
           
static void clearMonitor()
           
static java.util.Map<java.lang.Object,HttpMethod> getMonitorMethods()
           
static void setMethod(HttpMethod method)
           
static void setMonitor(java.lang.Object mon)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActiveHttpMethods

public ActiveHttpMethods()
Method Detail

setMonitor

public static void setMonitor(java.lang.Object mon)

clearMonitor

public static void clearMonitor()

setMethod

public static void setMethod(HttpMethod method)

clearMethod

public static void clearMethod()

getMonitorMethods

public static java.util.Map<java.lang.Object,HttpMethod> getMonitorMethods()
Returns:
a copy of the monitor to HttpMethod map


© 2015 Microsoft. All rights reserved.