org.virtualmock.util
Class Toolbox

java.lang.Object
  extended byorg.virtualmock.util.Toolbox

public class Toolbox
extends java.lang.Object

A singleton which manages single instances of other application components. Based on template provided at: http://www.ibm.com/developerworks/webservices/library/co-single.html

Version:
$Revision: 1.16 $
Author:
Chad Woolley

Field Summary
static java.lang.String CALL_MANAGER
          The constant key for the CallManager instance in the Toolbox.
 
Constructor Summary
protected Toolbox()
          Creates a new Toolbox object.
 
Method Summary
static void deregisterAllComponents()
          Deregisters all components.
static void deregisterComponent(java.lang.String componentName)
          Deregisters a component from the Toolbox.
static CallManager getCallManager()
          Gets the CallManager from the Toolbox.
static java.lang.Object getComponent(java.lang.String componentName)
          Gets a component from the Toolbox.
static Toolbox getInstance()
          Gets the singleton instance.
protected  void initialize()
          Performs any custom initialization of the Toolbox.
static void registerComponent(java.lang.String componentName, java.lang.Object component)
          Registers a component in the Toolbox.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CALL_MANAGER

public static final java.lang.String CALL_MANAGER
The constant key for the CallManager instance in the Toolbox.

See Also:
Constant Field Values
Constructor Detail

Toolbox

protected Toolbox()
Creates a new Toolbox object.

Method Detail

getCallManager

public static CallManager getCallManager()
Gets the CallManager from the Toolbox.

Returns:
the CallManager from the Toolbox

getComponent

public static java.lang.Object getComponent(java.lang.String componentName)
Gets a component from the Toolbox.

Parameters:
componentName - the name of the component to get. Corresponds to a constant on the Toolbox class.
Returns:
the component

getInstance

public static Toolbox getInstance()
Gets the singleton instance.

Returns:
the singleton instance

deregisterAllComponents

public static void deregisterAllComponents()
Deregisters all components.


deregisterComponent

public static void deregisterComponent(java.lang.String componentName)
Deregisters a component from the Toolbox.

Parameters:
componentName - the component to deregister

registerComponent

public static void registerComponent(java.lang.String componentName,
                                     java.lang.Object component)
Registers a component in the Toolbox.

Parameters:
componentName - the key for the component to register. Corresponds to a constant on the Toolbox class.
component - the component to register

initialize

protected void initialize()
Performs any custom initialization of the Toolbox.



Copyright © 2003-2005 Virtual Mock. All Rights Reserved.