php.java.bridge
Class JavaBridgeFactory

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

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

Create new JavaBridge instances

Author:
jostb
See Also:
Session, Context, Context, 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  SimpleJavaBridgeClassLoader getJavaBridgeClassLoader()
          Return an instance of the JavaBridgeClassLoader
abstract  ISession getSession(boolean clientIsNew, int timeout)
          Return an anonymous session for internal use.
abstract  ISession getSession(java.lang.String name, boolean clientIsNew, int timeout)
          Return a session for the JavaBridge
 boolean isNew()
          Return true if this factory has already created a bridge or not.
 void recycle()
          Recycle the factory for new reqests.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaBridgeFactory

public JavaBridgeFactory()
Method Detail

getJavaBridgeClassLoader

public abstract SimpleJavaBridgeClassLoader getJavaBridgeClassLoader()
Return an instance of the JavaBridgeClassLoader

Specified by:
getJavaBridgeClassLoader in interface IJavaBridgeFactory
Returns:
The JavaBridgeClassLoader
See Also:
Util.getContextClassLoader()

getSession

public abstract ISession getSession(java.lang.String name,
                                    boolean 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 - true if the client wants a new session
timeout - timeout in seconds. If 0 the session does not expire.
Returns:
The session
See Also:
ISession

getSession

public abstract ISession getSession(boolean clientIsNew,
                                    int timeout)
Return an anonymous session for internal use.

Specified by:
getSession in interface IJavaBridgeFactory
Parameters:
clientIsNew - true if the client wants a new session
timeout - timeout in seconds. If 0 the session does not expire.
Returns:
The session

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