com.hs.mail.container.server
Class DefaultServer

java.lang.Object
  extended by com.hs.mail.container.server.DefaultServer
All Implemented Interfaces:
Server
Direct Known Subclasses:
SmtpServer

public class DefaultServer
extends Object
implements Server

Since:
May 3, 2010
Author:
Won Chul Doh

Field Summary
protected  int backlog
          The connection backlog.
protected  String bind
          The host name of bindTo address.
protected  InetAddress bindTo
          Network interface to which the service will bind.
protected  ConnectionHandler connectionHandler
          The connection handler used by this service.
protected  int connectionTimeout
          The connection idle timeout.
protected  int port
          The port on which this server will be made available.
protected  ServerSocketFactory serverSocketFactory
          Factory creating server sockets.
protected  boolean tcpNoDelay
          Indicates whether or not TCP_NODELAY is enabled.
 
Constructor Summary
DefaultServer()
           
 
Method Summary
 void configure()
           
 int getBacklog()
           
 String getBind()
           
 InetAddress getBindTo()
           
 ConnectionHandler getConnectionHandler()
           
 int getConnectionTimeout()
           
 int getPort()
           
 ServerSocketFactory getServerSocketFactory()
           
 String getServiceType()
          This method returns the type of service provided by this server.
 org.springframework.core.task.TaskExecutor getTaskExecutor()
           
 boolean isTcpNoDelay()
           
 void setBacklog(int backlog)
           
 void setBind(String bind)
           
 void setBindTo(InetAddress bindTo)
           
 void setConnectionHandler(ConnectionHandler connectionHandler)
           
 void setConnectionTimeout(int connectionTimeout)
           
 void setPort(int port)
           
 void setServerSocketFactory(ServerSocketFactory factory)
           
 void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
           
 void setTcpNoDelay(boolean tcpNoDelay)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

port

protected int port
The port on which this server will be made available.


bind

protected String bind
The host name of bindTo address.


bindTo

protected InetAddress bindTo
Network interface to which the service will bind. If not set, the server binds to all available interfaces.


backlog

protected int backlog
The connection backlog.


connectionTimeout

protected int connectionTimeout
The connection idle timeout. Used primarily to prevent server problems from hanging a connection.


tcpNoDelay

protected boolean tcpNoDelay
Indicates whether or not TCP_NODELAY is enabled.


serverSocketFactory

protected ServerSocketFactory serverSocketFactory
Factory creating server sockets.


connectionHandler

protected ConnectionHandler connectionHandler
The connection handler used by this service.

Constructor Detail

DefaultServer

public DefaultServer()
Method Detail

getPort

public int getPort()

setPort

public void setPort(int port)

getBind

public String getBind()

setBind

public void setBind(String bind)

getBindTo

public InetAddress getBindTo()

setBindTo

public void setBindTo(InetAddress bindTo)

getBacklog

public int getBacklog()

setBacklog

public void setBacklog(int backlog)

getConnectionTimeout

public int getConnectionTimeout()

setConnectionTimeout

public void setConnectionTimeout(int connectionTimeout)

isTcpNoDelay

public boolean isTcpNoDelay()

setTcpNoDelay

public void setTcpNoDelay(boolean tcpNoDelay)

getServerSocketFactory

public ServerSocketFactory getServerSocketFactory()

setServerSocketFactory

public void setServerSocketFactory(ServerSocketFactory factory)

getConnectionHandler

public ConnectionHandler getConnectionHandler()

setConnectionHandler

public void setConnectionHandler(ConnectionHandler connectionHandler)

getTaskExecutor

public org.springframework.core.task.TaskExecutor getTaskExecutor()

setTaskExecutor

public void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)

getServiceType

public String getServiceType()
This method returns the type of service provided by this server. This should be invariant over the life of the class. Subclasses may override this implementation. This implementation parses the complete class name and returns the undecorated class name.

Returns:
description of this server

configure

public void configure()
               throws Exception
Throws:
Exception

start

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

stop

public void stop()
Specified by:
stop in interface Server


Copyright © 2011. All Rights Reserved.