Class TransmittableThreadLocal<T>

    • Constructor Detail

      • TransmittableThreadLocal

        public TransmittableThreadLocal()
    • Method Detail

      • copy

        protected T copy​(T parentValue)
        Computes the value for this transmittable thread-local variable as a function of the source thread's value at the time the task Object is created. This method is called from TtlRunnable or TtlCallable when it create, before the task is started.

        This method merely returns reference of its source thread value, and should be overridden if a different behavior is desired.

        Since:
        1.0.0
      • beforeExecute

        protected void beforeExecute()
        Callback method before task object(TtlRunnable/TtlCallable) execute.

        Default behavior is do nothing, and should be overridden if a different behavior is desired.

        Do not throw any exception, just ignored.

        Since:
        1.2.0
      • afterExecute

        protected void afterExecute()
        Callback method after task object(TtlRunnable/TtlCallable) execute.

        Default behavior is do nothing, and should be overridden if a different behavior is desired.

        Do not throw any exception, just ignored.

        Since:
        1.2.0