Class ExecutionContext


  • public class ExecutionContext
    extends Object
    Provides the Execution Context utility.
    • Field Detail

      • QUERY_PROFILING_DETAIL

        public static final String QUERY_PROFILING_DETAIL
        The Query Profiling Detail JVM argument key.
        See Also:
        Constant Field Values
      • QUERY_PROFILING_THRESHOLD

        public static final String QUERY_PROFILING_THRESHOLD
        The Query Profiling Warning Threshold JVM argument key.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ExecutionContext

        public ExecutionContext()
    • Method Detail

      • setThreadExecutionContext

        public static void setThreadExecutionContext​(ExecutionContext executionContext)
        Sets the thread execution context.
        Parameters:
        executionContext - the new thread execution context
      • getThreadExecutionContext

        public static ExecutionContext getThreadExecutionContext()
        Returns the thread execution context.
        Returns:
        the thread execution context
      • isCachingEnabled

        public boolean isCachingEnabled()
        Returns:
        the cachingEnabled
      • setCachingEnabled

        public void setCachingEnabled​(boolean cachingEnabled)
        Parameters:
        cachingEnabled - the cachingEnabled to set
      • isAuditingEnabled

        public boolean isAuditingEnabled()
        Returns:
        the auditingEnabled
      • setAuditingEnabled

        public void setAuditingEnabled​(boolean auditingEnabled)
        Parameters:
        auditingEnabled - the auditingEnabled to set
      • isQueryCacheEnabled

        public boolean isQueryCacheEnabled()
        Returns:
        the queryCacheEnabled
        Since:
        4.2.0
      • setQueryCacheEnabled

        public void setQueryCacheEnabled​(boolean queryCacheEnabled)
        Parameters:
        queryCacheEnabled - the queryCacheEnabled to set
        Since:
        4.2.0
      • setQueryProfilingEnable

        public void setQueryProfilingEnable​(boolean queryProfilingEnabled)
        Set queryProfilingEnabled.
        Parameters:
        queryProfilingEnabled - set queryProfilingEnabled
        Since:
        4.2.0
      • isQueryProfilingEnabled

        public boolean isQueryProfilingEnabled()
        Return true if query profiling is enabled.
        Returns:
        true if query profiling is enabled
        Since:
        4.2.0
      • setQueryProfilingWarningThreshold

        public void setQueryProfilingWarningThreshold​(Long value)
        Set the query execution warning threshold in milliseconds.
        Parameters:
        value - the query execution warning threshold in milliseconds
        Since:
        4.3.0
      • getQueryProfilingWarningThreshold

        public Long getQueryProfilingWarningThreshold()
        Return the query execution warning threshold in milliseconds.
        Returns:
        the query execution warning threshold in milliseconds
        Since:
        4.3.0
      • addQueryInfo

        public com.avoka.core.cayenne.ExecutionContext.QueryInfo addQueryInfo​(String sql,
                                                                              long time)
        Record the query info.
        Parameters:
        sql - the SQL query performed
        time - the time in ms to execute the query
        Returns:
        the new QueryInfo object
        Since:
        4.2.0
      • getQueryInfoDump

        public String getQueryInfoDump​(boolean showDetails)
        Return the query info profiling dump.
        Parameters:
        showDetails - display SQL call details
        Returns:
        the query info profiling dump.
        Since:
        4.2.0
      • getQueryCacheMap

        public Map<String,​BaseEntity> getQueryCacheMap()
        Return the query cache map.
        Returns:
        the query cache map.
        Since:
        4.2.0