Accept ( and send ) TCP messages.
accept
public void accept(MsgContext ep)
throws IOException
addNotificationListener
public void addNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
throws IllegalArgumentException
close
public void close(MsgContext ep)
throws IOException
destroy
public void destroy()
throws IOException
Clean up and stop the handler
- destroy in interface JkHandler
getAddress
public String getAddress()
getDaemon
public boolean getDaemon()
getInstanceId
public int getInstanceId()
At startup we'll look for the first free port in the range.
The difference between this port and the beggining of the range
is the 'id'.
This is usefull for lb cases ( less config ).
getMaxPort
public int getMaxPort()
getMaxSpareThreads
public int getMaxSpareThreads()
getMaxThreads
public int getMaxThreads()
getMinSpareThreads
public int getMinSpareThreads()
getNotificationInfo
public MBeanNotificationInfo[] getNotificationInfo()
getPort
public int getPort()
getRequestCount
public long getRequestCount()
getServerTimeout
public int getServerTimeout()
getSoLinger
public int getSoLinger()
getSoTimeout
public int getSoTimeout()
getTcpNoDelay
public boolean getTcpNoDelay()
init
public void init()
throws IOException
- init in interface JkHandler
isSameAddress
public static boolean isSameAddress(InetAddress server,
InetAddress client)
Return true
if the specified client and server addresses
are the same. This method works around a bug in the IBM 1.1.8 JVM on
Linux, where the address bytes are returned reversed in some
circumstances.
server
- The server's InetAddressclient
- The client's InetAddress
open
public void open(MsgContext ep)
throws IOException
pause
public void pause()
throws Exception
- pause in interface JkHandler
read
public int read(MsgContext ep,
byte[] b,
int offset,
int len)
throws IOException
Read N bytes from the InputStream, and ensure we got them all
Under heavy load we could experience many fragmented packets
just read Unix Network Programming to recall that a call to
read didn't ensure you got all the data you want
from read() Linux manual
On success, the number of bytes read is returned (zero indicates end
of file),and the file position is advanced by this number.
It is not an error if this number is smaller than the number of bytes
requested; this may happen for example because fewer bytes
are actually available right now (maybe because we were close to
end-of-file, or because we are reading from a pipe, or from a
terminal), or because read() was interrupted by a signal.
On error, -1 is returned, and errno is set appropriately. In this
case it is left unspecified whether the file position (if any) changes.
reinit
public void reinit()
throws IOException
Called after you change some fields at runtime using jmx.
Experimental for now.
removeNotificationListener
public void removeNotificationListener(NotificationListener listener)
throws ListenerNotFoundException
resetCounters
public void resetCounters()
resume
public void resume()
throws Exception
- resume in interface JkHandler
sendNewMessageNotification
public void sendNewMessageNotification(Notification notification)
setAddress
public void setAddress(InetAddress inet)
setAddress
public void setAddress(String inet)
setBacklog
public void setBacklog(int i)
setDaemon
public void setDaemon(boolean b)
If set to false, the thread pool will be created in
non-daemon mode, and will prevent main from exiting
setMaxPort
public void setMaxPort(int i)
setMaxSpareThreads
public void setMaxSpareThreads(int i)
setMaxThreads
public void setMaxThreads(int i)
setMinSpareThreads
public void setMinSpareThreads(int i)
setNotificationInfo
public void setNotificationInfo(info[] )
setPort
public void setPort(int port)
Set the port for the ajp13 channel.
To support seemless load balancing and jni, we treat this
as the 'base' port - we'll try up until we find one that is not
used. We'll also provide the 'difference' to the main coyote
handler - that will be our 'sessionID' and the position in
the scoreboard and the suffix for the unix domain socket.
setServerTimeout
public void setServerTimeout(int timeout)
Sets the timeout in ms of the server sockets created by this
server. This method allows the developer to make servers
more or less responsive to having their server sockets
shut down.
By default this value is 1000ms.
setSoLinger
public void setSoLinger(int i)
setSoTimeout
public void setSoTimeout(int i)
setTcpNoDelay
public void setTcpNoDelay(boolean b)
start
public void start()
throws IOException
stop
public void stop()
throws IOException