/cc @fredericBregier 
 Let me take care
 @normanmaurer Sorry to be late again (very busy those last 9 months). I look at your commit, fine for me.
 Fixed by https://github.com/netty/netty/pull/5791
 Thanks guys! I could've sent you a poll request but wasn't sure if this is the right design. 

Allow clients to override userDefinedWritabilityIndex from AbstractTrafficShapingHandler
Hello, 

AbstractTrafficShapingHandler has a package-private method called "userDefinedWritabilityIndex()". If I create two sub-classes of ChannelTrafficShapingHandler (one for throttling on bandwidth and the other for throttling on message size), I cannot make them independent from each other in terms of writability, because they will all have the same index as ChannelTrafficShapingHandler, which cannot be overridden. 

Can we change the access of userDefinedWritabilityIndex() to _protected_ such that it can be overridden by clients? 

Thanks

Michael

handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java handler/src/main/java/io/netty/handler/traffic/GlobalChannelTrafficShapingHandler.java
handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java handler/src/main/java/io/netty/handler/traffic/GlobalChannelTrafficShapingHandler.java
diff --git a/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java b/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java
index 9cff40f0cef..fb4cdce3e22 100644
--- a/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java
+++ b/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java
@@ -145,7 +145,7 @@ void setTrafficCounter(TrafficCounter newTrafficCounter) {
      *              for GlobalChannel TSH it is defined as
      *              {@value #GLOBALCHANNEL_DEFAULT_USER_DEFINED_WRITABILITY_INDEX}.
      */
-    int userDefinedWritabilityIndex() {
+    protected int userDefinedWritabilityIndex() {
         if (this instanceof GlobalChannelTrafficShapingHandler) {
             return GLOBALCHANNEL_DEFAULT_USER_DEFINED_WRITABILITY_INDEX;
         } else if (this instanceof GlobalTrafficShapingHandler) {
diff --git a/handler/src/main/java/io/netty/handler/traffic/GlobalChannelTrafficShapingHandler.java b/handler/src/main/java/io/netty/handler/traffic/GlobalChannelTrafficShapingHandler.java
index 91a68f0a0e0..8b257eb7f05 100644
--- a/handler/src/main/java/io/netty/handler/traffic/GlobalChannelTrafficShapingHandler.java
+++ b/handler/src/main/java/io/netty/handler/traffic/GlobalChannelTrafficShapingHandler.java
@@ -156,7 +156,7 @@ void createGlobalTrafficCounter(ScheduledExecutorService executor) {
     }
 
     @Override
-    int userDefinedWritabilityIndex() {
+    protected int userDefinedWritabilityIndex() {
         return AbstractTrafficShapingHandler.GLOBALCHANNEL_DEFAULT_USER_DEFINED_WRITABILITY_INDEX;
     }
 
