Save This Page
Home » apache-tomcat-6.0.26-src » org.apache.jk » common » [javadoc | source]
public class: ChannelSocket [javadoc | source]

All Implemented Interfaces:
    JkChannel, NotificationBroadcaster, NotificationListener, MBeanRegistration

Accept ( and send ) TCP messages.
Nested Class Summary:
static class  ChannelSocket.SocketAcceptor   
static class  ChannelSocket.SocketConnection   
Field Summary
 ThreadPool tp     
 ServerSocket sSocket     
final  int socketNote     
final  int isNote     
final  int osNote     
final  int notifNote     
 boolean paused     
 ObjectName tpOName     
 ObjectName rgOName     
 RequestGroupInfo global     
 int JMXRequestNote     
protected  boolean running     
 MBeanNotificationInfo[] notifInfo     
Fields inherited from org.apache.jk.core.JkHandler:
OK,  LAST,  ERROR,  properties,  wEnv,  next,  nextName,  name,  id,  HANDLE_RECEIVE_PACKET,  HANDLE_SEND_PACKET,  HANDLE_FLUSH,  HANDLE_THREAD_END,  domain,  oname,  mserver
 public ChannelSocket() 
Method from org.apache.jk.common.ChannelSocket Summary:
accept,   acceptConnections,   addNotificationListener,   close,   destroy,   flush,   getAddress,   getBufferSize,   getChannelName,   getDaemon,   getInstanceId,   getMaxPort,   getMaxSpareThreads,   getMaxThreads,   getMinSpareThreads,   getNotificationInfo,   getPacketSize,   getPort,   getRequestCount,   getServerTimeout,   getSoLinger,   getSoTimeout,   getTcpNoDelay,   getThreadPool,   init,   invoke,   isSameAddress,   isSameAddress,   open,   pause,   processConnection,   read,   receive,   registerRequest,   reinit,   removeNotificationListener,   resetCounters,   resume,   send,   sendNewMessageNotification,   setAddress,   setAddress,   setBacklog,   setBufferSize,   setDaemon,   setMaxPort,   setMaxSpareThreads,   setMaxThreads,   setMinSpareThreads,   setNotificationInfo,   setPacketSize,   setPort,   setServerTimeout,   setSoLinger,   setSoTimeout,   setTcpNoDelay,   start,   stop
Methods from org.apache.jk.core.JkHandler:
addHandlerCallback,   createMsgContext,   createMsgContext,   destroy,   getDomain,   getId,   getName,   getNext,   getObjectName,   getProperty,   handleNotification,   init,   invoke,   pause,   postDeregister,   postRegister,   preDeregister,   preRegister,   resume,   setId,   setName,   setNext,   setNext,   setProperty,   setWorkerEnv
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.jk.common.ChannelSocket Detail:
 public  void accept(MsgContext ep) throws IOException 
  void acceptConnections() 
    Accept incoming connections, dispatch to the thread pool
 public  void addNotificationListener(NotificationListener listener,
    NotificationFilter filter,
    Object handback) throws IllegalArgumentException 
 public  void close(MsgContext ep) throws IOException 
 public  void destroy() throws IOException 
 public int flush(Msg msg,
    MsgContext ep) throws IOException 
 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. The difference between this port and the beggining of the range is the 'id'. This is usefull for lb cases ( less config ).
 public int getMaxPort() 
 public int getMaxSpareThreads() 
 public int getMaxThreads() 
 public int getMinSpareThreads() 
 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() throws IOException 
 public int invoke(Msg msg,
    MsgContext ep) throws IOException 
 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. 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.
 public  void open(MsgContext ep) throws IOException 
 public  void pause() throws Exception 
  void processConnection(MsgContext ep) 
    Process a single ajp connection.
 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.
 public int receive(Msg msg,
    MsgContext ep) throws IOException 
 public  void registerRequest(Request req,
    MsgContext ep,
    int count) 
 public  void reinit() throws IOException 
    Called after you change some fields at runtime using jmx. Experimental for now.
 public  void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException 
 public  void resetCounters() 
 public  void resume() throws Exception 
 public int send(Msg msg,
    MsgContext ep) throws IOException 
 public  void sendNewMessageNotification(Notification notification) 
 public  void setAddress(InetAddress inet) 
 public  void setAddress(String inet) 
    jmx:managed-attribute description="Bind on a specified address" access="READ_WRITE"
 public  void setBacklog(int i) 
 public  void setBufferSize(int bs) 
 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
 public  void setMaxPort(int i) 
 public  void setMaxSpareThreads(int i) 
 public  void setMaxThreads(int i) 
 public  void setMinSpareThreads(int i) 
 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. 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"
 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.

 public  void setSoLinger(int i) 
 public  void setSoTimeout(int i) 
 public  void setTcpNoDelay(boolean b) 
 public  void start() throws IOException 
 public  void stop() throws IOException