atg.versionmanager
Class WorkingContext

java.lang.Object
  extended by atg.versionmanager.WorkingContext
All Implemented Interfaces:
atg.versionmanager.Constants

public class WorkingContext
extends java.lang.Object
implements atg.versionmanager.Constants


Nested Class Summary
static class WorkingContext.WorkingContextService
          An instance to use to expose logging and other settings to nucleus.
static class WorkingContext.WorkingContextSnapshot
          An opaque class representing the state of the WorkingContext stack for this thread.
 class WorkingContext.WorkingContextThreadLocalCopier
          A JobThreadLocalValueCopier that copies our ThreadLocal for passing to another thread.
 
Field Summary
static java.lang.String CLASS_VERSION
           
static boolean sDumpStackOnWorkingContextChange
          Whether to dump stack on push/pops/clears.
static boolean sTrackPushers
          Whether we are tracking the stacks of callers who push development lines.
 
Fields inherited from interface atg.versionmanager.Constants
ALL, ASSET_LOCK_TYPE_NAME, BRANCH_TYPE_NAME, CHECKED_IN_PROPERTY, CHECKIN_TIME_PROPERTY, COMMENT_PROPERTY, DATE_CREATED_PROPERTY, DESCRIPTOR_PROPERTY, ERR_ADD_ASSET_NO_WORKING, ERR_ADD_ASSET_WORKSPACE_NOT_EDITABLE, ERR_ADD_ASSET_WS_CHECKED_IN, ERR_ADD_ASSET_WS_DIFFERENT, ERR_ALREADY_CHECKED_IN, ERR_ALREADY_LOCKED, ERR_BRANCH_EXISTS, ERR_CANNOT_REVERT_DELETE_REQUIRED, ERR_CANNOT_REVERT_DELETE_REQUIRED_SINGULAR, ERR_CANNOT_REVERT_FOLDER_NOT_EMPTY, ERR_CANNOT_REVERT_REQUIRED_BY_OTHER_ACTIVE_ASSETS, ERR_CANNOT_REVERT_REQUIRED_BY_OTHER_ACTIVE_ASSETS_SINGULAR, ERR_CANNOT_USE_OPTIMIZED_REPLICATION, ERR_CANT_GET_ASSET_EDIT_LOCK, ERR_CANT_GET_LOCK, ERR_CHECKIN_FAILED, ERR_CHECKOUT_WORKSPACE_NOT_EDITABLE, ERR_COUNT_ALL_ASSET_VERSIONS, ERR_COUNT_ALL_ASSETS, ERR_CREATE_BRANCH, ERR_CREATE_LINE, ERR_CREATE_LINE_NULL_NAME, ERR_CREATE_LINE_SNAPSHOT_FROM_ANOTHER_SNAPSHOT_NOT_ALLOWED, ERR_CREATE_LINE_WORKSPACE_CANNOT_BE_PARENT, ERR_CREATE_LINE_WRAPPER, ERR_CREATE_LINE_WRAPPER_INVALID_TYPE, ERR_CREATE_SNAPSHOT, ERR_CREATE_SNAPSHOT_PARENT_NOT_BRANCH, ERR_CREATE_URI_FAILED, ERR_CREATE_WORKSPACE_FAILED, ERR_DELETE_WORKSPACE_FAILED, ERR_DEV_LINE_IS_NULL, ERR_DIFF_BRANCHES_NOT_EQUAL, ERR_DUPLICATE_REPOSITORY, ERR_FIRE_VER_EVENT, ERR_FIRE_VER_EVENT_SEND, ERR_GET_ITEM_FAILED, ERR_GET_VERSION, ERR_GET_VIRTUAL_FILE_FAILED, ERR_GET_WORKING_ON_CHECKED_IN, ERR_GET_WV_FAILED, ERR_GETREPOSITORYITEM_FAILED, ERR_GETVERSION_FAILED, ERR_GETWORKSPACE_FAILED, ERR_INVALID_VR_PROP, ERR_ITEM_NOT_CONTENT, ERR_LOCK_ALL_CHECKED_IN, ERR_MERGE_FAILED, ERR_MERGE_SAME_BRANCH, ERR_NAME_NOT_NULL, ERR_NOT_REPOSITORY, ERR_NOT_VFS_ITEM, ERR_NULL_BRANCH, ERR_NULL_BRANCH_ID, ERR_NULL_GSR, ERR_NULL_PARENT_BRANCH, ERR_NULL_PARENT_LINE, ERR_NULL_SNAPSHOT_ID, ERR_PURGE_FAILED, ERR_REMOVE_BRANCH, ERR_REMOVE_BRANCH_CHILDREN, ERR_REMOVE_BRANCH_IS_MAIN, ERR_REMOVE_SNAPSHOT_FAILED, ERR_REMOVE_SNAPSHOT_USED_BY_BRANCH, ERR_REP_NOT_IN_VM, ERR_REPOSITORY_METHOD_FAILED, ERR_RESET_FAILED, ERR_REVERT_BRANCHES_MISMATCH, ERR_REVERT_FAILED, ERR_REVERT_OPEN_WORKSPACE, ERR_SET_COMMENT, ERR_SET_VM_UNSUPPORTED, ERR_SNAPSHOT_DIFF_FAILED, ERR_SNAPSHOT_EXISTS, ERR_TRANSACTION_FAILED, ERR_UNABLE_TO_DELETE_CHECKED_IN, ERR_UNABLE_TO_DELETE_NOT_EMPTY, ERR_UNABLE_TO_RESOLVE, ERR_UNLOCK_ALL_CHECKED_IN, ERR_UNLOCK_FAILED, ERR_URI_NULL_VFS_NAME, ERR_URI_WRONG_VM, ERR_VERMAN_START_FAILURE, ERR_VERSION_MISMATCH, ERR_VERSION_NOT_IN_CODELINE, ERR_VM_IS_MISCONFIGURED, ERR_VM_SECURED_REPOSITORY_MISCONFIGURED, ERR_WORKSPACE_ALREADY_LOCKED, ERR_WORKSPACE_EXISTS, ERR_WORKSPACE_NOT_CHECKED_IN, ERR_WS_REVERT_FAILED, FILE_ASSETS, INITIAL_VERSION, IS_EDITABLE_PROPERTY, IS_LOCKED_PROPERTY, LINE_TYPE_NAME, MAIN_BRANCH_NAME, MSG_CANNOT_USE_OPTIMIZED_REPLICATION, MSG_CHECKIN_ALL, MSG_CREATE_ASSET_VERSION, MSG_CREATE_LINE_WRAPPER_TYPE, MSG_CREATE_SNAPSHOT_DIFF, MSG_CREATE_SSDIFF_COUNT, MSG_CREATE_SSDIFF_FOUND, MSG_CREATE_SSDIFF_NO_TYPE, MSG_CREATE_SSDIFF_NONE, MSG_CREATE_SSDIFF_TYPE, MSG_CREATE_WORKSPACE, MSG_CREATED_ASSET, MSG_CREATED_FILE, MSG_DIFF_ADDED, MSG_DIFF_CHANGED, MSG_DIFF_DELETED, MSG_FILE_DELETED, MSG_FILE_ITEM_NOT_VER, MSG_FOUND_VERSION, MSG_GET_ALL_ASSET_VERSIONS, MSG_GET_ASSET_BY_URI, MSG_GET_ASSET_VERSION, MSG_GET_ASSET_VERSION_CREATED, MSG_GET_ASSETS, MSG_GET_ASSETS_BY_TYPE, MSG_GET_CURR_ASSET_VERSIONS, MSG_GET_DEL_ASSET_VERSIONS, MSG_GET_FILE, MSG_GET_FILE_SUCCESS, MSG_GET_FOUND_ITEM, MSG_GET_GENERAL_CASE, MSG_GET_ITEM, MSG_GET_ITEM_SUCCESS, MSG_GET_LINE, MSG_GET_LINE_BY_NAME, MSG_GET_LINE_WRAPPER, MSG_GET_PROCESS_VFS, MSG_GET_REP_LOOP, MSG_GET_VER_REP, MSG_GET_VFS_LOOP, MSG_GET_VVFS, MSG_GET_WORKING_VERSION, MSG_GET_WORKING_VERSIONS_STATUS, MSG_HEAD_VER, MSG_INITIALIZING_MAIN, MSG_ITEM_PATH, MSG_LINE_HEAD_VER, MSG_LOCK_ALL_ASSETS, MSG_MERGE_COMMENT, MSG_NEED_SECURE_VERSION_REP, MSG_NO_REPOSITORY, MSG_PARENT_VER, MSG_PROCESSING_DESCRIPTOR, MSG_PROCESSING_VFS, MSG_PROCESSING_VFS_ITEM, MSG_PURGE_BRANCH, MSG_REMOVE_BRANCH, MSG_REMOVE_SNAPSHOT, MSG_REMOVE_SNAPSHOT_REP, MSG_REMOVE_WORKSPACE, MSG_REVERT_COMMENT, MSG_REVERT_TO_WS, MSG_SET_DELETED, MSG_TYPE_NOT_IN_VFS, MSG_UNLOCK_ALL_ASSETS, MSG_URI_IS_DEVLINE, MSG_URI_IS_FILE, MSG_URI_IS_REPITEM, MSG_VFS_NOT_FOUND_FOR_TYPE, MSG_VFS_WITH_ITEM_DESC, MSG_WORKING_VERSION_HISTORY, NAME_PROPERTY, PARENT_PROPERTY, REPOSITORY_ASSETS, REPOSITORY_ID_PROPERTY, REPOSITORY_PROPERTY, SNAPSHOT_TYPE_NAME, USERID_PROPERTY, WORKSPACE_PROPERTY, WORKSPACE_TYPE_NAME
 
