org.sape.carbon.core.component
Interface ComponentKeeperConfiguration

All Superinterfaces:
Configuration

public interface ComponentKeeperConfiguration
extends Configuration

Configuration interface for the ComponentKeeper.

Copyright 2002 Sapient

Since:
carbon 1.0
Version:
$Revision: 1.14 $($Author: dvoet $ / $Date: 2003/05/05 21:21:11 $)
Author:
Douglas Voet, January 2002

Field Summary
static boolean RegisterShutdownHook
          The default for if a shutdown hook should be registered with the JVM.
 
Method Summary
 ComponentFactoryConfiguration getComponentFactoryConfiguration()
          Gets the Class implementing ComponentFactory that the keeper will instantiate and use to build all components.
 Class getComponentKeeperFactoryClass()
          Gets the Class implementing ComponentKeeper that the Core Carbon will use.
 long getNewComponentCheckInterval()
          Gets the number of milliseconds a thread should wait between checks to see if a component has been created or not.
 boolean isRegisterShutdownHook()
          Determines if the component keeper should register a shutdown hook with the JVM in order to gracefully shutdown components.
 void setComponentKeeperFactoryClass(Class value)
          Sets the Class that implements the component keeper factory.
 void setNewComponentCheckInterval(long value)
          Sets the delay time for how long a component may take to start.
 void setRegisterShutdownHook(boolean value)
          Sets the configuration for if a shutdown hook should be registered with the JVM.
 
Methods inherited from interface org.sape.carbon.core.config.Configuration
clone, getConfigurationInterface, getConfigurationName, getDataStructure, getRootElement, isConfigurationWritable, setConfigurationName, setConfigurationReadOnly
 

Field Detail

RegisterShutdownHook

public static final boolean RegisterShutdownHook
The default for if a shutdown hook should be registered with the JVM. Defaults to true.

See Also:
Constant Field Values
Method Detail

getComponentKeeperFactoryClass

public Class getComponentKeeperFactoryClass()

Gets the Class implementing ComponentKeeper that the Core Carbon will use.

Returns:
Class object for a class implementing ComponentKeeper

setComponentKeeperFactoryClass

public void setComponentKeeperFactoryClass(Class value)
Sets the Class that implements the component keeper factory.

Parameters:
value - The implementing Class for the component keeper factory.

getComponentFactoryConfiguration

public ComponentFactoryConfiguration getComponentFactoryConfiguration()

Gets the Class implementing ComponentFactory that the keeper will instantiate and use to build all components.

Returns:
ComponentFactoryConfiguration object used to configure the ComponentFactory used in the keeper

getNewComponentCheckInterval

public long getNewComponentCheckInterval()

Gets the number of milliseconds a thread should wait between checks to see if a component has been created or not. This is used when there are concurrent requests for the same component that have yet to be constructed. All threads waiting for the first thread to build the component will check the status at this interval.

If this value is too short, performance of the system will degrade. If this value is too long, there will be RARE cases of threads taking at least this long return from fetchComponent. This value should never be zero or else there may be cases of threads blocking forever.

Returns:
Class object for a class implementing ComponentFactory

setNewComponentCheckInterval

public void setNewComponentCheckInterval(long value)
Sets the delay time for how long a component may take to start. If a component takes longer than this amount of time, the operation will timeout.

Parameters:
value - the amount of time, in milleseconds, that a component may take to start.

isRegisterShutdownHook

public boolean isRegisterShutdownHook()

Determines if the component keeper should register a shutdown hook with the JVM in order to gracefully shutdown components. This results in the addition of a stopped thread object waiting for the JVM's shutdown system to initiate hooks.

Returns:
true if a shutdown hook should be registered, false otherwise

setRegisterShutdownHook

public void setRegisterShutdownHook(boolean value)
Sets the configuration for if a shutdown hook should be registered with the JVM.

Parameters:
value - true if Carbon should register a JVM hook in order to shutdown all component gracefully when the JVM terminates. False otherwise.


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.