com.sun.sgs.internal
Class InternalContext

java.lang.Object
  extended by com.sun.sgs.internal.InternalContext

public final class InternalContext
extends Object

Provides a pluggable mechanism for replacing the ManagerLocator used by the application to get Managers from the Project Darkstar stack through the AppContext. This class should not be instantiated.


Method Summary
static ManagerLocator getManagerLocator()
          Returns the ManagerLocator for use by the current application.
static void setManagerLocator(ManagerLocator managerLocator)
          Sets the ManagerLocator which is used to retrieve managers for the application.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getManagerLocator

public static ManagerLocator getManagerLocator()
Returns the ManagerLocator for use by the current application. This method is used by the AppContext to retrieve Managers from the Project Darkstar stack. Generally, it should not need to be called by an application.

Returns:
the ManagerLocator for the current application
Throws:
IllegalStateException - if the ManagerLocator is uninitialized

setManagerLocator

public static void setManagerLocator(ManagerLocator managerLocator)
Sets the ManagerLocator which is used to retrieve managers for the application.

In most situations, this method should only be called once upon bootup of a Project Darkstar container. It is also useful for swapping out implementations of the Project Darkstar stack for testing purposes. Typically, an application should never have a reason to call this method, and doing so could cause unexpected results.

Specifying null for managerLocator sets the ManagerLocator back to its original, uninitialized state.

Parameters:
managerLocator - the ManagerLocator that the InternalContext should use to retrieve managers or null to make it uninitialized

Project Darkstar, Version 0.9.9.6
2009-05-08 15:39:40

Copyright © 2007-2009 Sun Microsystems, Inc. All rights reserved