org.apache.jk.common
public class ChannelSocket extends JkHandler implements javax.management.NotificationBroadcaster, JkChannel
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
running |
domain, ERROR, HANDLE_FLUSH, HANDLE_RECEIVE_PACKET, HANDLE_SEND_PACKET, HANDLE_THREAD_END, id, LAST, mserver, name, next, nextName, OK, oname, properties, wEnv| Constructor and Description |
|---|
ChannelSocket()
jmx:managed-constructor description="default constructor"
|
| Modifier and Type | Method and Description |
|---|---|
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 |
getBacklog() |
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() |
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 |
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() |
addHandlerCallback, createMsgContext, createMsgContext, getDomain, getId, getName, getNext, getObjectName, getProperty, handleNotification, postDeregister, postRegister, preDeregister, preRegister, setId, setName, setNext, setNext, setProperty, setWorkerEnvclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateMsgContextpublic ChannelSocket()
public ThreadPool getThreadPool()
public long getRequestCount()
public void setPort(int port)
public int getPort()
public void setAddress(java.net.InetAddress inet)
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 void setBufferSize(int bs)
public int getBufferSize()
public void setPacketSize(int ps)
public int getPacketSize()
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 int getBacklog()
public void pause()
throws java.lang.Exception
public void resume()
throws java.lang.Exception
public void accept(MsgContext ep) throws java.io.IOException
java.io.IOExceptionpublic void resetCounters()
public void reinit()
throws java.io.IOException
java.io.IOExceptionpublic void init()
throws java.io.IOException
public void start()
throws java.io.IOException
java.io.IOExceptionpublic void stop()
throws java.io.IOException
java.io.IOExceptionpublic void registerRequest(Request req, MsgContext ep, int count)
JkChannelregisterRequest in interface JkChannelpublic void open(MsgContext ep) throws java.io.IOException
java.io.IOExceptionpublic void close(MsgContext ep) throws java.io.IOException
java.io.IOExceptionpublic void destroy()
throws java.io.IOException
JkHandlerpublic int send(Msg msg, MsgContext ep) throws java.io.IOException
JkChannelpublic int flush(Msg msg, MsgContext ep) throws java.io.IOException
JkChannelpublic int receive(Msg msg, MsgContext ep) throws java.io.IOException
JkChannelpublic int read(MsgContext ep, byte[] b, int offset, int len) throws java.io.IOException
java.io.IOExceptionpublic int invoke(Msg msg, MsgContext ep) throws java.io.IOException
JkChannelpublic boolean isSameAddress(MsgContext ep)
JkChannelisSameAddress in interface JkChannelpublic java.lang.String getChannelName()
JkChannelgetChannelName in interface JkChannelpublic 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.NotificationBroadcasterjava.lang.IllegalArgumentExceptionpublic void removeNotificationListener(javax.management.NotificationListener listener)
throws javax.management.ListenerNotFoundException
removeNotificationListener in interface javax.management.NotificationBroadcasterjavax.management.ListenerNotFoundExceptionpublic void setNotificationInfo(javax.management.MBeanNotificationInfo[] info)
public javax.management.MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo in interface javax.management.NotificationBroadcasterCopyright © 2000-2013 Apache Software Foundation. All Rights Reserved.