|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.uniba.wiai.lspi.chord.com.Endpoint
de.uniba.wiai.lspi.chord.com.socket.SocketEndpoint
public final class SocketEndpoint
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.
| Field Summary |
|---|
| Fields inherited from class de.uniba.wiai.lspi.chord.com.Endpoint |
|---|
ACCEPT_ENTRIES, DISCONNECTED, endpoints, LISTENING, METHODS_ALLOWED_IN_ACCEPT_ENTRIES, node, STARTED, url |
| Constructor Summary | |
|---|---|
SocketEndpoint(Node node1,
URL url1)
Creates a new SocketEndpoint for the given Node
with url. |
|
| Method Summary | |
|---|---|
protected void |
closeConnections()
This method has to be overwritten by sub classes and is invoked by Endpoint.disconnect()to close all connections from the chord network. |
protected void |
entriesAcceptable()
This method has to be overwritten by subclasses. |
protected void |
openConnections()
To implemented by sub classes. |
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, notify, register, setState, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SocketEndpoint(Node node1,
URL url1)
SocketEndpoint for the given Node
with url. url must have the protocol indexed
by URL.SOCKET_PROTOCOL in the
URL.KNOWN_PROTOCOLS array.
node1 - The Node node this endpoint provides connections to.url1 - The URL of this endpoint.| Method Detail |
|---|
protected void openConnections()
EndpointEndpoint.listen()to
make it possible for other chord nodes to connect to the node on that
this endpoint invocates methods.
TODO: This method may throw an exception when starting to listen for
incoming connections.
openConnections in class Endpointprotected void entriesAcceptable()
EndpointEndpoint.acceptEntries()to indicate that entries can now be accepted. So
maybe if an endpoint queues incoming requests for storage or removal of
entries this requests can be answered when endpoint changes it state to
ACCEPT_ENTRIES.
entriesAcceptable in class Endpointprotected void closeConnections()
EndpointEndpoint.disconnect()to close all connections from the chord network.
closeConnections in class Endpointpublic void run()
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.
run in interface Runnable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||