com.sun.grizzly
Interface Interceptor<R>


public interface Interceptor<R>

Handler, which is used to finer control Readable.read(...).

Author:
Alexey Stashok

Field Summary
static int COMPLETED
           
static int DEFAULT
           
static int INCOMPLETED
           
static int RESET
           
 
Method Summary
 int intercept(int event, Object context, R result)
          Callback method is called by Readable, so it is possible to customize reading process.
 

Field Detail

DEFAULT

static final int DEFAULT
See Also:
Constant Field Values

COMPLETED

static final int COMPLETED
See Also:
Constant Field Values

INCOMPLETED

static final int INCOMPLETED
See Also:
Constant Field Values

RESET

static final int RESET
See Also:
Constant Field Values
Method Detail

intercept

int intercept(int event,
              Object context,
              R result)
Callback method is called by Readable, so it is possible to customize reading process. Mostly Interceptor is used to control asynchronous reads.

Parameters:
event - type of intercepted event.
context - read operation context.
result - last read operation result.
Returns:
the implementation specific code to instruct Readable how it should continue reading operation.


Copyright © 2009 SUN Microsystems. All Rights Reserved.