net.jini.jeri.connection
Class ConnectionManager.ReqIterator

java.lang.Object
  extended by net.jini.jeri.connection.ConnectionManager.ReqIterator
All Implemented Interfaces:
OutboundRequestIterator
Enclosing class:
ConnectionManager

private final class ConnectionManager.ReqIterator
extends Object
implements OutboundRequestIterator

Outbound request iterator returned by newRequest.


Field Summary
private  boolean first
          True if next has not yet been called.
private  OutboundRequestHandle handle
          The request handle.
private  ConnectionManager.OutboundMux mux
          The outbound mux from the last call to next, if any.
 
Constructor Summary
ConnectionManager.ReqIterator(OutboundRequestHandle handle)
           
 
Method Summary
 boolean hasNext()
          Returns true if next has not yet been called or if the last mux returned had an asynchronous close.
 OutboundRequest next()
          If hasNext returns true, finds the entry (if any) for the connection endpoint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handle

private final OutboundRequestHandle handle
The request handle.


first

private boolean first
True if next has not yet been called.


mux

private ConnectionManager.OutboundMux mux
The outbound mux from the last call to next, if any.

Constructor Detail

ConnectionManager.ReqIterator

ConnectionManager.ReqIterator(OutboundRequestHandle handle)
Method Detail

hasNext

public boolean hasNext()
Returns true if next has not yet been called or if the last mux returned had an asynchronous close.

Specified by:
hasNext in interface OutboundRequestIterator
Returns:
true if this iterator supports making another attempt to communicate the request, and false otherwise

next

public OutboundRequest next()
                     throws IOException
If hasNext returns true, finds the entry (if any) for the connection endpoint. If no entry is found, creates one and spawns a Reaper if this is the only entry. Either way, bumps the connect count for the entry. Calls connect on the entry to get a mux, then calls newRequest on the mux, calls writeRequestData on the connection, and returns a new outbound request wrapper.

Specified by:
next in interface OutboundRequestIterator
Returns:
the OutboundRequest to use to write the request data and read the response
Throws:
IOException - if an I/O exception occurs while performing this operation; in this event, the recipient may have received an indication of the request initiation attempt


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.