de.uniba.wiai.lspi.chord.com.socket
Class SocketEndpoint

java.lang.Object
  extended by de.uniba.wiai.lspi.chord.com.Endpoint
      extended by de.uniba.wiai.lspi.chord.com.socket.SocketEndpoint
All Implemented Interfaces:
java.lang.Runnable

public final class SocketEndpoint
extends Endpoint
implements java.lang.Runnable

This class represents an Endpoint for communication over socket protocol. It provides a ServerSocket to that clients can connect and starts for each incoming connection a RequestHandler that handles Requests for method invocations from remote nodes. These Requests are sent by one SocketProxy representing the node, that this is the endpoint for, at another node.

Version:
1.0.5 modified, 0.99b
Author:
sven, bojanm

Field Summary
 
Fields inherited from class de.uniba.wiai.lspi.chord.com.Endpoint
ACCEPT_ENTRIES, DISCONNECTED, LISTENING, METHODS_ALLOWED_IN_ACCEPT_ENTRIES, STARTED
 
Constructor Summary
SocketEndpoint(Node node1, URL url1)
          Creates a new SocketEndpoint for the given Node with url.
 
Method Summary
 void run()
          Run method from Runnable to accept connections from clients.
 
Methods inherited from class de.uniba.wiai.lspi.chord.com.Endpoint
acceptEntries, createEndpoint, deregister, disconnect, getEndpoint, getNode, getState, getURL, listen, register, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SocketEndpoint

public SocketEndpoint(Node node1,
                      URL url1)
Creates a new SocketEndpoint for the given Node with url. url must have the protocol indexed by URL.SOCKET_PROTOCOL in the URL.KNOWN_PROTOCOLS array.

Parameters:
node1 - The Node node this endpoint provides connections to.
url1 - The URL of this endpoint.
Method Detail

run

public void run()
Run method from Runnable to accept connections from clients. This method runs until closeConnections() is called. It creates threads responsible for the handling of requests from other nodes.

Specified by:
run in interface java.lang.Runnable