Class ArchiveManager
java.lang.Object
org.jivesoftware.openfire.container.BasicModule
org.jivesoftware.openfire.archive.ArchiveManager
- All Implemented Interfaces:
Module
A manager of tasks that write archives into storage.
- Author:
- Guus der Kinderen, guus.der.kinderen@gmail.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SystemProperty<Integer>
The number of threads to keep in the thread pool that writes messages to the database, even if they are idle.static final SystemProperty<Integer>
The maximum number of threads to allow in the thread pool that writes messages to the database.static final SystemProperty<Duration>
The number of threads in the thread pool that writes messages to the database is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new task, that is started immediately.availabilityETAOnLocalNode
(String id, Instant instant) void
destroy()
Destroys the module, by shutting down the thread pool that is being used to process archiving tasks.void
initialize
(XMPPServer server) Initializes the manager, by instantiating a thread pool that is used to process archiving tasks.void
Stops and removes an existing task.void
Stops and removes an exiting task.Methods inherited from class org.jivesoftware.openfire.container.BasicModule
getName, start, stop
-
Field Details
-
EXECUTOR_CORE_POOL_SIZE
The number of threads to keep in the thread pool that writes messages to the database, even if they are idle. -
EXECUTOR_MAX_POOL_SIZE
The maximum number of threads to allow in the thread pool that writes messages to the database. -
EXECUTOR_POOL_KEEP_ALIVE
The number of threads in the thread pool that writes messages to the database is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.
-
-
Constructor Details
-
ArchiveManager
public ArchiveManager()
-
-
Method Details
-
initialize
Initializes the manager, by instantiating a thread pool that is used to process archiving tasks.- Specified by:
initialize
in interfaceModule
- Overrides:
initialize
in classBasicModule
- Parameters:
server
- the server hosting this module.
-
destroy
public void destroy()Destroys the module, by shutting down the thread pool that is being used to process archiving tasks. No new archive tasks will be accepted any longer, although previously scheduled tasks can continue to be processed.- Specified by:
destroy
in interfaceModule
- Overrides:
destroy
in classBasicModule
-
add
Adds a new task, that is started immediately.- Parameters:
archiver
- The task to be added. Cannot be null.
-
remove
Stops and removes an exiting task. No-op when the provided task is not managed by this manager.- Parameters:
archiver
- The task to be added. Cannot be null.
-
remove
Stops and removes an existing task. No-op when the provided task is not managed by this manager.- Parameters:
id
- The identifier of task to be added. Cannot be null.
-
availabilityETAOnLocalNode
-