You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2003/10/28 11:34:26 UTC
cvs commit: avalon/merlin/kernel/loader/src/java/org/apache/avalon/merlin KernelDefaults.java KernelParameters.java merlin.properties
mcconnell 2003/10/28 02:34:26
Modified: merlin/kernel/loader/src/java/org/apache/avalon/merlin
KernelDefaults.java KernelParameters.java
merlin.properties
Log:
Update property names and default values.
Revision Changes Path
1.4 +52 -27 avalon/merlin/kernel/loader/src/java/org/apache/avalon/merlin/KernelDefaults.java
Index: KernelDefaults.java
===================================================================
RCS file: /home/cvs/avalon/merlin/kernel/loader/src/java/org/apache/avalon/merlin/KernelDefaults.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- KernelDefaults.java 28 Oct 2003 09:02:40 -0000 1.3
+++ KernelDefaults.java 28 Oct 2003 10:34:26 -0000 1.4
@@ -82,17 +82,17 @@
{
private static final String [] s_keys =
{
- "merlin.kernel.isserver",
- "merlin.kernel.isinfo",
- "merlin.kernel.isdebug",
- "merlin.kernel.remoterepo",
- "merlin.kernel.userrepo",
- "merlin.kernel.systemrepo",
- "merlin.kernel.homepath",
- "merlin.kernel.configurl",
- "merlin.kernel.kernelurl",
+ "merlin.policy.server",
+ "merlin.policy.info",
+ "merlin.policy.debug",
+ "merlin.repository.remote.urls",
+ "merlin.repository.user.path",
+ "merlin.repository.system.path",
+ "merlin.work.path",
+ "merlin.config.url",
+ "merlin.kernel.url",
"java.io.tmpdir",
- "merlin.kernel.librarypath"
+ "merlin.library.path"
} ;
@@ -142,9 +142,11 @@
*/
private static void loadDefaults()
{
- /*
- * Stage I - load the default properties bundled with this jar
- */
+ //
+ // Stage I - load the default properties bundled with this
+ // jar under the resource name MERLIN_FILE_BASE. This set the
+ // primative defaults.
+ //
InputStream l_in =
KernelDefaults.class.getResourceAsStream( MERLIN_FILE_BASE ) ;
@@ -158,13 +160,27 @@
e.printStackTrace( System.err ) ;
}
- /*
- * Stage II - get some properties from the shell environment
- */
+ //
+ // Stage II - get some properties from the environment.
+ //
+
File l_merlinHome = null ;
try
{
- l_merlinHome = new File( Env.getVariable( "MERLIN_HOME" ) ) ;
+ final String merlinHomeEnv = Env.getVariable( "MERLIN_HOME" );
+ if( merlinHomeEnv != null )
+ {
+ l_merlinHome = new File( merlinHomeEnv ) ;
+ }
+ else
+ {
+ final String userHome = System.getProperty( "user.home" );
+ if( userHome != null )
+ {
+ File userDir = new File( userHome );
+ l_merlinHome = new File( userDir, ".merlin" ) ;
+ }
+ }
}
catch( EnvAccessException e )
{
@@ -180,6 +196,11 @@
l_sysRepo.getAbsolutePath() ) ;
}
+ //
+ // TODO need to provide support for an env supplied
+ // user repository override value
+ //
+
File l_userRepo = new File( l_merlinHome, "repository" ) ;
if ( l_userRepo.exists() )
{
@@ -188,10 +209,11 @@
}
}
- /*
- * Stage III - check for overriding values of .merlin.properties within
- * the user's home directory.
- */
+ //
+ // Stage III - check for overriding values of .merlin.properties within
+ // the user's home directory.
+ //
+
String l_userHome = System.getProperty( "user.home" ) ;
File l_userProps = new File( l_userHome, "." + MERLIN_FILE_BASE ) ;
if ( l_userProps.exists() )
@@ -206,9 +228,10 @@
}
}
- /*
- * Stage IV - Check for overriding values within the System properties
- */
+ //
+ // Stage IV - Check for overriding values within the System properties.
+ //
+
for( int ii = 0; ii < s_keys.length; ii++ )
{
/*
@@ -223,7 +246,10 @@
}
}
- // Now we overlay all the targets properties defined
+ //
+ // Now we overlay all the block properties defined
+ //
+
Enumeration l_list = System.getProperties().keys() ;
while ( l_list.hasMoreElements() )
{
@@ -298,7 +324,6 @@
}
}
return ( String [] ) l_urlArray.toArray( new String [0] ) ;
-
}
1.3 +2 -10 avalon/merlin/kernel/loader/src/java/org/apache/avalon/merlin/KernelParameters.java
Index: KernelParameters.java
===================================================================
RCS file: /home/cvs/avalon/merlin/kernel/loader/src/java/org/apache/avalon/merlin/KernelParameters.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- KernelParameters.java 28 Oct 2003 09:02:40 -0000 1.2
+++ KernelParameters.java 28 Oct 2003 10:34:26 -0000 1.3
@@ -54,14 +54,6 @@
* This class represents an exhaustive set of kernel parameters in their most
* rudimentary/common representation.
*
- * Note I avoided the use of Files or URLs purposely so any value can be
- * specified and interpreted in any fashion. I left this as general and
- * flexible as possible.
- *
- * These methods have been gathered from other methods an members witnessed on
- * the CLIKernelLoader, KernelContext[Default], and KernelBean classes/
- * interfaces.
- *
* @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
* @author $Author$
* @version $Revision$
@@ -92,7 +84,7 @@
boolean isInfoEnabled() ;
/**
- * Urls of a set of potentially remote repository used to pull
+ * Urls of a set of potentially remote repositories used to pull
* depenendencies into the other repositories on artifact misses.
*
* @return urls to the remote repositories from where we download resources
1.2 +39 -2 avalon/merlin/kernel/loader/src/java/org/apache/avalon/merlin/merlin.properties
Index: merlin.properties
===================================================================
RCS file: /home/cvs/avalon/merlin/kernel/loader/src/java/org/apache/avalon/merlin/merlin.properties,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- merlin.properties 27 Oct 2003 23:50:47 -0000 1.1
+++ merlin.properties 28 Oct 2003 10:34:26 -0000 1.2
@@ -1,3 +1,40 @@
-#start
-#foo=bar
+#
+# The default server mode policy.
+merlin.policy.server=true
+
+#
+# The default environment info reporting policy.
+merlin.policy.info=false
+
+#
+# The default debug policy.
+merlin.policy.debug=false
+
+#
+# A comma seperated list of urls to remote repositories.
+#merlin.repository.remote.urls
+
+#
+# The user repository path - defaults to ${merlin.home}/repository
+#merlin.repository.user.path
+
+#
+# The system repository path - defaults to ${merlin.home}/system
+#merlin.repository.system.path
+
+#
+# The working directory path - defaults to ${user.dir}
+#merlin.work.path
+
+#
+# URL to a configuration override - no default
+#merlin.config.url
+
+#
+# URL to the kernel defintion - defaults to ${merlin.home}/config/kernel.xml
+merlin.kernel.url
+
+#
+# Path to the library anchor directory - defaults to ${user.dir}
+#merlin.library.path
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org