php.java.bridge
Class JavaBridgeFactory

java.lang.Object
  extended by php.java.bridge.JavaBridgeFactory
All Implemented Interfaces:
IJavaBridgeFactory
Direct Known Subclasses:
RemoteHttpServletContextFactory, SessionFactory

public abstract class JavaBridgeFactory
extends java.lang.Object
implements IJavaBridgeFactory

Create new JavaBridge instances

Author:
jostb
See Also:
Session, Context, HttpContext, ContextFactory, ServletContextFactory, PhpScriptContextFactory

Constructor Summary
JavaBridgeFactory()
           
 
Method Summary
 void destroy()
          Destroy the factory
 JavaBridge getBridge()
          Return the JavaBridge.
abstract  IContext getContext()
          Return the associated JSR223 context
abstract  ISession getSession(java.lang.String name, short clientIsNew, int timeout)
          Return a session for the JavaBridge
 boolean isNew()
          Return true if this factory has already created a bridge or not.
 void parseHeader(Request req, java.io.InputStream in)
          Called for the request header
 void recycle()
          Recycle the factory for new reqests.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface php.java.bridge.IJavaBridgeFactory
flushBuffer, invalidate
 

Constructor Detail

JavaBridgeFactory

public JavaBridgeFactory()
Method Detail

getSession

public abstract ISession getSession(java.lang.String name,
                                    short clientIsNew,
                                    int timeout)
Return a session for the JavaBridge

Specified by:
getSession in interface IJavaBridgeFactory
Parameters:
name - The session name. If name is null, the name PHPSESSION will be used.
clientIsNew - one of ISession.SESSION_CREATE_NEW ISession.SESSION_GET_OR_CREATE or ISession.SESSION_GET
timeout - timeout in seconds. If 0 the session does not expire.
Returns:
The session
See Also:
ISession

getContext

public abstract IContext getContext()
Return the associated JSR223 context

Specified by:
getContext in interface IJavaBridgeFactory
Returns:
Always null
See Also:
ContextFactory.getContext()

getBridge

public JavaBridge getBridge()
Return the JavaBridge.

Specified by:
getBridge in interface IJavaBridgeFactory
Returns:
Returns the bridge.

isNew

public boolean isNew()
Return true if this factory has already created a bridge or not.

Specified by:
isNew in interface IJavaBridgeFactory
Returns:
true if this factory is new, false otherwise

recycle

public void recycle()
Recycle the factory for new reqests.

Specified by:
recycle in interface IJavaBridgeFactory

destroy

public void destroy()
Destroy the factory

Specified by:
destroy in interface IJavaBridgeFactory

parseHeader

public void parseHeader(Request req,
                        java.io.InputStream in)
                 throws java.io.IOException
Called for the request header

Specified by:
parseHeader in interface IJavaBridgeFactory
Parameters:
req - the current request
in - the input stream
Throws:
java.io.IOException