php.java.bridge
Interface IJavaBridgeFactory

All Known Subinterfaces:
IContextFactory, IContextFactoryVisitor
All Known Implementing Classes:
ContextFactory, InteractivePhpScriptContextFactory, JavaBridgeFactory, PhpScriptContextFactory, RemoteHttpContextFactory, RemoteHttpServletContextFactory, RemoteServletContextFactory, ServletContextFactory, SessionFactory, SimpleContextFactory, SimpleServletContextFactory

public interface IJavaBridgeFactory

Create JavaBridge, IContext and ISession instances.


Method Summary
 void destroy()
          Destroy the factory
 void flushBuffer()
          Flush the response buffer
 JavaBridge getBridge()
          Return the JavaBridge.
 IContext getContext()
          Return the associated JSR223 context
 ISession getSession(java.lang.String name, short clientIsNew, int timeout)
          Return a session for the JavaBridge
 void invalidate()
          Hook is called at the end of the life cycle.
 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.
 

Method Detail

getSession

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

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

IContext getContext()
Return the associated JSR223 context

Returns:
The JSR223 context, if supported by the environment or null.
See Also:
ContextFactory.getContext()

isNew

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

Returns:
true if this factory is new, false otherwise

getBridge

JavaBridge getBridge()
Return the JavaBridge.

Returns:
Returns the bridge.

recycle

void recycle()
Recycle the factory for new reqests.


destroy

void destroy()
Destroy the factory


parseHeader

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

Parameters:
req - the current request
in - the input stream
Throws:
java.io.IOException

flushBuffer

void flushBuffer()
                 throws java.io.IOException
Flush the response buffer

Throws:
java.io.IOException

invalidate

void invalidate()
Hook is called at the end of the life cycle. Either from destroy(), recycle() or from destroyOrphaned().

See Also:
destroy(), recycle()