org.apache.cocoon.spring.configurator.impl
Class RunningModeHelper

java.lang.Object
  extended byorg.apache.cocoon.spring.configurator.impl.RunningModeHelper

public abstract class RunningModeHelper
extends Object

Helper class to determine the running mode.

Since:
1.0
Version:
$Id: RunningModeHelper.java 587750 2007-10-24 02:35:22Z vgritsenko $

Field Summary
static String PROPERTY_RUNNING_MODE
          Name of the system property specifying the running mode.
 
Constructor Summary
RunningModeHelper()
           
 
Method Summary
static void checkRunningMode(String mode)
          Check if the value for the running mode is valid.
static String determineRunningMode(String mode)
          Determine the running mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_RUNNING_MODE

public static final String PROPERTY_RUNNING_MODE
Name of the system property specifying the running mode.

See Also:
Constant Field Values
Constructor Detail

RunningModeHelper

public RunningModeHelper()
Method Detail

determineRunningMode

public static String determineRunningMode(String mode)
Determine the running mode. A non-null system property will have precedence over everything else. The system default running mode will be used if the passed parameter mode is null.

Parameters:
mode - The default running mode.
Returns:
The current running mode.
See Also:
PROPERTY_RUNNING_MODE, SettingsDefaults.DEFAULT_RUNNING_MODE

checkRunningMode

public static void checkRunningMode(String mode)
                             throws IllegalArgumentException
Check if the value for the running mode is valid. Currently this method does not check anything. All modes (apart from null) are valid.

Parameters:
mode - Check if the mode is a valid mode.
Throws:
IllegalArgumentException - if the mode is invalid


Copyright © 1999-2008 The Apache Software Foundation. All Rights Reserved.