com.caucho.network.listen
Class JniSelectManager

java.lang.Object
  extended by com.caucho.network.listen.AbstractSelectManager
      extended by com.caucho.network.listen.JniSelectManager
All Implemented Interfaces:
java.lang.Runnable

public class JniSelectManager
extends AbstractSelectManager
implements java.lang.Runnable

Represents a protocol connection.


Method Summary
 int addNative(long manager, int fd)
           
 int closeNative(long manager)
           
static JniSelectManager create()
          Returns a jni select manager.
 long createNative()
           
protected  void finalize()
           
 int freeNative(long manager)
           
 long getCheckInterval()
          Returns the check interface.
 int getFreeKeepalive()
          Returns the available keepalive.
static java.lang.String getInitMessage()
           
 int getSelectCount()
          Returns the keepalive count.
 int getSelectMax()
          Sets the max select.
 void initNative(long fd)
           
static boolean isEnabled()
           
 boolean keepalive(TcpSocketLink tcpConn)
          Adds a keepalive connection.
 int removeNative(long manager, int fd)
           
 void run()
          Running process accepting connections.
 int selectNative(long manager, long timeout)
           
 void setCheckInterval(long checkInterval)
          Sets the check interval.
 void setSelectMax(int max)
          Sets the max select.
 void setSelectTimeout(long timeout)
          Sets the select timeout
 boolean start()
          Starts the manager.
 boolean stop()
          Closing the manager.
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.network.listen.AbstractSelectManager
close
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static JniSelectManager create()
Returns a jni select manager.


isEnabled

public static boolean isEnabled()

getInitMessage

public static java.lang.String getInitMessage()

getFreeKeepalive

public int getFreeKeepalive()
Returns the available keepalive.

Overrides:
getFreeKeepalive in class AbstractSelectManager

getSelectCount

public int getSelectCount()
Returns the keepalive count.

Overrides:
getSelectCount in class AbstractSelectManager

setSelectMax

public void setSelectMax(int max)
Sets the max select.

Overrides:
setSelectMax in class AbstractSelectManager

getSelectMax

public int getSelectMax()
Sets the max select.

Overrides:
getSelectMax in class AbstractSelectManager

setSelectTimeout

public void setSelectTimeout(long timeout)
Sets the select timeout

Overrides:
setSelectTimeout in class AbstractSelectManager

getCheckInterval

public long getCheckInterval()
Returns the check interface.


setCheckInterval

public void setCheckInterval(long checkInterval)
Sets the check interval.


start

public boolean start()
Starts the manager.

Specified by:
start in class AbstractSelectManager

keepalive

public boolean keepalive(TcpSocketLink tcpConn)
Adds a keepalive connection.

Specified by:
keepalive in class AbstractSelectManager
Parameters:
conn - the connection to register as keepalive
Returns:
true if the connection changes to the keepalive state

run

public void run()
Running process accepting connections.

Specified by:
run in interface java.lang.Runnable

stop

public boolean stop()
Closing the manager.

Overrides:
stop in class AbstractSelectManager

finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

createNative

public long createNative()

initNative

public void initNative(long fd)

addNative

public int addNative(long manager,
                     int fd)
              throws java.io.IOException
Throws:
java.io.IOException

removeNative

public int removeNative(long manager,
                        int fd)
                 throws java.io.IOException
Throws:
java.io.IOException

selectNative

public int selectNative(long manager,
                        long timeout)
                 throws java.io.IOException
Throws:
java.io.IOException

closeNative

public int closeNative(long manager)

freeNative

public int freeNative(long manager)