Here is the kind of java7 inspired API I'm thinking about to add to
AsyncContext:
/* ------------------------------------------------------------ */
/**
* Write the buffer and then call the completion handler
* @param buffer
* @param handler
*/
public void write(ByteBuffer
buffer,CompletionHandler<Boolean,AsyncContext> handler)
{
}
/* ------------------------------------------------------------ */
/**
* Write the file and then call the completion handler
* @param file
* @param handler
*/
public void write(File file, CompletionHandler<Boolean, AsyncContext>
handler)
{
}
/* ------------------------------------------------------------ */
/**
* Read the request content into memory so that it is available
* from the {_at_link ServletRequest#getInputStream()} API without
blocking
* and then call the completion handler
* @param attachment
* @param handler
*/
public <A> void read(CompletionHandler<Boolean,AsyncContext> handler)
{
}
/* ------------------------------------------------------------ */
/**
* Read the request content into the file and then call the completion
handler
* @param file
* @param handler
*/
public <A> void read(File file, CompletionHandler<Boolean,
AsyncContext> handler)
{
}
>