org.apache.mina.filter.traffic
Enum WriteThrottlePolicy

java.lang.Object
  extended by java.lang.Enum<WriteThrottlePolicy>
      extended by org.apache.mina.filter.traffic.WriteThrottlePolicy
All Implemented Interfaces:
Serializable, Comparable<WriteThrottlePolicy>

public enum WriteThrottlePolicy
extends Enum<WriteThrottlePolicy>

Tells WriteThrottleFilter what to do when there are too many scheduled write requests in the session buffer.

Version:
$Rev: 593474 $, $Date: 2007-11-09 11:14:12 +0100 (Fri, 09 Nov 2007) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Enum Constant Summary
BLOCK
          Block the write operation until the size of write request buffer is full.
FAIL
          Make the write operation fail immediately.
LOG
          Log a warning message, but doesn't limit anything.
OFF
          Do nothing; disables the filter.
 
Method Summary
static WriteThrottlePolicy valueOf(String name)
          Returns the enum constant of this type with the specified name.
static WriteThrottlePolicy[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

OFF

public static final WriteThrottlePolicy OFF
Do nothing; disables the filter.


LOG

public static final WriteThrottlePolicy LOG
Log a warning message, but doesn't limit anything. The warning message is logged at most every 3 seconds to avoid log flooding.


BLOCK

public static final WriteThrottlePolicy BLOCK
Block the write operation until the size of write request buffer is full. You must use this policy in conjunction with the WriteThrottleFilter to prevent the OutOfMemoryError on the reader side.


FAIL

public static final WriteThrottlePolicy FAIL
Make the write operation fail immediately. The 'exception' property of the returned WriteFuture will be WriteFloodException. The exception will also be notified as an exceptionCaught event.

Method Detail

values

public static final WriteThrottlePolicy[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(WriteThrottlePolicy c : WriteThrottlePolicy.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static WriteThrottlePolicy valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name


Copyright © 2004-2009 Apache MINA Project. All Rights Reserved.