php.java.servlet.fastcgi
Class SocketChannelFactory

java.lang.Object
  extended by php.java.servlet.fastcgi.ChannelFactory
      extended by php.java.servlet.fastcgi.SocketChannelFactory

 class SocketChannelFactory
extends ChannelFactory


Field Summary
static java.lang.String LOCAL_HOST
           
 
Fields inherited from class php.java.servlet.fastcgi.ChannelFactory
contextPath, env, proc, servlet
 
Constructor Summary
SocketChannelFactory()
           
 
Method Summary
protected  void bind()
           
 Channel connect()
          Connect to the FastCGI server and return the connection handle.
 void destroy()
           
protected  Util.Process doBind(java.util.Map env, java.lang.String php)
           
 void findFreePort(boolean select)
          Find a free port or pipe name.
 java.lang.String getFcgiStartCommand(java.lang.String base, java.lang.String php_fcgi_max_requests)
          Return a command which may be useful for starting the FastCGI server as a separate command.
 java.lang.String getName()
           
 int getPort()
           
 void setDefaultPort()
           
protected  void setDynamicPort()
           
 void test()
          Test the FastCGI server.
protected  void waitForDaemon()
           
 
Methods inherited from class php.java.servlet.fastcgi.ChannelFactory
createChannelFactory, initialize, runFcgi, startServer, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOCAL_HOST

public static final java.lang.String LOCAL_HOST
See Also:
Constant Field Values
Constructor Detail

SocketChannelFactory

SocketChannelFactory()
Method Detail

test

public void test()
          throws ConnectException
Description copied from class: ChannelFactory
Test the FastCGI server.

Specified by:
test in class ChannelFactory
Throws:
ConnectException - thrown if a IOException occured.

connect

public Channel connect()
                throws ConnectException
Description copied from class: ChannelFactory
Connect to the FastCGI server and return the connection handle.

Specified by:
connect in class ChannelFactory
Returns:
The FastCGI Channel
Throws:
ConnectException - thrown if a IOException occured.

waitForDaemon

protected void waitForDaemon()
                      throws java.net.UnknownHostException,
                             java.lang.InterruptedException
Specified by:
waitForDaemon in class ChannelFactory
Throws:
java.net.UnknownHostException
java.lang.InterruptedException

doBind

protected Util.Process doBind(java.util.Map env,
                              java.lang.String php)
                       throws java.io.IOException
Specified by:
doBind in class ChannelFactory
Throws:
java.io.IOException

getPort

public int getPort()

getName

public java.lang.String getName()

getFcgiStartCommand

public java.lang.String getFcgiStartCommand(java.lang.String base,
                                            java.lang.String php_fcgi_max_requests)
Description copied from class: ChannelFactory
Return a command which may be useful for starting the FastCGI server as a separate command.

Specified by:
getFcgiStartCommand in class ChannelFactory
Parameters:
base - The context directory
php_fcgi_max_requests - The number of requests, see appropriate servlet option.
Returns:
A command string

bind

protected void bind()
             throws java.lang.InterruptedException,
                    java.io.IOException
Overrides:
bind in class ChannelFactory
Throws:
java.lang.InterruptedException
java.io.IOException

findFreePort

public void findFreePort(boolean select)
Description copied from class: ChannelFactory
Find a free port or pipe name.

Specified by:
findFreePort in class ChannelFactory
Parameters:
select - If select is true, the default name should be used.

setDefaultPort

public void setDefaultPort()
Specified by:
setDefaultPort in class ChannelFactory

setDynamicPort

protected void setDynamicPort()
Specified by:
setDynamicPort in class ChannelFactory

destroy

public void destroy()
Overrides:
destroy in class ChannelFactory