Class FileEventTracker

  • All Implemented Interfaces:
    Adaptable, Component, Extensible, TimestampedService

    public class FileEventTracker
    extends DefaultComponent
    Files event tracker which delete files once the runtime leave the threads or at least once the associated marker object is garbaged. Note: for being backward compatible you may disable the thread events tracking by black-listing the default configuration component "org.nuxeo.runtime.trackers.files.threadstracking.config" in the runtime. This could be achieved by editing the "blacklist" file in your 'config' directory or using the @{link BlacklistComponent} annotation on your test class.
    Since:
    6.0
    Author:
    Stephane Lacoin at Nuxeo (aka matic)
    See Also:
    ThreadEventHandler
    • Constructor Detail

      • FileEventTracker

        public FileEventTracker()
    • Method Detail

      • registerProtectedPath

        public static void registerProtectedPath​(String path)
        Registers a protected path under which files should not be deleted
        Since:
        7.2
      • activate

        public void activate​(ComponentContext context)
        Description copied from interface: Component
        Activates the component.

        This method is called by the runtime when a component is activated.

        Specified by:
        activate in interface Component
        Overrides:
        activate in class DefaultComponent
        Parameters:
        context - the runtime context
      • getApplicationStartedOrder

        public int getApplicationStartedOrder()
        Description copied from interface: Component
        The component notification order for Component.applicationStarted(org.nuxeo.runtime.model.ComponentContext).

        Components are notified in increasing order. Order 1000 is the default order for components that don't care. Order 100 is the repository initialization.

        Returns:
        the order, 1000 by default
      • deactivate

        public void deactivate​(ComponentContext context)
        Description copied from interface: Component
        Deactivates the component.

        This method is called by the runtime when a component is deactivated.

        Specified by:
        deactivate in interface Component
        Overrides:
        deactivate in class DefaultComponent
        Parameters:
        context - the runtime context
      • setThreadDelegate

        protected void setThreadDelegate​(boolean isLongRunning)
      • getDeleteStrategy

        public static org.nuxeo.runtime.trackers.files.FileEventTracker.SafeFileDeleteStrategy getDeleteStrategy()
        For test purpose.
        Since:
        2023.5
      • getForceDeleteStrategy

        public static org.nuxeo.runtime.trackers.files.FileEventTracker.ForceSafeFileDeleteStrategy getForceDeleteStrategy()
        For test purpose.
        Since:
        2023.5