php.java.servlet.fastcgi
Class ChannelName

java.lang.Object
  extended by php.java.servlet.fastcgi.ChannelName

public abstract class ChannelName
extends java.lang.Object

A factory which creates FastCGI channels.

Author:
jostb

Constructor Summary
ChannelName()
           
 
Method Summary
abstract  Channel connect()
          Connect to the FastCGI server and return the connection handle.
 void destroy()
           
abstract  void findFreePort(boolean select)
          Find a free port or pipe name.
static ChannelName getChannelName()
          Create a new ChannelName.
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(PhpCGIServlet servlet, PhpCGIServlet.CGIEnvironment env, java.lang.String contextPath)
          For backward compatibility the "JavaBridge" context uses the port 9667 (Linux/Unix) or \\.
 boolean startServer()
          Start the FastCGI server
abstract  void test()
          Test the FastCGI server.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChannelName

public ChannelName()
Method Detail

startServer

public final boolean startServer()
Start the FastCGI server

Returns:
false if the FastCGI server failed to start.

test

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

Throws:
ConnectException - thrown if a IOException occured.

destroy

public void destroy()

connect

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

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

initialize

public void initialize(PhpCGIServlet servlet,
                       PhpCGIServlet.CGIEnvironment env,
                       java.lang.String contextPath)
For backward compatibility the "JavaBridge" context uses the port 9667 (Linux/Unix) or \\.\pipe\JavaBridge@9667 (Windogs).

Parameters:
servlet - The servlet
env - The current CGI environment.

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.

getChannelName

public static ChannelName getChannelName()
Create a new ChannelName.

Returns:
The concrete ChannelName (NP or Socket channel).

toString

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