|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.grizzly.http.jk.core.JkHandler
com.sun.grizzly.http.jk.common.ChannelSocket
public class ChannelSocket
Accept ( and send ) TCP messages.
| Field Summary | |
|---|---|
protected boolean |
running
|
| Fields inherited from class com.sun.grizzly.http.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 | |
|---|---|
ChannelSocket()
jmx:managed-constructor description="default constructor" |
|
| Method Summary | |
|---|---|
void |
accept(MsgContext ep)
|
void |
addNotificationListener(NotificationListener listener,
NotificationFilter filter,
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. |
String |
getAddress()
|
int |
getBufferSize()
|
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()
|
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(InetAddress server,
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(NotificationListener listener)
|
void |
resetCounters()
|
void |
resume()
|
int |
send(Msg msg,
MsgContext ep)
Send a message back to the client. |
void |
sendNewMessageNotification(Notification notification)
|
void |
setAddress(InetAddress inet)
|
void |
setAddress(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(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 com.sun.grizzly.http.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 com.sun.grizzly.http.jk.core.JkChannel |
|---|
createMsgContext |
| Field Detail |
|---|
protected boolean running
| Constructor Detail |
|---|
public ChannelSocket()
| Method Detail |
|---|
public ThreadPool getThreadPool()
public long getRequestCount()
public void setPort(int port)
public int getPort()
public void setAddress(InetAddress inet)
public void setAddress(String inet)
public 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 void pause()
throws Exception
pause in class JkHandlerException
public void resume()
throws Exception
resume in class JkHandlerException
public void accept(MsgContext ep)
throws IOException
IOExceptionpublic void resetCounters()
public void reinit()
throws IOException
IOException
public void init()
throws IOException
init in class JkHandlerIOException
public void start()
throws IOException
IOException
public void stop()
throws IOException
IOException
public void registerRequest(Request req,
MsgContext ep,
int count)
JkChannel
registerRequest in interface JkChannel
public void open(MsgContext ep)
throws IOException
IOException
public void close(MsgContext ep)
throws IOException
IOException
public void destroy()
throws IOException
JkHandler
destroy in class JkHandlerIOException
public int send(Msg msg,
MsgContext ep)
throws IOException
JkChannel
send in interface JkChannelmsg - The message to send.ep - The connection point for this request.
IOException
public int flush(Msg msg,
MsgContext ep)
throws IOException
JkChannel
flush in interface JkChannelIOException
public int receive(Msg msg,
MsgContext ep)
throws IOException
JkChannel
receive in interface JkChannelmsg - The place to recieve the data into.ep - The connection point for this request.
IOException
public int read(MsgContext ep,
byte[] b,
int offset,
int len)
throws IOException
IOException
public int invoke(Msg msg,
MsgContext ep)
throws IOException
JkChannel
invoke in interface JkChannelinvoke in class JkHandlerIOExceptionpublic boolean isSameAddress(MsgContext ep)
JkChannel
isSameAddress in interface JkChannelpublic String getChannelName()
JkChannel
getChannelName in interface JkChannel
public static boolean isSameAddress(InetAddress server,
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(Notification notification)
public void addNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
throws IllegalArgumentException
addNotificationListener in interface NotificationBroadcasterIllegalArgumentException
public void removeNotificationListener(NotificationListener listener)
throws ListenerNotFoundException
removeNotificationListener in interface NotificationBroadcasterListenerNotFoundExceptionpublic void setNotificationInfo(MBeanNotificationInfo[] info)
public MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo in interface NotificationBroadcaster
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||