com.caucho.loader
Class Environment

java.lang.Object
  extended by com.caucho.loader.Environment

public class Environment
extends java.lang.Object

Static utility classes.


Constructor Summary
Environment()
           
 
Method Summary
static void addChildEnvironmentListener(EnvironmentListener listener)
          Add listener.
static void addChildEnvironmentListener(EnvironmentListener listener, java.lang.ClassLoader loader)
          Add listener.
static void addChildLoaderListener(AddLoaderListener listener)
          Add listener.
static void addChildLoaderListener(AddLoaderListener listener, java.lang.ClassLoader loader)
          Add listener.
static void addClassLoaderListener(ClassLoaderListener listener)
          Add listener.
static void addClassLoaderListener(ClassLoaderListener listener, java.lang.ClassLoader loader)
          Add listener.
static void addCloseListener(java.lang.Object obj)
          Add close listener.
static void addCloseListener(java.lang.Object obj, java.lang.ClassLoader loader)
          Add close listener.
static void addDependency(Dependency depend)
          Adds a dependency to the current environment.
static void addDependency(Dependency depend, java.lang.ClassLoader loader)
          Adds a dependency to the current environment.
static void addDependency(Path path)
          Adds a dependency to the current environment.
static void addDependency(Path path, java.lang.ClassLoader loader)
          Adds a dependency to the current environment.
static void addEnvironmentListener(EnvironmentListener listener)
          Add listener.
static void addEnvironmentListener(EnvironmentListener listener, java.lang.ClassLoader loader)
          Add listener.
static void addPermission(java.security.Permission perm)
          Adds a permission to the current environment.
static void addPermission(java.security.Permission perm, java.lang.ClassLoader loader)
          Adds a permission to the current environment.
static void addStartListener(java.lang.Object obj)
          Add start listener.
static void applyVisibleModules(EnvironmentApply apply)
          Apply the action to visible classloaders
static void closeGlobal()
          destroys the current environment.
static java.lang.Object getAttribute(java.lang.String name)
          Gets a local variable for the current environment.
static java.lang.Object getAttribute(java.lang.String name, java.lang.ClassLoader loader)
          Gets a local variable for the current environment.
static java.lang.Throwable getConfigException()
          Returns any configuration exception.
static long getDependencyCheckInterval()
          Returns the current dependency check interval.
static long getDependencyCheckInterval(java.lang.ClassLoader loader)
          Returns the current dependency check interval.
static DynamicClassLoader getDynamicClassLoader()
          Returns the topmost dynamic class loader.
static DynamicClassLoader getDynamicClassLoader(java.lang.ClassLoader loader)
          Returns the topmost dynamic class loader.
static EnvironmentClassLoader getEnvironmentClassLoader()
          Returns the local environment.
static EnvironmentClassLoader getEnvironmentClassLoader(java.lang.ClassLoader loader)
          Returns the local environment.
static java.lang.String getEnvironmentName()
          Returns the environment name.
static java.lang.String getEnvironmentName(java.lang.ClassLoader loader)
          Returns the environment name.
static java.lang.Object getLevelAttribute(java.lang.String name)
          Gets a local variable for the current environment.
static java.lang.Object getLevelAttribute(java.lang.String name, java.lang.ClassLoader loader)
          Gets a local variable for the current environment.
static java.lang.String getLocalClassPath()
          Returns the classpath for the environment level.
static java.lang.String getLocalClassPath(java.lang.ClassLoader loader)
          Returns the classpath for the environment level.
static java.lang.Object getOwner()
          Gets the class loader owner.
static java.lang.Object getOwner(java.lang.ClassLoader loader)
          Gets the class loader owner.
static void init()
          Starts the current environment.
static void init(java.lang.ClassLoader loader)
          Starts the current environment.
static void initializeEnvironment()
          Initializes the environment
static boolean isLoggingInitialized()
           
static void removeEnvironmentListener(EnvironmentListener listener)
          Remove listener.
static void removeEnvironmentListener(EnvironmentListener listener, java.lang.ClassLoader loader)
          Remove listener.
