|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nhindirect.dns.DNSSocketServer
public abstract class DNSSocketServer
The socket server is an IP protocol agnostic server that manages threading/concurrency and message dispatching to the concrete socket implementation. It utilizes a "smart" thread pool for efficiently managing processing threads.
| Constructor Summary | |
|---|---|
DNSSocketServer(DNSServerSettings settings,
DNSResponder responsder)
Creates a socket server. |
|
| Method Summary | |
|---|---|
abstract void |
createServerSocket()
Creates and initializes the socket implementation that will accept incoming requests. |
abstract Runnable |
getDNSRequestTask(Object s)
Gets the Runnable task that will process a DNS request. |
Long |
getRejectedRequestCount()
Gets the number of requests that were rejected by the server due to being to busy. |
Long |
getResourceRequestCount()
Gets the number of DNS requests received by the server. |
String |
getResourceRequestLoad()
Gets the request load of the server. |
abstract Runnable |
getSocketAcceptTask()
Gets the Runnable task that will be responsible for accepting connections. |
Long |
getUptime()
Gets the time in milliseconds that the server has been running since its last start. |
void |
start()
Starts the socket server and initializes the dispatch threads. |
void |
stop()
Shuts down the socket server and terminates the server from accepting additional requests. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.nhindirect.dns.DNSSocketServerMBean |
|---|
getErrorRequestCount, getMissedRequestCount, getSuccessfulRequestCount |
| Constructor Detail |
|---|
public DNSSocketServer(DNSServerSettings settings,
DNSResponder responsder)
throws DNSException
start() method is called.
settings - The server settings. The settings contain specific IP and socket configuration parameters.responsder - The DNS responder that will handle lookups.
DNSException| Method Detail |
|---|
public void start()
throws DNSException
DNSException
public void stop()
throws DNSException
DNSException
public abstract void createServerSocket()
throws DNSException
DNSExceptionpublic abstract Runnable getSocketAcceptTask()
public abstract Runnable getDNSRequestTask(Object s)
s - An arbitrary parameter passed to the Runnable task. This parameter generally contain the DNS request information.
This may be the TCP socket from the accept() server socket call or a UDP datagram packet.
public Long getUptime()
getUptime in interface DNSSocketServerMBeanpublic Long getRejectedRequestCount()
getRejectedRequestCount in interface DNSSocketServerMBeanpublic Long getResourceRequestCount()
getResourceRequestCount in interface DNSSocketServerMBeanpublic String getResourceRequestLoad()
getResourceRequestLoad in interface DNSSocketServerMBean
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||