Project JXTA

net.jxta.impl.endpoint.router
Class Destinations.Wisdom

java.lang.Object
  extended by net.jxta.impl.endpoint.router.Destinations.Wisdom
Enclosing class:
Destinations

 class Destinations.Wisdom
extends Object

This class stores knowlege about one particular destination. It does not provide any synchronization. This is provided by the Destinations class.


Field Summary
(package private) static long expiration
          How long we consider that a past outgoingMessenger is an indication that one is possible in the future.
 
Constructor Summary
Destinations.Wisdom(Messenger messenger, boolean incoming)
           
 
Method Summary
(package private)  boolean addIncomingMessenger(Messenger m)
           
(package private)  boolean addOutgoingMessenger(Messenger m)
           
(package private)  Messenger getCurrentMessenger()
          Returns a channel for this destination if one is there or can be obtained readily and works.
(package private)  boolean isCurrentlyReachable()
          We think the destination is reachable somehow.
(package private)  boolean isExpired()
           
(package private)  boolean isNormallyReachable()
           
(package private)  boolean isWelcomeNeeded()
          Tells whether a welcome message is needed.
(package private)  void noOutgoingMessenger()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expiration

static final long expiration
How long we consider that a past outgoingMessenger is an indication that one is possible in the future.

See Also:
Constant Field Values
Constructor Detail

Destinations.Wisdom

Destinations.Wisdom(Messenger messenger,
                    boolean incoming)
Parameters:
channel - The messenger to cache information about.
incoming - If true, this is an incoming messenger, which means that if the channel is lost it cannot be re-obtained. It must strongly referenced until it closes for disuse, or breaks.
Method Detail

isWelcomeNeeded

boolean isWelcomeNeeded()
Tells whether a welcome message is needed. The first time we're asked, we say true. Subsequently, always false; assuming it was done when said so (so, ask only if you'll do it).

Returns:
true If this is the first time this method is invoked.

addIncomingMessenger

boolean addIncomingMessenger(Messenger m)

addOutgoingMessenger

boolean addOutgoingMessenger(Messenger m)

noOutgoingMessenger

void noOutgoingMessenger()

getCurrentMessenger

Messenger getCurrentMessenger()
Returns a channel for this destination if one is there or can be obtained readily and works.


isNormallyReachable

boolean isNormallyReachable()
Returns:
true if we do have an outgoing messenger or, failing that, we had one not too long ago.

isCurrentlyReachable

boolean isCurrentlyReachable()
We think the destination is reachable somehow. Not sure how long.

Returns:
true if we have any kind of messenger or, failing that, we had an outgoing one not too long ago.

isExpired

boolean isExpired()
Returns:
true if this wisdom carries no positive information whatsoever.

JXTA J2SE