Method Summary
static void dumpPushers()
          Dumps pushers for this thread to stdout.
static DevelopmentLine getCurrentDevelopmentLine()
          Get the current line for the this thread.
static WorkingContext.WorkingContextSnapshot getSnapshot()
          Return a snapshot of the state of the working context.
static DevelopmentLine popDevelopmentLine()
          Remove the current line from the stack, make the previous line current, and return the line that was removed.
static void pushDevelopmentLine(DevelopmentLine line)
          Add the given development line to the stack of lines, and make it current in this thread.
static void pushNullDevelopmentLine()
          Add a "null" development line to the stack of lines, and make it current in this thread.
static void reset()
          Clears the state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION

sTrackPushers

public static boolean sTrackPushers
Whether we are tracking the stacks of callers who push development lines. These build up until a clear is called.


sDumpStackOnWorkingContextChange

public static boolean sDumpStackOnWorkingContextChange
Whether to dump stack on push/pops/clears. Only has an effect if loggingDebug is true.

Method Detail

pushDevelopmentLine

public static void pushDevelopmentLine(DevelopmentLine line)
Add the given development line to the stack of lines, and make it current in this thread.

Parameters:
line - the new development line to use

pushNullDevelopmentLine

public static void pushNullDevelopmentLine()
Add a "null" development line to the stack of lines, and make it current in this thread. This can be used to temporarily "clear" the active development line, and a pop will restore the previously active development line.


popDevelopmentLine

public static DevelopmentLine popDevelopmentLine()
Remove the current line from the stack, make the previous line current, and return the line that was removed.

Returns:
the old current line
Throws:
ThreadStateException - if the stack is empty and a VersionManager has not been set.

getCurrentDevelopmentLine

public static DevelopmentLine getCurrentDevelopmentLine()
Get the current line for the this thread. If a development line hasn't been explicitly set, this method will return the main line for the VersionManager.

Returns:
the current line, or main if a line has not been set.

reset

public static void reset()
Clears the state. This should only be used by thread pools which need to reuse this thread.


getSnapshot

public static WorkingContext.WorkingContextSnapshot getSnapshot()
Return a snapshot of the state of the working context. Can be used to later revert the state.


dumpPushers

public static void dumpPushers()
Dumps pushers for this thread to stdout.