php.java.bridge.http
Class FCGIConnectionFactory

java.lang.Object
  extended by php.java.bridge.http.FCGIConnectionFactory
Direct Known Subclasses:
NPChannelFactory

public abstract class FCGIConnectionFactory
extends java.lang.Object

A factory which creates FastCGI channels.

Author:
jostb

Constructor Summary
FCGIConnectionFactory(IFCGIProcessFactory processFactory)
          Create a new FCGIConnectionFactory using a FCGIProcessFactory
 
Method Summary
abstract  FCGIConnection connect()
          Connect to the FastCGI server and return the connection handle.
static FCGIConnectionFactory createChannelFactory(IFCGIProcessFactory processFactory, boolean promiscuous)
          Create a new ChannelFactory.
 void destroy()
           
abstract  void findFreePort(boolean select)
          Find a free port or pipe name.
abstract  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.
 void initialize()
          For backward compatibility the "JavaBridge" context uses the port 9667 (Linux/Unix) or \\.\pipe\JavaBridge@9667 (Windogs).
 boolean startServer(ILogger logger)
          Start the FastCGI server
abstract  void test()
          Test the FastCGI server.
abstract  java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FCGIConnectionFactory

public FCGIConnectionFactory(IFCGIProcessFactory processFactory)
Create a new FCGIConnectionFactory using a FCGIProcessFactory

Parameters:
processFactory - the FCGIProcessFactory
Method Detail

startServer

public final boolean startServer(ILogger logger)
Start the FastCGI server

Returns:
false if the FastCGI server failed to start.

test

public abstract void test()
                   throws FCGIConnectException
Test the FastCGI server.

Throws:
FCGIConnectException - thrown if a IOException occured.

destroy

public void destroy()

connect

public abstract FCGIConnection connect()
                                throws FCGIConnectException
Connect to the FastCGI server and return the connection handle.

Returns:
The FastCGI Channel
Throws:
FCGIConnectException - thrown if a IOException occured.

initialize

public void initialize()
For backward compatibility the "JavaBridge" context uses the port 9667 (Linux/Unix) or \\.\pipe\JavaBridge@9667 (Windogs).


getFcgiStartCommand

public abstract 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.

Parameters:
base - The context directory
php_fcgi_max_requests - The number of requests, see appropriate servlet option.
Returns:
A command string

findFreePort

public abstract void findFreePort(boolean select)
Find a free port or pipe name.

Parameters:
select - If select is true, the default name should be used.

createChannelFactory

public static FCGIConnectionFactory createChannelFactory(IFCGIProcessFactory processFactory,
                                                         boolean promiscuous)
Create a new ChannelFactory.

Returns:
The concrete ChannelFactory (NP or Socket channel factory).

toString

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