org.eodisp.remote.jeri.jxta
Class JxtaEndpoint

java.lang.Object
  extended by org.eodisp.remote.jeri.jxta.JxtaEndpoint
All Implemented Interfaces:
java.io.Serializable, net.jini.jeri.Endpoint, net.jini.security.proxytrust.TrustEquivalence

public final class JxtaEndpoint
extends java.lang.Object
implements net.jini.jeri.Endpoint, net.jini.security.proxytrust.TrustEquivalence, java.io.Serializable

An implementation of the Endpoint abstraction that uses JXTA sockets (instances of JxtaSocket) for the underlying communication mechanism.

Most of the implementation was copied from the the TcpEndpoint class.

All TcpEndpoint instances in the same JVM use the same peer and peer group advertisement. This information is statically received from JxtaNetwork.

JxtaEndpoint uses the Jini(TM) extensible remote invocation (Jini ERI) multiplexing protocol to map incoming requests to socket connections.

Author:
ibirrer
See Also:
JxtaServerEndpoint, Serialized Form

Method Summary
 boolean checkTrustEquivalence(java.lang.Object obj)
          Returns this.equals(obj).
 boolean equals(java.lang.Object obj)
          Compares the specified object with this JxtaEndpoint for equality.
static JxtaEndpoint getInstance(net.jxta.peer.PeerID peerID)
          Returns a JxtaEndpoint instance for the given peer id.
 int hashCode()
          Returns the hash code value for this JxtaEndpoint.
 net.jini.jeri.OutboundRequestIterator newRequest(net.jini.core.constraint.InvocationConstraints constraints)
          
 java.lang.String toString()
          Returns a string representation of this JxtaEndpoint.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static JxtaEndpoint getInstance(net.jxta.peer.PeerID peerID)
Returns a JxtaEndpoint instance for the given peer id.

Parameters:
peerID - the peer id for the endpoint to connect to.
Returns:
a JxtaEndpoint instance

newRequest

public net.jini.jeri.OutboundRequestIterator newRequest(net.jini.core.constraint.InvocationConstraints constraints)

The returned OutboundRequestIterator's next method behaves as follows:

Initiates an attempt to communicate the request to this remote endpoint.

When the implementation needs to connect a Socket it connects to it by using this endpoint's peer id and the peer group and pipe advertisements given by JxtaNetwork.getJeriPeerGroup() and JxtaNetwork.getJeriPipeAdvertisement().

Throws NoSuchElementException if this iterator does not support making another attempt to communicate the request (that is, if hasNext would return false).

Throws IOException if an I/O exception occurs while performing this operation, such as if a connection attempt timed out or was refused.

Specified by:
newRequest in interface net.jini.jeri.Endpoint
Throws:
java.lang.NullPointerException

hashCode

public int hashCode()
Returns the hash code value for this JxtaEndpoint.

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code value for this JxtaEndpoint

equals

public boolean equals(java.lang.Object obj)
Compares the specified object with this JxtaEndpoint for equality.

This method returns true if and only if

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare with
Returns:
true if obj is equivalent to this object; false otherwise

checkTrustEquivalence

public boolean checkTrustEquivalence(java.lang.Object obj)
Returns this.equals(obj).

Specified by:
checkTrustEquivalence in interface net.jini.security.proxytrust.TrustEquivalence
Returns:
this.equals(obj)

toString

public java.lang.String toString()
Returns a string representation of this JxtaEndpoint.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this JxtaEndpoint