proactor.server
Class SimpleCompletionHandler

java.lang.Object
  extended by proactor.server.SimpleCompletionHandler
All Implemented Interfaces:
CompletionHandler

public class SimpleCompletionHandler
extends java.lang.Object
implements CompletionHandler


Constructor Summary
SimpleCompletionHandler(java.net.Socket socket)
          This CompletionHandler is mapped to a Socket.
 
Method Summary
 void handleEvent()
          Handles an event, which is triggered by the dispatcher.
 void setData(java.lang.Object data)
          Sets the data from the Mock-Async-Operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleCompletionHandler

public SimpleCompletionHandler(java.net.Socket socket)
                        throws java.io.IOException
This CompletionHandler is mapped to a Socket. It completes its task by sending the data to the OutputStream of the Socket. Its the endpoint of the whole operation.

Parameters:
socket - The socket object.
Throws:
java.io.IOException
Method Detail

handleEvent

public void handleEvent()
Handles an event, which is triggered by the dispatcher. Here, we just send the data on the stream and close it afterwards.

Specified by:
handleEvent in interface CompletionHandler

setData

public void setData(java.lang.Object data)
Sets the data from the Mock-Async-Operation.

Specified by:
setData in interface CompletionHandler
Parameters:
data -