|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectTimerBasedFlushPolicy
com.nexaweb.server.pushconnection.flushpolicies.IdlePeriodFlushPolicy
com.nexaweb.server.pushconnection.flushpolicies.IdlePeriodWithSizeThresholdFlushPolicy
This policy is based on the Idle Connection Policy and operates the same way, but has a threshold for indicating what size a passing message must be before it is considered activity. Messages below this threshold may freely flow over the push connection and the connection is still considered idle. This policy is used when your application sends larger messages down the push connection that would push content through the proxy server's internal IO buffer, interspersed with smaller messages that would generally not be big enough to push content through the buffer efficiently. It should be configured such that if there are enough large messages to move content through the proxy server's internal IO buffer in a timely fashion, then no action should be taken. However, if there are only small messages moving across the connection, the stream should be considered idle and action should be taken periodically to flush the buffer.
Example Configuration
<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.IdlePeriodWithSizeThresholdFlushPolicy">
<flush-size>8 K</flush-size>
<period>10 sec.</period>
<message-size-threshold>200 bytes</message-size-threshold>
</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.*" />
</rules>
<configuration class="com.nexaweb.server.pushconnection.flushpolicies.IdlePeriodWithSizeThresholdFlushPolicy">
<is-stream-closed-on-flush>8 K</is-stream-closed-on-flush>
<period>10 sec.</period>
<message-size-threshold>200 bytes</message-size-threshold>
</configuration>
</policy>
| Constructor Summary | |
IdlePeriodWithSizeThresholdFlushPolicy()
This constructor is only for use by Nexaweb internally. |
|
IdlePeriodWithSizeThresholdFlushPolicy(long idlePeriod,
int messageSizeThreshold)
Constructs a IdlePeriodWithSizeThresholdFlushPolicy with the specified idlePeriod and messageSizeThreshold which will return true from the isFlushMechanismStreamClose() method. |
|
IdlePeriodWithSizeThresholdFlushPolicy(long idlePeriod,
int flushSize,
int messageSizeThreshold)
Constructs a IdlePeriodWithSizeThresholdFlushPolicy with the specified idlePeriod, flushSize and messageSizeThreshold. |
|
| Method Summary | |
void |
configure(Element policy)
|
protected boolean |
messageMeetsFlushTaskResetCriteria(Flushable flushable,
byte[] content)
|
| Methods inherited from class com.nexaweb.server.pushconnection.flushpolicies.IdlePeriodFlushPolicy |
getFlushSizeInBytes, getIdlePeriod, isStreamClosedOnFlush, onMessageSend |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public IdlePeriodWithSizeThresholdFlushPolicy()
IdlePeriodWithSizeThresholdFlushPolicy(long, int, int) or
IdlePeriodWithSizeThresholdFlushPolicy(long, int).
public IdlePeriodWithSizeThresholdFlushPolicy(long idlePeriod,
int flushSize,
int messageSizeThreshold)
idlePeriod - The period of time in milliseconds that the stream
must remain idle before it is flushed.flushSize - The size of the flush that will be used when flushing.messageSizeThreshold - The size to use as the threshold.
public IdlePeriodWithSizeThresholdFlushPolicy(long idlePeriod,
int messageSizeThreshold)
idlePeriod - The period of time in milliseconds that the stream
must remain idle before it is flushed.messageSizeThreshold - The size to use as the threshold.| Method Detail |
public void configure(Element policy)
throws ConfigurationException
configure in class IdlePeriodFlushPolicyConfigurationExceptionConfigurableFlushPolicy.configure(Element)
protected boolean messageMeetsFlushTaskResetCriteria(Flushable flushable,
byte[] content)
messageMeetsFlushTaskResetCriteria in class IdlePeriodFlushPolicy
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||