notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r2203 - development/main/metro/system/impl/src/main/net/dpml/system/impl
- From: mcconnell AT dpml.net
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r2203 - development/main/metro/system/impl/src/main/net/dpml/system/impl
- Date: Mon, 04 Apr 2005 06:10:07 -0400
Author: mcconnell AT dpml.net
Date: Mon Apr 4 06:10:05 2005
New Revision: 2203
Modified:
development/main/metro/system/impl/src/main/net/dpml/system/impl/DefaultSystemContextFactory.java
Log:
Improve handling of the debug mode setting (allow strings as well as Boolean
instances).
Modified:
development/main/metro/system/impl/src/main/net/dpml/system/impl/DefaultSystemContextFactory.java
==============================================================================
---
development/main/metro/system/impl/src/main/net/dpml/system/impl/DefaultSystemContextFactory.java
(original)
+++
development/main/metro/system/impl/src/main/net/dpml/system/impl/DefaultSystemContextFactory.java
Mon Apr 4 06:10:05 2005
@@ -112,6 +112,35 @@
// constructors
//
------------------------------------------------------------------------
+ private boolean resolveDebugMode( Map map )
+ {
+ Object object = map.get( "urn:transit.debug.policy" );
+ if( null == object )
+ {
+ return false;
+ }
+ else
+ {
+ if( object instanceof Boolean )
+ {
+ Boolean debug = (Boolean) object;
+ return debug.booleanValue();
+ }
+ else if( object instanceof String )
+ {
+ Boolean debug = new Boolean( (String) object );
+ return debug.booleanValue();
+ }
+ else
+ {
+ final String error =
+ "Unrecognized boolean argument class ["
+ + object.getClass().getName();
+ throw new IllegalStateException( error );
+ }
+ }
+ }
+
public DefaultSystemContextFactory(
Map map, Repository repository, String[] args )
throws Exception
@@ -121,16 +150,7 @@
assertNotNull( "args", args );
m_params = map;
-
- Boolean debug = (Boolean) map.get( "urn:transit.debug.policy" );
- if( null == debug )
- {
- m_DebugMode = false;
- }
- else
- {
- m_DebugMode = debug.booleanValue();
- }
+ m_DebugMode = resolveDebugMode( map );
Options options = buildCommandLineOptions();
ArgumentHandler handler = new ArgumentHandler( args );
- svn commit: r2203 - development/main/metro/system/impl/src/main/net/dpml/system/impl, mcconnell, 04/03/2005
Archive powered by MHonArc 2.6.24.