Package org.nuxeo.runtime.trackers.files
Class FileEventTracker
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.runtime.trackers.files.FileEventTracker
- All Implemented Interfaces:
Adaptable,Component,Extensible,TimestampedService
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classstatic classprotected static classprotected class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static org.nuxeo.runtime.trackers.files.FileEventTracker.SafeFileDeleteStrategyprotected final FileEventListenerprotected static org.nuxeo.runtime.trackers.files.FileEventTracker.ForceSafeFileDeleteStrategyprotected final FileEventTracker.GCDelegateprotected final ThreadLocal<FileEventTracker.ThreadDelegate>protected final ThreadEventListenerFields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(ComponentContext context) Activates the component.voiddeactivate(ComponentContext context) Deactivates the component.intThe component notification order forComponent.start(ComponentContext).static org.nuxeo.runtime.trackers.files.FileEventTracker.SafeFileDeleteStrategyFor test purpose.static org.nuxeo.runtime.trackers.files.FileEventTracker.ForceSafeFileDeleteStrategyFor test purpose.protected FileEventHandlervoidregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) static voidregisterProtectedPath(String path) Registers a protected path under which files should not be deletedprotected voidprotected voidsetThreadDelegate(boolean isLongRunning) voidstart(ComponentContext context) Start the component.Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
addRuntimeMessage, addRuntimeMessage, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, stop, unregister, unregisterContribution, unregisterExtension
-
Field Details
-
deleteStrategy
protected static org.nuxeo.runtime.trackers.files.FileEventTracker.SafeFileDeleteStrategy deleteStrategy -
forceDeleteStrategy
protected static org.nuxeo.runtime.trackers.files.FileEventTracker.ForceSafeFileDeleteStrategy forceDeleteStrategy -
gc
-
threads
-
threadsListener
-
filesListener
-
-
Constructor Details
-
FileEventTracker
public FileEventTracker()
-
-
Method Details
-
registerProtectedPath
Registers a protected path under which files should not be deleted- Since:
- 7.2
-
activate
Description copied from interface:ComponentActivates the component.This method is called by the runtime when a component is activated.
- Specified by:
activatein interfaceComponent- Overrides:
activatein classDefaultComponent- Parameters:
context- the runtime context
-
getApplicationStartedOrder
public int getApplicationStartedOrder()Description copied from interface:ComponentThe component notification order forComponent.start(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
-
start
Description copied from interface:ComponentStart the component. This method is called after all the components were resolved and activated- Specified by:
startin interfaceComponent- Overrides:
startin classDefaultComponent
-
deactivate
Description copied from interface:ComponentDeactivates the component.This method is called by the runtime when a component is deactivated.
- Specified by:
deactivatein interfaceComponent- Overrides:
deactivatein classDefaultComponent- Parameters:
context- the runtime context
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) - Overrides:
registerContributionin classDefaultComponent
-
onContext
-
setThreadDelegate
protected void setThreadDelegate(boolean isLongRunning) -
resetThreadDelegate
- Throws:
IllegalStateException
-
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
-