# `org.apache.river.thread` package
Apache River v3.0.0 Release Notes

### Description

The `org.apache.river.thread` package contains various thread-related utility classes and interfaces. These classes and interfaces are not intended for general use, but are used internally by other parts of the Apache River release. Some of these classes and interfaces are exposed via the configuration mechanism.

### Changes since the v2.1.1 release

None

### Changes since the v2.0.1 release

A number of improvements have been made to the `org.apache.river.thread.WakeupManager`. `WakeupManager` instances are used to schedule tasks that need to be run in the future. Many of the services and utilities in the starter kit obtain the required `WakeupManager` instances from their configuration.

The `WakeupManager.ThreadDesc` Class Can Now Be More Usefully Subclassed and Has Been Made More Accessible
  Instances of the ``WakeupManager.ThreadDesc`` class are used by `WakeupManager` to create threads. A `ThreadDesc` can be specified optionally when a `WakeupManager` is created, and/or when a task is scheduled that needs to be run in its own thread. The `ThreadDesc.thread` method has been made public, which gives subclasses of `ThreadDesc` complete control over how threads are created and allows subclasses of `WakeupManager` to invoke the `ThreadDesc.thread` method. Also, public `getGroup`, `isDaemon`, and `getPriority` methods have been added to `ThreadDesc` and the default implementation of `ThreadDesc.thread` has been changed to use them. This work had been assigned issue numbers 5091282 and 6308590.

Protected Factory Method for `WakeupManager.Ticket`s Has Been Added to `WakeupManager`
  When a task is added to a `WakeupManager`, the caller gets a `WakeupManager.Ticket` object than can be used to remove the task if necessary. The protected method, `WakeupManager.newTicket`, has been added so subclasses of `WakeupManager` can create `Ticket` instances. This work had been assigned issue number 6264220.

`WakeupManager` Only Keeps Internal Thread Running When There Are Tasks Pending
  Previous versions of `WakeupManager` always had one running (though often waiting) thread even if there were no pending tasks. This version of `WakeupManager` only creates its internal thread when the first task is enqueued. It will let this thread end, after a configurable timeout, if there are no tasks pending. This work had been assigned issue number 6190278.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.