com.sleepycat.je.rep.impl
Class TextProtocol.MessageExchange

java.lang.Object
  extended by com.sleepycat.je.rep.impl.TextProtocol.MessageExchange
All Implemented Interfaces:
Runnable
Enclosing class:
TextProtocol

public class TextProtocol.MessageExchange
extends Object
implements Runnable

Use to parallelize message exchanges via Futures.


Field Summary
 Exception exception
           
 InetSocketAddress target
           
 
Constructor Summary
TextProtocol.MessageExchange(InetSocketAddress target, String serviceName, TextProtocol.RequestMessage request)
           
 
Method Summary
 Exception getException()
           
 TextProtocol.RequestMessage getRequestMessage()
           
 TextProtocol.ResponseMessage getResponseMessage()
          Returns the response message.
 void messageExchange()
          Run a message exchange.
 void run()
           
 void setResponseMessage(TextProtocol.ResponseMessage responseMessage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

target

public final InetSocketAddress target

exception

public Exception exception
Constructor Detail

TextProtocol.MessageExchange

public TextProtocol.MessageExchange(InetSocketAddress target,
                                    String serviceName,
                                    TextProtocol.RequestMessage request)
Method Detail

run

public void run()
Specified by:
run in interface Runnable

messageExchange

public void messageExchange()
Run a message exchange. A successful exchange results in a response message being set. All failures result in the response message being null and an exception being set.


setResponseMessage

public void setResponseMessage(TextProtocol.ResponseMessage responseMessage)

getResponseMessage

public TextProtocol.ResponseMessage getResponseMessage()
Returns the response message. The null may be returned as part of the protocol exchange, or it may be null if an exception was encountered say because of some IO problem. It's the caller's responsibility to check for an exception in that circumstance.

Note: MasterTransfer currently returns null upon success (there may be others), it would be preferable if they returned an explicit OK response if possible. Need to review.

Returns:
the response

getRequestMessage

public TextProtocol.RequestMessage getRequestMessage()

getException

public Exception getException()


Copyright (c) 2004-2012 Oracle. All rights reserved.