net.jini.jeri.ssl
Class SslEndpointImpl.ExceptionOutboundRequestIterator

java.lang.Object
  extended by net.jini.jeri.ssl.SslEndpointImpl.ExceptionOutboundRequestIterator
All Implemented Interfaces:
OutboundRequestIterator
Enclosing class:
SslEndpointImpl

private static final class SslEndpointImpl.ExceptionOutboundRequestIterator
extends Object
implements OutboundRequestIterator

An outbound request iterator that throws an IOException or a SecurityException.


Field Summary
private  boolean done
           
private  Exception exception
           
 
Constructor Summary
SslEndpointImpl.ExceptionOutboundRequestIterator(Exception exception)
           
 
Method Summary
 boolean hasNext()
          Returns true if this iterator supports making at least one more attempt to communicate the request, and false otherwise.
 OutboundRequest next()
          Initiates an attempt to communicate the request to the remote endpoint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

exception

private final Exception exception

done

private boolean done
Constructor Detail

SslEndpointImpl.ExceptionOutboundRequestIterator

SslEndpointImpl.ExceptionOutboundRequestIterator(Exception exception)
Method Detail

hasNext

public boolean hasNext()
Description copied from interface: OutboundRequestIterator
Returns true if this iterator supports making at least one more attempt to communicate the request, and false otherwise.

If this method returns true, then it is guaranteed that the next invocation of next on this iterator will not throw a NoSuchElementException.

If next has been invoked on this iterator and the previous invocation of next returned an OutboundRequest, then this method should not be invoked until that OutboundRequest has been used to attempt to communicate the request and a failure has occurred.

The security context in which this method is invoked may be used for subsequent verification of security permissions; see the next method specification for more details.

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
Description copied from interface: OutboundRequestIterator
Initiates an attempt to communicate the request to the remote endpoint.

After an invocation of hasNext returns true, it is guaranteed that the next invocation of this method will not throw a NoSuchElementException.

If successful, this method returns an OutboundRequest to use to write the request data and read the response. Even if this method throws an IOException or a SecurityException, the iteration of attempts to communicate the request may continue with another invocation of hasNext.

The implementation verifies that the user's security context has all of the security permissions necessary to communicate the current request attempt with the remote endpoint and to satisfy any required constraints, as appropriate to the implementation of this interface. The implementation is allowed, however, to indicate failure of such a permission check by either throwing a SecurityException from this method or, after returning an OutboundRequest from this method, throwing a SecurityException from some subsequent operation on the OutboundRequest or its streams. If such a SecurityException is thrown, request data must not have been transmitted to the server (that is, if an OutboundRequest has been returned, its getDeliveryStatus method must return false), and the client's identity must not have been revealed to the server.

Also, the implementation of this method or the returned OutboundRequest must eventually verify that the client and server have the requisite principals and credentials to satisfy any required constraints and if not, throw an IOException. If such an IOException is thrown, request data must not have been transmitted to the server.

In verifying any such permission requirement or credential, the implementation is allowed to use the security context in effect for this or any previous invocation of a method on this iterator or the security context in effect for any operation on the OutboundRequest returned by this or any previous invocation of this method on this iterator. Therefore, this iterator and the OutboundRequest instances that it produces should be used in a uniform security context.

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.