php.java.bridge
Interface IManaged

All Known Subinterfaces:
IPhpScriptContext
All Known Implementing Classes:
AbstractPhpScriptContext, Context, HttpContext, PhpCompiledScriptContext, PhpHttpScriptContext, PhpJavaBridgeRunnerScriptContext, PhpScriptContext, PhpScriptContextDecorator, PhpSecureScriptContext, RemoteContext

public interface IManaged

Classes which implement this interface receive a notification before their container terminates. This usually happens when the ContextLoaderListener.contextDestroyed(javax.servlet.ServletContextEvent) is called or right before the VM terminates.

Author:
jostb

Method Summary
 java.lang.Object init(java.lang.Object callable)
          Initialize a library.
 void onShutdown(java.lang.Object closeable)
          Register a shutdown hook for the library.
 

Method Detail

init

java.lang.Object init(java.lang.Object callable)
                      throws java.lang.Exception
Initialize a library. This method may be called via java_context()->init(...) to initialize a library. Within init() onShutdown() may be called to register a shutdown hook for the library.

Parameters:
callable - Its call() method will be called synchronized.
Returns:
The result of the call() invocation.
Throws:
java.lang.Exception - The result of the call() invocation.

onShutdown

void onShutdown(java.lang.Object closeable)
Register a shutdown hook for the library. This method may be called via java_context()->onShutdown(...) to register a shutdown hook during init().

Parameters:
closeable - Its close() method will be called before the context or the VM terminates.