Bug 60761 - Unable to re-use/extend NioEndpoint
Summary: Unable to re-use/extend NioEndpoint
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Connectors (show other bugs)
Version: 8.5.x-trunk
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2017-02-21 20:28 UTC by Amit Pande
Modified: 2017-03-06 12:49 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Amit Pande 2017-02-21 20:28:37 UTC
We plan to extend/re-use the NioEndpoint of Tomcat 8.5.x and override the following methods:

1. Bind
2. Unbind
3. UnlockAccept
4. Acceptor

Intend to use most of the NIO code for poller threads and other start stop logic. One issue faced was that “stopLatch” is not accessible outside the NioEndpoint class. This stopLatch is initialized during “bind” and used during “stop”. But since we override bind and don’t have access to “stopLatch”we’re facing issues while using the default NioEndpoint implementation.

Could this field protected similar to other fields such as pollerThreadCount, acceptorThreadCount?

Reflection seems too hack-ish and we don’t see any issues with making this field protected instead of private.
Comment 1 Amit Pande 2017-03-02 22:35:44 UTC
Any guidance on this?
Comment 2 Mark Thomas 2017-03-06 12:49:38 UTC
Fixed in:
- trunk for 9.0.0.M18 onwards
- 8.5.x for 8.5.12 onwards