static java.lang.Object setAttribute(java.lang.String name, java.lang.Object value)
          Sets a local variable for the current environment.
static java.lang.Object setAttribute(java.lang.String name, java.lang.Object value, java.lang.ClassLoader loader)
          Sets a local variable for the current environment.
static void setConfigException(java.lang.Throwable e)
          Sets a configuration exception.
static void start()
          Starts the current environment.
static void start(java.lang.ClassLoader loader)
          Starts the current environment.
static void stop()
          Starts the current environment.
static void stop(java.lang.ClassLoader loader)
          Starts the current environment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Environment

public Environment()
Method Detail

getEnvironmentClassLoader

public static EnvironmentClassLoader getEnvironmentClassLoader()
Returns the local environment.


getEnvironmentClassLoader

public static EnvironmentClassLoader getEnvironmentClassLoader(java.lang.ClassLoader loader)
Returns the local environment.


addEnvironmentListener

public static void addEnvironmentListener(EnvironmentListener listener)
Add listener.

Parameters:
listener - object to listen for environment start/stop

addEnvironmentListener

public static void addEnvironmentListener(EnvironmentListener listener,
                                          java.lang.ClassLoader loader)
Add listener.

Parameters:
listener - object to listen for environment create/destroy
loader - the context class loader

removeEnvironmentListener

public static void removeEnvironmentListener(EnvironmentListener listener)
Remove listener.

Parameters:
listener - object to listen for environment start/stop

removeEnvironmentListener

public static void removeEnvironmentListener(EnvironmentListener listener,
                                             java.lang.ClassLoader loader)
Remove listener.

Parameters:
listener - object to listen for environment create/destroy
loader - the context class loader

addChildEnvironmentListener

public static void addChildEnvironmentListener(EnvironmentListener listener)
Add listener.

Parameters:
listener - object to listen for environment create/destroy
loader - the context class loader

addChildEnvironmentListener

public static void addChildEnvironmentListener(EnvironmentListener listener,
                                               java.lang.ClassLoader loader)
Add listener.

Parameters:
listener - object to listen for environment create/destroy
loader - the context class loader

addChildLoaderListener

public static void addChildLoaderListener(AddLoaderListener listener)
Add listener.

Parameters:
listener - object to listen for environment create/destroy
loader - the context class loader

addChildLoaderListener

public static void addChildLoaderListener(AddLoaderListener listener,
                                          java.lang.ClassLoader loader)
Add listener.

Parameters:
listener - object to listen for environment create/destroy
loader - the context class loader

addClassLoaderListener

public static void addClassLoaderListener(ClassLoaderListener listener)
Add listener.

Parameters:
listener - object to listen for environment create/destroy

addClassLoaderListener

public static void addClassLoaderListener(ClassLoaderListener listener,
                                          java.lang.ClassLoader loader)
Add listener.

Parameters:
listener - object to listen for environment create/destroy
loader - the context class loader

addStartListener

public static void addStartListener(java.lang.Object obj)
Add start listener.

Parameters:
listener - object to listen for environment create/destroy
loader - the context class loader

addCloseListener

public static void addCloseListener(java.lang.Object obj)
Add close listener.

Parameters:
listener - object to listen for environment create/destroy
loader - the context class loader

addCloseListener

public static void addCloseListener(java.lang.Object obj,
                                    java.lang.ClassLoader loader)
Add close listener.

Parameters:
listener - object to listen for environment create/destroy
loader - the context class loader

init

public static void init()
Starts the current environment.


init

public static void init(java.lang.ClassLoader loader)
Starts the current environment.


start

public static void start()
                  throws StartLifecycleException
Starts the current environment.

Throws:
StartLifecycleException

start

public static void start(java.lang.ClassLoader loader)
                  throws StartLifecycleException
Starts the current environment.

Throws:
StartLifecycleException

stop

public static void stop()
Starts the current environment.


stop

public static void stop(java.lang.ClassLoader loader)
Starts the current environment.


addDependency

