com.sun.jini.discovery.internal
Class MultiIPDiscovery

java.lang.Object
  extended by com.sun.jini.discovery.internal.MultiIPDiscovery

public abstract class MultiIPDiscovery
extends Object

Utility class used by implementations which want to perform unicast discovery on possibly multiple IP addresses for a given host name. This class supports unicast discovery constraints as specified in DiscoveryConstraints.


Field Summary
static int DEFAULT_TIMEOUT
           
 
Constructor Summary
MultiIPDiscovery()
           
 
Method Summary
protected  int getDefaultUnicastSocketTimeout()
           
 UnicastResponse getResponse(String host, int port, InvocationConstraints constraints)
           
private  UnicastResponse getSingleResponse(String host, long connectionTimeout, int port, DiscoveryConstraints dc, Discovery disco)
           
private  long getTimeout(long deadline)
           
protected abstract  UnicastResponse performDiscovery(Discovery disco, DiscoveryConstraints dc, Socket s)
           
protected  void singleResponseException(Exception ex, InetAddress addr, int port)
           
protected  void socketCloseException(IOException ex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TIMEOUT

public static final int DEFAULT_TIMEOUT
See Also:
Constant Field Values
Constructor Detail

MultiIPDiscovery

public MultiIPDiscovery()
Method Detail

getResponse

public UnicastResponse getResponse(String host,
                                   int port,
                                   InvocationConstraints constraints)
                            throws IOException,
                                   ClassNotFoundException
Throws:
IOException
ClassNotFoundException

getTimeout

private long getTimeout(long deadline)
                 throws SocketTimeoutException
Throws:
SocketTimeoutException

getSingleResponse

private UnicastResponse getSingleResponse(String host,
                                          long connectionTimeout,
                                          int port,
                                          DiscoveryConstraints dc,
                                          Discovery disco)
                                   throws IOException,
                                          ClassNotFoundException
Throws:
IOException
ClassNotFoundException

getDefaultUnicastSocketTimeout

protected int getDefaultUnicastSocketTimeout()

singleResponseException

protected void singleResponseException(Exception ex,
                                       InetAddress addr,
                                       int port)

socketCloseException

protected void socketCloseException(IOException ex)

performDiscovery

protected abstract UnicastResponse performDiscovery(Discovery disco,
                                                    DiscoveryConstraints dc,
                                                    Socket s)
                                             throws IOException,
                                                    ClassNotFoundException
Throws:
IOException
ClassNotFoundException


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