| java.lang.Object org.apache.jk.core.JkHandler org.apache.jk.common.ChannelNioSocket
ChannelNioSocket | public class ChannelNioSocket extends JkHandler implements NotificationBroadcaster,JkChannel(Code) | | Accept ( and send ) TCP messages.
author: Costin Manolache author: Bill Barker author: jmx:mbean name="jk:service=ChannelNioSocket" author: description="Accept socket connections" author: jmx:notification name="org.apache.coyote.INVOKE author: jmx:notification-handler name="org.apache.jk.JK_SEND_PACKET author: jmx:notification-handler name="org.apache.jk.JK_RECEIVE_PACKET author: jmx:notification-handler name="org.apache.jk.JK_FLUSH author: Jk can use multiple protocols/transports. author: Various container adapters should load this object ( as a bean ), author: set configurations and use it. Note that the connector will handle author: all incoming protocols - it's not specific to ajp1x. The protocol author: is abstracted by MsgContext/Message/Channel. author: A lot of the 'original' behavior is hardcoded - this uses Ajp13 wire protocol, author: TCP, Ajp14 API etc. author: As we add other protocols/transports/APIs this will change, the current goal author: is to get the same level of functionality as in the original jk connector. author: XXX Make the 'message type' pluggable |
Inner Class :protected class SocketInputStream extends InputStream | |
Inner Class :protected class SocketOutputStream extends OutputStream | |
Method Summary | |
public void | accept(MsgContext ep) | void | acceptConnections() | public void | addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) | public void | close(MsgContext ep) | public void | destroy() | public int | flush(Msg msg, MsgContext ep) | public String | getAddress() | public int | getBufferSize() | public String | getChannelName() | public boolean | getDaemon() | public int | getInstanceId() At startup we'll look for the first free port in the range. | public int | getMaxPort() | public int | getMaxSpareThreads() | public int | getMaxThreads() | public int | getMinSpareThreads() | public boolean | getNioIsBroken() | public MBeanNotificationInfo[] | getNotificationInfo() | public int | getPacketSize() | public int | getPort() | public long | getRequestCount() | public int | getServerTimeout() | public int | getSoLinger() | public int | getSoTimeout() | public boolean | getTcpNoDelay() | public ThreadPool | getThreadPool() | public void | init() | public int | invoke(Msg msg, MsgContext ep) | public boolean | isSameAddress(MsgContext ep) | public static boolean | isSameAddress(InetAddress server, InetAddress client) Return true if the specified client and server addresses
are the same. | public void | open(MsgContext ep) | public void | pause() | public 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.
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. | public int | receive(Msg msg, MsgContext ep) | public void | registerRequest(Request req, MsgContext ep, int count) | public void | reinit() Called after you change some fields at runtime using jmx. | public void | removeNotificationListener(NotificationListener listener) | public void | resetCounters() | public void | resume() | public int | send(Msg msg, MsgContext ep) | public void | sendNewMessageNotification(Notification notification) | public void | setAddress(InetAddress inet) | public void | setAddress(String inet) | public void | setBacklog(int i) | public void | setBufferSize(int bs) | public void | setDaemon(boolean b) | public void | setMaxPort(int i) | public void | setMaxSpareThreads(int i) | public void | setMaxThreads(int i) | public void | setMinSpareThreads(int i) | public void | setNioIsBroken(boolean nib) | public void | setNotificationInfo(MBeanNotificationInfo info) | public void | setPacketSize(int ps) | 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. | public void | setServerTimeout(int timeout) Sets the timeout in ms of the server sockets created by this
server. | public void | setSoLinger(int i) | public void | setSoTimeout(int i) | public void | setTcpNoDelay(boolean b) | public void | start() | public void | stop() |
JMXRequestNote | int JMXRequestNote(Code) | | |
notifNote | final int notifNote(Code) | | |
running | protected boolean running(Code) | | |
socketNote | final int socketNote(Code) | | |
ChannelNioSocket | public ChannelNioSocket()(Code) | | jmx:managed-constructor description="default constructor"
|
acceptConnections | void acceptConnections()(Code) | | Accept incoming connections, dispatch to the thread pool
|
getBufferSize | public int getBufferSize()(Code) | | |
getDaemon | public boolean getDaemon()(Code) | | |
getInstanceId | public int getInstanceId()(Code) | | 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()(Code) | | |
getMaxSpareThreads | public int getMaxSpareThreads()(Code) | | |
getMaxThreads | public int getMaxThreads()(Code) | | |
getMinSpareThreads | public int getMinSpareThreads()(Code) | | |
getNioIsBroken | public boolean getNioIsBroken()(Code) | | |
getPacketSize | public int getPacketSize()(Code) | | |
getPort | public int getPort()(Code) | | |
getRequestCount | public long getRequestCount()(Code) | | |
getServerTimeout | public int getServerTimeout()(Code) | | |
getSoLinger | public int getSoLinger()(Code) | | |
getSoTimeout | public int getSoTimeout()(Code) | | |
getTcpNoDelay | public boolean getTcpNoDelay()(Code) | | |
isSameAddress | public static boolean isSameAddress(InetAddress server, InetAddress client)(Code) | | 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.
Parameters: server - The server's InetAddress Parameters: client - The client's InetAddress |
read | public int read(MsgContext ep, byte[] b, int offset, int len) throws IOException(Code) | | 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(Code) | | Called after you change some fields at runtime using jmx.
Experimental for now.
|
resetCounters | public void resetCounters()(Code) | | |
resume | public void resume()(Code) | | |
sendNewMessageNotification | public void sendNewMessageNotification(Notification notification)(Code) | | |
setAddress | public void setAddress(String inet)(Code) | | jmx:managed-attribute description="Bind on a specified address" access="READ_WRITE"
|
setBacklog | public void setBacklog(int i)(Code) | | |
setBufferSize | public void setBufferSize(int bs)(Code) | | |
setDaemon | public void setDaemon(boolean b)(Code) | | 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)(Code) | | |
setMaxSpareThreads | public void setMaxSpareThreads(int i)(Code) | | |
setMaxThreads | public void setMaxThreads(int i)(Code) | | |
setMinSpareThreads | public void setMinSpareThreads(int i)(Code) | | |
setNioIsBroken | public void setNioIsBroken(boolean nib)(Code) | | |
setPacketSize | public void setPacketSize(int ps)(Code) | | |
setPort | public void setPort(int port)(Code) | | 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.
jmx:managed-attribute description="Port to listen" access="READ_WRITE"
|
setServerTimeout | public void setServerTimeout(int timeout)(Code) | | 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)(Code) | | |
setSoTimeout | public void setSoTimeout(int i)(Code) | | |
setTcpNoDelay | public void setTcpNoDelay(boolean b)(Code) | | |
|
|