public static void addDependency(Dependency depend)
Adds a dependency to the current environment.

Parameters:
depend - the dependency to add

addDependency

public static void addDependency(Dependency depend,
                                 java.lang.ClassLoader loader)
Adds a dependency to the current environment.

Parameters:
depend - the dependency to add
loader - the context loader

getDynamicClassLoader

public static DynamicClassLoader getDynamicClassLoader()
Returns the topmost dynamic class loader.


getDynamicClassLoader

public static DynamicClassLoader getDynamicClassLoader(java.lang.ClassLoader loader)
Returns the topmost dynamic class loader.

Parameters:
loader - the context loader

addDependency

public static void addDependency(Path path)
Adds a dependency to the current environment.

Parameters:
depend - the dependency to add

addDependency

public static void addDependency(Path path,
                                 java.lang.ClassLoader loader)
Adds a dependency to the current environment.

Parameters:
path - the dependency to add
loader - the context loader

getAttribute

public static java.lang.Object getAttribute(java.lang.String name)
Gets a local variable for the current environment.

Parameters:
name - the attribute name
Returns:
the attribute value

getDependencyCheckInterval

public static long getDependencyCheckInterval()
Returns the current dependency check interval.


getDependencyCheckInterval

public static long getDependencyCheckInterval(java.lang.ClassLoader loader)
Returns the current dependency check interval.


getAttribute

public static java.lang.Object getAttribute(java.lang.String name,
                                            java.lang.ClassLoader loader)
Gets a local variable for the current environment.

Parameters:
name - the attribute name
loader - the context loader
Returns:
the attribute value

getLevelAttribute

public static java.lang.Object getLevelAttribute(java.lang.String name)
Gets a local variable for the current environment.

Parameters:
name - the attribute name
Returns:
the attribute value

getLevelAttribute

public static java.lang.Object getLevelAttribute(java.lang.String name,
                                                 java.lang.ClassLoader loader)
Gets a local variable for the current environment.

Parameters:
name - the attribute name
loader - the context loader
Returns:
the attribute value

setAttribute

public static java.lang.Object setAttribute(java.lang.String name,
                                            java.lang.Object value)
Sets a local variable for the current environment.

Parameters:
name - the attribute name
value - the new attribute value
Returns:
the old attribute value

setAttribute

public static java.lang.Object setAttribute(java.lang.String name,
                                            java.lang.Object value,
                                            java.lang.ClassLoader loader)
Sets a local variable for the current environment.

Parameters:
name - the attribute name
value - the new attribute value
loader - the context loader
Returns:
the old attribute value

addPermission

public static void addPermission(java.security.Permission perm)
Adds a permission to the current environment.

Parameters:
perm - the permission to add.

addPermission

public static void addPermission(java.security.Permission perm,
                                 java.lang.ClassLoader loader)
Adds a permission to the current environment.

Parameters:
perm - the permission to add.

getOwner

public static java.lang.Object getOwner()
Gets the class loader owner.


getOwner

public static java.lang.Object getOwner(java.lang.ClassLoader loader)
Gets the class loader owner.


setConfigException

public static void setConfigException(java.lang.Throwable e)
Sets a configuration exception.


getConfigException

public static java.lang.Throwable getConfigException()
Returns any configuration exception.


getEnvironmentName

public static java.lang.String getEnvironmentName()
Returns the environment name.


getEnvironmentName

public static java.lang.String getEnvironmentName(java.lang.ClassLoader loader)
Returns the environment name.


applyVisibleModules

public static void applyVisibleModules(EnvironmentApply apply)
Apply the action to visible classloaders


getLocalClassPath

public static java.lang.String getLocalClassPath()
Returns the classpath for the environment level.


getLocalClassPath

public static java.lang.String getLocalClassPath(java.lang.ClassLoader loader)
Returns the classpath for the environment level.


closeGlobal

public static void closeGlobal()
destroys the current environment.


isLoggingInitialized

public static boolean isLoggingInitialized()
Returns:

initializeEnvironment

public static void initializeEnvironment()
Initializes the environment