Class TracerFactory

    • Field Detail

      • DEFAULT

        public static final TracerFactory DEFAULT
        Defines the default tracer.
      • TEMPLATELANG_TRACERS

        public static final java.util.Map<java.lang.Thread,​ITracer> TEMPLATELANG_TRACERS
      • BUILDLANG_TRACERS

        public static final java.util.Map<java.lang.Thread,​ITracer> BUILDLANG_TRACERS
      • instances

        private static java.util.Map<java.lang.Long,​TracerFactory> instances
    • Constructor Detail

      • TracerFactory

        public TracerFactory()
    • Method Detail

      • getDefaultInstance

        public static TracerFactory getDefaultInstance()
        Returns the default instance.
        Returns:
        the default instance
      • setDefaultInstance

        public static void setDefaultInstance​(TracerFactory factory)
        Defines the default instance.
        Parameters:
        factory - the new default instance (ignored if null)
      • setInstance

        public static void setInstance​(TracerFactory newInstance)
        Defines a new tracer factory for the current thread.
        Parameters:
        newInstance - the new tracer factory (null deletes a previously defined instance)
      • getInstance

        public static TracerFactory getInstance()
        Returns the tracer factory for the current thread.
        Returns:
        the current tracer factory, if there is none defined return defaultFactory
      • setTraceFilter

        public static ITraceFilter setTraceFilter​(ITraceFilter fInstance)
        Defines the trace filter to applied on all created tracers.
        Parameters:
        fInstance - the new trace filter, ignored if null
        Returns:
        the filter before this call, may be null
      • getTraceFilter

        public static ITraceFilter getTraceFilter()
      • createTemplateLanguageTracerImpl

        public abstract ITracer createTemplateLanguageTracerImpl()
        Creates a tracer for the VIL template language.
        Returns:
        a tracer instance for the VIL template language (null will lead to the corresponding result by DEFAULT)
      • createBuildLanguageTracerImpl

        public abstract ITracer createBuildLanguageTracerImpl()
        Creates a tracer for the VIL build language.
        Returns:
        a tracer instance for the VIL build language (null will lead to the corresponding result by DEFAULT)
      • createInstantiatorTracerImpl

        public abstract IInstantiatorTracer createInstantiatorTracerImpl()
        Creates a tracer for instantiators, i.e., to send messages to the VIL output.
        Returns:
        the instantiator tracer
      • createTemplateLanguageTracer

        public static ITracer createTemplateLanguageTracer()
        Creates a tracer for the VIL template language.
        Returns:
        a tracer instance for the VIL template language
      • createBuildLanguageTracer

        public static ITracer createBuildLanguageTracer()
        Creates a tracer for the VIL build language.
        Returns:
        a tracer instance for the VIL build language
      • createInstantiatorTracer

        public static IInstantiatorTracer createInstantiatorTracer()
        Creates a tracer for instantiators.
        Returns:
        a tracer for instantiators
      • getRegisteredBuildLanguageTracer

        public static ITracer getRegisteredBuildLanguageTracer()
        Returns the currently registered build language tracer for the current thread.
        Returns:
        the currently registered build language tracer or null if there is none
      • getRegisteredTemplateLanguageTracer

        public static ITracer getRegisteredTemplateLanguageTracer()
        Returns the currently registered template language tracer for the current thread.
        Returns:
        the currently registered template language tracer or null if there is none
      • progress

        public static void progress​(int actual,
                                    int max,
                                    java.lang.String description)
        Notifies the tracer about the actual progress in order to inform the user.
        Parameters:
        actual - the actual step (negative disables display)
        max - the maximum number of steps (may vary over time, negative disables display)
        description - an optional description of the step (may be null)
      • progressSubTask

        public static void progressSubTask​(int actual,
                                           int max,
                                           java.lang.String taskName)
        Notifies about creation/progress of a subtask (just grabbing the actual task in all registered observers).
        Parameters:
        actual - the actual number of steps in the sub task
        max - the maximum number of steps
        taskName - the name of the sub task
      • ensureTasks

        public static void ensureTasks​(java.lang.String description)
        Ensures that there is a task with the given description on all registered observers. Existing tasks will be kept.
        Parameters:
        description - the task description
      • closeTasks

        public static void closeTasks​(java.lang.String description)
        Closes existing tasks with the given description on all registered observers. Closed tasks will be set to null on the respective observers.
        Parameters:
        description - the description to look for
      • registerProgressObserver

        public static void registerProgressObserver​(ProgressObserver observer)
        Registers the given progress reserver.
        Parameters:
        observer - the observer (ignored if null)
      • unregisterProgressObserver

        public static void unregisterProgressObserver​(ProgressObserver observer)
        Unregisters the given progress observer.
        Parameters:
        observer - the progress observer (ignored if null)