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  php.java.servlet.fastcgi.Channel connect()
          Connect to the FastCGI server and return the connection handle.
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 \\.
abstract  void test()
          Test the FastCGI server.
 java.lang.String toString()
          Return the channel name
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChannelName

public ChannelName()
Method Detail

test

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

Throws:
ConnectException - thrown if a IOException occured.

connect

public abstract php.java.servlet.fastcgi.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.
contextPath - The path of the web context

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()
Return the channel name

Overrides:
toString in class java.lang.Object
Returns:
the channel name