com.microsoft.tfs.core.clients.versioncontrol.events
Class EventSource

java.lang.Object
  extended by com.microsoft.tfs.core.clients.versioncontrol.events.EventSource

public class EventSource
extends java.lang.Object

An EventSource instance accompanies each event fired by VersionControlEventEngine, and can be used by the code that handles the event to know things about where the event originated (originating thread, etc.).

Since:
TEE-SDK-10.1
Thread-safety:
immutable

Constructor Summary
EventSource(java.lang.Thread originatingThread)
          Creates an EventSource describing the events and state that preceded the event's happening.
 
Method Summary
 java.lang.Thread getOriginatingThread()
          Gets the originating thread.
static EventSource newFromHere()
          Creates a new EventSource describing an event source using the current thread and any other information gathered from the current context of execution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventSource

public EventSource(java.lang.Thread originatingThread)
Creates an EventSource describing the events and state that preceded the event's happening. Each property of the event can be defined by the caller.

If you want an EventSource whose originating thread is the current thread, simply use newFromHere().

Parameters:
originatingThread - the thread that originally made the call to the method that is documented to fire the event that this source describes (not null).
See Also:
newFromHere()
Method Detail

newFromHere

public static EventSource newFromHere()
Creates a new EventSource describing an event source using the current thread and any other information gathered from the current context of execution. Code in core that fires events from the same thread that the caller called into core from can use this method as a shortcut for constructing EventSource objects.

Returns:
a new EventSource initialized from the current execution context (thread, etc.).

getOriginatingThread

public java.lang.Thread getOriginatingThread()
Gets the originating thread.

Returns:
the thread that originally made the call to the method that is documented to fire the event that this source describes.


© 2015 Microsoft. All rights reserved.