com.neeve.link
Enum ILnkPeerEndpoint.FlushContext.FlushMode

java.lang.Object
  extended by java.lang.Enum<ILnkPeerEndpoint.FlushContext.FlushMode>
      extended by com.neeve.link.ILnkPeerEndpoint.FlushContext.FlushMode
All Implemented Interfaces:
Serializable, Comparable<ILnkPeerEndpoint.FlushContext.FlushMode>
Enclosing class:
ILnkPeerEndpoint.FlushContext

public static enum ILnkPeerEndpoint.FlushContext.FlushMode
extends Enum<ILnkPeerEndpoint.FlushContext.FlushMode>

Flush modes.


Enum Constant Summary
ASYNC
          Asynchronous flush mode.
SYNC_BLOCKING
          Synchronous blocking flush mode.
SYNC_NON_BLOCKING
          Synchronous non-blocking flush mode.
 
Method Summary
static ILnkPeerEndpoint.FlushContext.FlushMode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ILnkPeerEndpoint.FlushContext.FlushMode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SYNC_BLOCKING

public static final ILnkPeerEndpoint.FlushContext.FlushMode SYNC_BLOCKING
Synchronous blocking flush mode.

This is the default flushing mode. When a user specifies this flush mode to the ILnkPeerEndpoint.enque(short, com.neeve.pkt.PktPacket, com.neeve.link.ILnkPeerEndpoint.FlushContext, int) method or the ILnkPeerEndpoint.flush(short, com.neeve.link.ILnkPeerEndpoint.FlushContext) method, the endpoint will block until all enqueued packets have been flushed from the endpoint.


SYNC_NON_BLOCKING

public static final ILnkPeerEndpoint.FlushContext.FlushMode SYNC_NON_BLOCKING
Synchronous non-blocking flush mode.

When a user specifies this flush mode to the ILnkPeerEndpoint.enque(short, com.neeve.pkt.PktPacket, com.neeve.link.ILnkPeerEndpoint.FlushContext, int) method or the ILnkPeerEndpoint.flush(short, com.neeve.link.ILnkPeerEndpoint.FlushContext) method, the endpoint will attempt to flush the enqueued packets to the remote endpoint. However, in case it is unable to do so (due to congestion or any other reason), it does not block and wait for the congestion to abate before it returns to the caller. It returns immediately to the caller even if all the enqueued packets have not been flushed.


ASYNC

public static final ILnkPeerEndpoint.FlushContext.FlushMode ASYNC
Asynchronous flush mode.

When a user specifies this flush mode, as with the synchronous non-blocking flush mode, the endpoint will attempt to flush the enqueued packets to the remote endpoint and is unable to do do will return immediately to the caller. However, in this mode, before returning, the endpoint will setup the flush to complete asynchronously in the background driven by a dispatcher provided by the caller. In case the flush needs to complete asynchronously, the caller is responsible for driving the dispatcher after the enque or flush call returns to complete the flush.

Method Detail

values

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

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

valueOf

public static ILnkPeerEndpoint.FlushContext.FlushMode 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
NullPointerException - if the argument is null


Copyright © 2015 Neeve Research, LLC. All Rights Reserved.