JXTA

net.jxta.impl.endpoint.relay
Class RelayServerClient.RelayMessenger

java.lang.Object
  extended by net.jxta.util.AbstractSimpleSelectable
      extended by net.jxta.endpoint.AbstractMessenger
          extended by net.jxta.impl.endpoint.BlockingMessenger
              extended by net.jxta.impl.endpoint.relay.RelayServerClient.RelayMessenger
All Implemented Interfaces:
Messenger, SimpleSelectable
Enclosing class:
RelayServerClient

protected static class RelayServerClient.RelayMessenger
extends BlockingMessenger


Nested Class Summary
 
Nested classes/interfaces inherited from interface net.jxta.util.SimpleSelectable
SimpleSelectable.IdentityReference
 
Field Summary
 
Fields inherited from class net.jxta.endpoint.AbstractMessenger
DEFAULT_MTU, dstAddress
 
Fields inherited from class net.jxta.util.AbstractSimpleSelectable
identityReference
 
Fields inherited from interface net.jxta.endpoint.Messenger
ANYSTATE, BREAKING, BROKEN, CLOSED, CLOSING, CONNECTED, DISCONNECTED, DISCONNECTING, IDLE, RECONCLOSING, RECONNECTING, RECONSATURATED, RESOLCLOSING, RESOLPENDING, RESOLSATURATED, RESOLVED, RESOLVING, SATURATED, SENDING, SENDINGSATURATED, TERMINAL, UNRESOLVABLE, UNRESOLVED, UNRESOLVING, USABLE
 
Constructor Summary
RelayServerClient.RelayMessenger(EndpointAddress srcAddress, EndpointAddress destAddress, RelayServerClient handler, boolean outOfBand)
           
 
Method Summary
 void closeImpl()
          Close connection.
 EndpointAddress getLogicalDestinationImpl()
          Obtain the logical destination address from the implementer (a transport for example).
 boolean isIdleImpl()
          return true if this messenger has not been used for a long time.
 void sendMessageBImpl(Message message, String serviceName, String serviceParam)
          Send a message blocking as needed until the message is sent.
 
Methods inherited from class net.jxta.impl.endpoint.BlockingMessenger
close, getChannelMessenger, getDestAddressToUse, getLogicalDestinationAddress, getState, isClosed, resolve, sendMessageB, sendMessageN, setOwner, shutdown
 
Methods inherited from class net.jxta.endpoint.AbstractMessenger
flush, getDestinationAddress, getDestinationAddressObject, getMTU, isIdle, isSynchronous, itemChanged, sendMessage, sendMessage, sendMessage, setStateLock, toString, waitState
 
Methods inherited from class net.jxta.util.AbstractSimpleSelectable
getIdentityReference, haveListeners, notifyChange, register, registerListener, unregister, unregisterListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.jxta.util.SimpleSelectable
getIdentityReference, register, unregister
 

Constructor Detail

RelayServerClient.RelayMessenger

public RelayServerClient.RelayMessenger(EndpointAddress srcAddress,
                                        EndpointAddress destAddress,
                                        RelayServerClient handler,
                                        boolean outOfBand)
Method Detail

isIdleImpl

public boolean isIdleImpl()
return true if this messenger has not been used for a long time. The definition of long time is: "sufficient such that closing it is worth the cost of having to re-open". A messenger should self close if it thinks it meets the definition of idle. BlockingMessenger leaves the evaluation to the transport but does the work automatically. Important: if self destruction is used, this method must work; not just return false. See the constructor. In general, if closeImpl does not need to do anything, then self destruction is not needed.

Specified by:
isIdleImpl in class BlockingMessenger
Returns:
true if theis messenger is, by it's own definition, idle.

closeImpl

public void closeImpl()
Close connection. May fail current send.

Specified by:
closeImpl in class BlockingMessenger

getLogicalDestinationImpl

public EndpointAddress getLogicalDestinationImpl()
Obtain the logical destination address from the implementer (a transport for example).

Specified by:
getLogicalDestinationImpl in class BlockingMessenger

sendMessageBImpl

public void sendMessageBImpl(Message message,
                             String serviceName,
                             String serviceParam)
                      throws IOException
Description copied from class: BlockingMessenger
Send a message blocking as needed until the message is sent.

Specified by:
sendMessageBImpl in class BlockingMessenger
Parameters:
message - The message to send.
serviceName - The destination service.
serviceParam - The destination serivce param.
Throws:
IOException - Thrown for errors encountered while sending the message.

JXSE