pygmy.core
Class ServerSocketEndPoint

java.lang.Object
  extended by pygmy.core.ServerSocketEndPoint
All Implemented Interfaces:
java.lang.Runnable, EndPoint
Direct Known Subclasses:
NntpEndPoint, SSLServerSocketEndPoint

public class ServerSocketEndPoint
extends java.lang.Object
implements EndPoint, java.lang.Runnable

This EndPoint provides normal sockets for the http protocol. It can be sublasses and overriden for protocols other than http.

Parameter NameExplanationDefault ValueRequired
portThe port the socket should listen on.80No
hostThe ip or dns of the host adapter this socket should bind to.NoneNo
resolveHostNameIf the server should do a reverse DNS on the connections so the logs will show the DNS name of the client.falseNo


Field Summary
protected  java.lang.String endpointName
           
protected  javax.net.ServerSocketFactory factory
           
protected  boolean resolveHostName
           
protected  Server server
           
protected  java.net.ServerSocket socket
           
 
Constructor Summary
ServerSocketEndPoint()
           
 
Method Summary
protected  java.lang.Runnable createRunnable(java.net.Socket client, java.util.Properties config)
           
protected  java.net.ServerSocket createSocket(int port)
           
 java.lang.String getName()
           
protected  java.lang.String getProtocol()
           
 void initialize(java.lang.String name, Server server)
           
 void run()
           
 void shutdown(Server server)
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factory

protected javax.net.ServerSocketFactory factory

socket

protected java.net.ServerSocket socket

server

protected Server server

endpointName

protected java.lang.String endpointName

resolveHostName

protected boolean resolveHostName
Constructor Detail

ServerSocketEndPoint

public ServerSocketEndPoint()
Method Detail

initialize

public void initialize(java.lang.String name,
                       Server server)
                throws java.io.IOException
Specified by:
initialize in interface EndPoint
Throws:
java.io.IOException

getName

public java.lang.String getName()
Specified by:
getName in interface EndPoint

createSocket

protected java.net.ServerSocket createSocket(int port)
                                      throws java.io.IOException
Throws:
java.io.IOException

start

public void start()
Specified by:
start in interface EndPoint

run

public void run()
Specified by:
run in interface java.lang.Runnable

getProtocol

protected java.lang.String getProtocol()

createRunnable

protected java.lang.Runnable createRunnable(java.net.Socket client,
                                            java.util.Properties config)
                                     throws java.io.IOException
Throws:
java.io.IOException

shutdown

public void shutdown(Server server)
Specified by:
shutdown in interface EndPoint