|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectTimerBasedFlushPolicy
com.nexaweb.server.pushconnection.flushpolicies.ThroughputFlushPolicy
The throughput flush policy is used to flush when it detects lulls in network traffic over a persistent connection.
This policy will perform its action when the throughput on the connection falls below a specified level for a specified period. This is similar to the Idle Connection Policy With Activity Threshold in that it operates on the assumption that it doesn't need to do anything if there is enough content flowing naturally to keep things moving through the proxy server's internal IO buffer.
This policy is used when the application has relatively continuous activity (or bursts of activity) but with varying message sizes. The throughput policy ensures that if enough content is flowing to ensure movement through the proxy's internal IO buffer no action is taken, but otherwise take action at the end of the specified sample period.
Example Configurations
<policy>
<rules>
<match xpath="starts-with(/client-info/java-version, '1.4')" />
<match xpath="starts-with(/client-info/java-vendor, 'Sun')" />
<match xpath="contains(/client-info/user-agent, 'MSIE 6')" />
<match address="127.0.0.*" />
</rules>
<configuration class="com.nexaweb.server.pushconnection.flushpolicies.ThroughputFlushPolicy">
<flush-size>8 K</flush-size>
<measurement-period>10 sec.</measurement-period>
<minimum-throughput>4 K</minimum-throughput>
</configuration>
</policy>
<policy>
<rules>
<match xpath="starts-with(/client-info/java-version, '1.4')" />
<match xpath="starts-with(/client-info/java-vendor, 'Sun')" />
<match xpath="contains(/client-info/user-agent, 'MSIE 6')" />
<match address="127.0.0.1" />
</rules>
<configuration class="com.nexaweb.server.pushconnection.flushpolicies.ThroughputFlushPolicy">
<is-stream-closed-on-flush>true</is-stream-closed-on-flush>
<measurement-period>10 sec.</measurement-period>
<minimum-throughput>4 K</minimum-throughput>
</configuration>
</policy>
| Constructor Summary | |
ThroughputFlushPolicy()
This constructor is only for use by Nexaweb internally. |
|
ThroughputFlushPolicy(int minimumThroughput,
int flushSize,
long samplePeriod)
Constructs a ThroughputFlushPolicy with the specified minimumThroughput, flushSize and samplePeriod. |
|
ThroughputFlushPolicy(int minimumThroughput,
long samplePeriod)
Constructs a ThroughputFlushPolicy with the specified minimumThroughput and samplePeriod which will return true from the isFlushMechanismStreamClose() method. |
|
| Method Summary | |
void |
configure(Element policy)
|
int |
getFlushSizeInBytes()
|
boolean |
isStreamClosedOnFlush()
|
void |
onMessageSend(Flushable flushable,
byte[] content)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ThroughputFlushPolicy()
ThroughputFlushPolicy(int, int, long) or
ThroughputFlushPolicy(int, long).
public ThroughputFlushPolicy(int minimumThroughput,
int flushSize,
long samplePeriod)
minimumThroughput - The minimum number of bytes that must travel
across the push connection over the period to avoid a flush.flushSize - The size of the flush that will be used when flushing.samplePeriod - The interval over which the throughput will be
measured.
public ThroughputFlushPolicy(int minimumThroughput,
long samplePeriod)
minimumThroughput - The minimum number of bytes that must travel
across the push connection over the period to avoid a flush.samplePeriod - The interval over which the throughput will be
measured.| Method Detail |
public void configure(Element policy)
throws ConfigurationException
ConfigurationExceptionConfigurableFlushPolicy.configure(Element)public int getFlushSizeInBytes()
FlushPolicy.getFlushSizeInBytes()public boolean isStreamClosedOnFlush()
FlushPolicy.isStreamClosedOnFlush()
public void onMessageSend(Flushable flushable,
byte[] content)
throws java.io.IOException
java.io.IOExceptionFlushPolicy.onMessageSend(Flushable,byte[])
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||