Bug 60761

Summary: Unable to re-use/extend NioEndpoint
Product: Tomcat 8 Reporter: Amit Pande <amit.pande>
Component: ConnectorsAssignee: Tomcat Developers Mailing List <dev>
Severity: enhancement    
Priority: P2    
Version: 8.5.x-trunk   
Target Milestone: ----   
Hardware: All   
OS: All   

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