|
Apache Tomcat 6.0.53 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jk.core.JkHandler org.apache.jk.common.ChannelNioSocket
public class ChannelNioSocket
Accept ( and send ) TCP messages.
Nested Class Summary | |
---|---|
protected class |
ChannelNioSocket.Poller
|
protected class |
ChannelNioSocket.SocketConnection
|
protected class |
ChannelNioSocket.SocketInputStream
|
protected class |
ChannelNioSocket.SocketOutputStream
|
Field Summary | |
---|---|
protected boolean |
running
|
Fields inherited from class org.apache.jk.core.JkHandler |
---|
domain, ERROR, HANDLE_FLUSH, HANDLE_RECEIVE_PACKET, HANDLE_SEND_PACKET, HANDLE_THREAD_END, id, LAST, mserver, name, next, nextName, OK, oname, properties, wEnv |
Constructor Summary | |
---|---|
ChannelNioSocket()
jmx:managed-constructor description="default constructor" |
Method Summary | |
---|---|
void |
accept(MsgContext ep)
|
void |
addNotificationListener(javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
java.lang.Object handback)
|
void |
close(MsgContext ep)
|
void |
destroy()
Clean up and stop the handler |
int |
flush(Msg msg,
MsgContext ep)
Flush the data to the client. |
java.lang.String |
getAddress()
|
int |
getBufferSize()
|
java.lang.String |
getChannelName()
Return the identifying name of this Channel. |
boolean |
getDaemon()
|
int |
getInstanceId()
At startup we'll look for the first free port in the range. |
int |
getMaxPort()
|
int |
getMaxSpareThreads()
|
int |
getMaxThreads()
|
int |
getMinSpareThreads()
|
boolean |
getNioIsBroken()
|
javax.management.MBeanNotificationInfo[] |
getNotificationInfo()
|
int |
getPacketSize()
|
int |
getPort()
|
long |
getRequestCount()
|
int |
getServerTimeout()
|
int |
getSoLinger()
|
int |
getSoTimeout()
|
boolean |
getTcpNoDelay()
|
ThreadPool |
getThreadPool()
|
void |
init()
jmx:managed-operation |
int |
invoke(Msg msg,
MsgContext ep)
Invoke the request chain. |
static boolean |
isSameAddress(java.net.InetAddress server,
java.net.InetAddress client)
Return true if the specified client and server addresses
are the same. |
boolean |
isSameAddress(MsgContext ep)
Confirm that a shutdown request was recieved form us. |
void |
open(MsgContext ep)
|
void |
pause()
|
int |
read(MsgContext ep,
byte[] b,
int offset,
int len)
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. |
int |
receive(Msg msg,
MsgContext ep)
Recieve a message from the client. |
void |
registerRequest(Request req,
MsgContext ep,
int count)
Register a new Request in the Request pool. |
void |
reinit()
Called after you change some fields at runtime using jmx. |
void |
removeNotificationListener(javax.management.NotificationListener listener)
|
void |
resetCounters()
|
void |
resume()
|
int |
send(Msg msg,
MsgContext ep)
Send a message back to the client. |
void |
sendNewMessageNotification(javax.management.Notification notification)
|
void |
setAddress(java.net.InetAddress inet)
|
void |
setAddress(java.lang.String inet)
jmx:managed-attribute description="Bind on a specified address" access="READ_WRITE" |
void |
setBacklog(int i)
|
void |
setBufferSize(int bs)
|
void |
setDaemon(boolean b)
If set to false, the thread pool will be created in non-daemon mode, and will prevent main from exiting |
void |
setMaxPort(int i)
|
void |
setMaxSpareThreads(int i)
|
void |
setMaxThreads(int i)
|
void |
setMinSpareThreads(int i)
|
void |
setNioIsBroken(boolean nib)
|
void |
setNotificationInfo(javax.management.MBeanNotificationInfo[] info)
|
void |
setPacketSize(int ps)
|
void |
setPort(int port)
Set the port for the ajp13 channel. |
void |
setServerTimeout(int timeout)
Sets the timeout in ms of the server sockets created by this server. |
void |
setSoLinger(int i)
|
void |
setSoTimeout(int i)
|
void |
setTcpNoDelay(boolean b)
|
void |
start()
|
void |
stop()
|
Methods inherited from class org.apache.jk.core.JkHandler |
---|
addHandlerCallback, createMsgContext, createMsgContext, getDomain, getId, getName, getNext, getObjectName, getProperty, handleNotification, postDeregister, postRegister, preDeregister, preRegister, setId, setName, setNext, setNext, setProperty, setWorkerEnv |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.jk.core.JkChannel |
---|
createMsgContext |
Field Detail |
---|
protected boolean running
Constructor Detail |
---|
public ChannelNioSocket()
Method Detail |
---|
public ThreadPool getThreadPool()
public long getRequestCount()
public void setPort(int port)
public int getPort()
public void setAddress(java.net.InetAddress inet)
public void setBufferSize(int bs)
public int getBufferSize()
public void setPacketSize(int ps)
public int getPacketSize()
public void setAddress(java.lang.String inet)
public java.lang.String getAddress()
public void setServerTimeout(int timeout)
By default this value is 1000ms.
public int getServerTimeout()
public void setTcpNoDelay(boolean b)
public boolean getTcpNoDelay()
public void setSoLinger(int i)
public int getSoLinger()
public void setSoTimeout(int i)
public int getSoTimeout()
public void setMaxPort(int i)
public int getMaxPort()
public int getInstanceId()
public void setDaemon(boolean b)
public boolean getDaemon()
public void setMaxThreads(int i)
public void setMinSpareThreads(int i)
public void setMaxSpareThreads(int i)
public int getMaxThreads()
public int getMinSpareThreads()
public int getMaxSpareThreads()
public void setBacklog(int i)
public void setNioIsBroken(boolean nib)
public boolean getNioIsBroken()
public void pause() throws java.lang.Exception
pause
in class JkHandler
java.lang.Exception
public void resume()
resume
in class JkHandler
public void accept(MsgContext ep) throws java.io.IOException
java.io.IOException
public void resetCounters()
public void reinit() throws java.io.IOException
java.io.IOException
public void init() throws java.io.IOException
init
in class JkHandler
java.io.IOException
public void start() throws java.io.IOException
java.io.IOException
public void stop() throws java.io.IOException
java.io.IOException
public void registerRequest(Request req, MsgContext ep, int count)
JkChannel
registerRequest
in interface JkChannel
public void open(MsgContext ep) throws java.io.IOException
java.io.IOException
public void close(MsgContext ep) throws java.io.IOException
java.io.IOException
public void destroy() throws java.io.IOException
JkHandler
destroy
in class JkHandler
java.io.IOException
public int send(Msg msg, MsgContext ep) throws java.io.IOException
JkChannel
send
in interface JkChannel
msg
- The message to send.ep
- The connection point for this request.
java.io.IOException
public int flush(Msg msg, MsgContext ep) throws java.io.IOException
JkChannel
flush
in interface JkChannel
java.io.IOException
public int receive(Msg msg, MsgContext ep) throws java.io.IOException
JkChannel
receive
in interface JkChannel
msg
- The place to recieve the data into.ep
- The connection point for this request.
java.io.IOException
public int read(MsgContext ep, byte[] b, int offset, int len) throws java.io.IOException
java.io.IOException
public int invoke(Msg msg, MsgContext ep) throws java.io.IOException
JkChannel
invoke
in interface JkChannel
invoke
in class JkHandler
java.io.IOException
public boolean isSameAddress(MsgContext ep)
JkChannel
isSameAddress
in interface JkChannel
public java.lang.String getChannelName()
JkChannel
getChannelName
in interface JkChannel
public static boolean isSameAddress(java.net.InetAddress server, java.net.InetAddress client)
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 InetAddresspublic void sendNewMessageNotification(javax.management.Notification notification)
public void addNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback) throws java.lang.IllegalArgumentException
addNotificationListener
in interface javax.management.NotificationBroadcaster
java.lang.IllegalArgumentException
public void removeNotificationListener(javax.management.NotificationListener listener) throws javax.management.ListenerNotFoundException
removeNotificationListener
in interface javax.management.NotificationBroadcaster
javax.management.ListenerNotFoundException
public void setNotificationInfo(javax.management.MBeanNotificationInfo[] info)
public javax.management.MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo
in interface javax.management.NotificationBroadcaster
|
Apache Tomcat 6.0.53 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |