From 66f645cd55ef17587c47490434dada8b4d7dab36 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Br=C3=A9gier?=
Date: Fri, 20 Mar 2009 17:52:43 +0000
Subject: [PATCH] Fix doc
---
.../handler/trafficshaping/package-info.java | 67 ++++++++++---------
1 file changed, 35 insertions(+), 32 deletions(-)
diff --git a/src/main/java/org/jboss/netty/handler/trafficshaping/package-info.java b/src/main/java/org/jboss/netty/handler/trafficshaping/package-info.java
index 8691271775..8386f80721 100644
--- a/src/main/java/org/jboss/netty/handler/trafficshaping/package-info.java
+++ b/src/main/java/org/jboss/netty/handler/trafficshaping/package-info.java
@@ -28,21 +28,22 @@
*
* The main goal of this package is to allow to shape the traffic (bandwidth limitation),
* but also to get statistics on how many bytes are read or written. Both functions can
- * be active or inactive (traffic or statistics).
+ * be active or inactive (traffic or statistics).
*
- * Three classes implement this behavior:
+ *
Three classes implement this behavior:
*
- * - ) PerformanceCounter: this class is the kernel of the package. It can be accessed to get some extra information
+ *
- PerformanceCounter: this class is the kernel of the package. It can be accessed to get some extra information
* like the read or write bytes since last check, the read and write bandwidth from last check...
*
- * - ) PerformanceCounterFactory: this class has to be implemented in your code in order to implement (eventually empty)
+ *
- PerformanceCounterFactory: this class has to be implemented in your code in order to implement (eventually empty)
* the accounting method. This class is a Factory for PerformanceCounter which is used in the third class to create the
* necessary PerformanceCounter according to your specifications.
*
- * - ) TrafficShapingHandler: this class is the handler to be inserted in your pipeline. The insertion can be wherever
- * you want, but it must be placed before any MemoryAwareThreadPoolExecutor in your pipeline.
+ * - TrafficShapingHandler: this class is the handler to be inserted in your pipeline. The insertion can be wherever
+ * you want, but it must be placed before any MemoryAwareThreadPoolExecutor in your pipeline.
* It is really recommended
- * to have such a emoryAwareThreadPoolExecutor (either non ordered or OrderedMemoryAwareThreadPoolExecutor) in your pipeline
+ * to have such a MemoryAwareThreadPoolExecutor (either non ordered or OrderedMemoryAwareThreadPoolExecutor
+ * ) in your pipeline
* when you want to use this feature with some real traffic shaping, since it will allow to relax the constraint on
* NioWorker to do other jobs if necessary.
* Instead, if you don't, you can have the following situation: if there are more clients
@@ -53,39 +54,41 @@
* stopping by this handler.
* The method getMessageSize(MessageEvent) has to be implemented to specify what is the size of the object to be read or write
* accordingly to the type of object. In simple case, it can be as simple as a call to getChannelBufferMessageSize(MessageEvent).
+ *
+ *
+ * Standard use could be as follow:
+ *
+ *
+ * - To activate or deactivate the traffic shaping, change the value corresponding to your desire as
+ * [Global or per Channel] [Write or Read] Limitation in byte/s.
+ * PerformanceCounterFactory.NO_LIMIT (-1)
+ * stands for no limitation, so the traffic shaping is deactivate (on what you specified).
+ * You can either change those values with the method changeConfiguration in PerformanceCounterFactory or
+ * directly from the PerformanceCounter method changeConfiguration.
+ *
+ *
+ * - To activate or deactivate the statistics, you can adjust the delay to a low (not less than 200ms
+ * for efficiency reasons) or a high value (let say 24H in ms is huge enough to not get the problem)
+ * or even using PerformanceCounterFactory.NO_STAT (-1)
.
+ * And if you don't want to do anything with this statistics, just implement an empty method for
+ * PerformanceCounterFactory.accounting(PerformanceCounter).
+ * Again this can be changed either from PerformanceCounterFactory or directly in PerformanceCounter.
+ *
+ * - You can also completely deactivate channel or global PerformanceCounter by setting the boolean to false
+ * accordingly to your needs in the PerformanceCounterFactory. It will deactivate the global Monitor. For channels monitor,
+ * it will prevent new monitors to be created (or reversely they will be created for newly connected channels).
*
*
- * Standard use could be as follow:
- *
- * To activate or deactivate the traffic shaping, change the value corresponding to your desire as
- * [Global or per Channel] [Write or Read] Limitation in byte/s.
- * PerformanceCounterFactory.NO_LIMIT (-1)
- * stands for no limitation, so the traffic shaping is deactivate (on what you specified).
- * You can either change those values with the method changeConfiguration in PerformanceCounterFactory or
- * directly from the PerformanceCounter method changeConfiguration.
- *
- *
- * To activate or deactivate the statistics, you can adjust the delay to a low (not less than 200ms
- * for efficiency reasons) or a high value (let say 24H in ms is huge enough to not get the problem)
- * or even using PerformanceCounterFactory.NO_STAT (-1).
- * And if you don't want to do anything with this statistics, just implement an empty method for
- * PerformanceCounterFactory.accounting(PerformanceCounter).
- * Again this can be changed either from PerformanceCounterFactory or directly in PerformanceCounter.
- *
- * You can also completely deactivate channel or global PerformanceCounter by setting the boolean to false
- * accordingly to your needs in the PerformanceCounterFactory. It will deactivate the global Monitor. For channels monitor,
- * it will prevent new monitors to be created (or reversely they will be created for newly connected channels).
- *
- * So in your application you will create your own PerformanceCounterFactory and setting the values to fit your needs.
+ * So in your application you will create your own PerformanceCounterFactory and setting the values to fit your needs.
* MyPerformanceCounterFactory myFactory = new MyPerformanceCounter(...);
* Then you can create your pipeline (using a PipelineFactory since each TrafficShapingHandler must be unique by channel) and adding this handler before
- * your MemoryAwareThreadPoolExecutor:
+ * your MemoryAwareThreadPoolExecutor:
* pipeline.addLast("MyTrafficShaping",new MyTrafficShapingHandler(myFactory));
* ...
- * pipeline.addLast("MemoryExecutor",new ExecutionHandler(memoryAwareThreadPoolExecutor));
+ * pipeline.addLast("MemoryExecutor",new ExecutionHandler(memoryAwareThreadPoolExecutor));
*
* TrafficShapingHandler must be unique by channel but however it is still global due to
- * the PerformanceCounterFactcory that is shared between all handlers across the channels.
+ * the PerformanceCounterFactcory that is shared between all handlers across the channels.
*
*
*