mcconnell 02/03/04 01:06:26
Modified: enterprise/tools/lib merlin.jar
enterprise/tools/src/java/org/apache/avalon/excalibur/service
ServiceLoader.java ServiceLoaderContext.java
Log:
context cleanup
Revision Changes Path
1.6 +81 -80 jakarta-avalon-apps/enterprise/tools/lib/merlin.jar
<<Binary file>>
1.4 +12 -14
jakarta-avalon-apps/enterprise/tools/src/java/org/apache/avalon/excalibur/service/ServiceLoader.java
Index: ServiceLoader.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-apps/enterprise/tools/src/java/org/apache/avalon/excalibur/service/ServiceLoader.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ServiceLoader.java 4 Mar 2002 04:39:37 -0000 1.3
+++ ServiceLoader.java 4 Mar 2002 09:06:26 -0000 1.4
@@ -120,14 +120,6 @@
* that may be instantiated during the recursive dependecy resolution
process.
* </td></tr>
* <tr>
- * <td width="20%" valign="top"><code>CONFIGURATION_FILE_KEY</code></td>
- * <td>
- * A <code>File</code> instance that may or may not exist. If the file
exists and is
- * confiugration, it will be used as the base configuration reference when
looking up
- * service configuration details. The default behaviour is to look for a
file named
- * "config.xml" in the user's working directory.
- * </td></tr>
- * <tr>
* <td width="20%" valign="top"><code>DISPOSAL_POLICY_KEY</code></td>
* <td>
* A <code>Boolean</code> value that is applied on completionof the startup
of a
@@ -174,7 +166,6 @@
private String[] m_args;
private PipelineClassLoader m_classloader;
- private Priority m_priority = Priority.INFO;
private String m_target;
private Object m_object;
private File[] m_includes;
@@ -270,8 +261,7 @@
{
CLI cli = new CLI( args );
- ServiceLoaderContext context = cli.getContext();
- Hierarchy hierarchy = createBootstrapLogger(
context.getLoggingPriority() );
+ Hierarchy hierarchy = createBootstrapLogger(
cli.getLoggingPriority() );
Logger logger = new LogKitLogger( hierarchy.getLoggerFor(
"loader" ) );
File path = cli.getConfigurationPath();
@@ -281,7 +271,7 @@
pipeline = new ServiceLoader();
pipeline.enableLogging( logger );
pipeline.configure( config );
- pipeline.contextualize( context );
+ pipeline.contextualize( cli.getContext() );
pipeline.initialize();
}
catch( IllegalParameterException ipe )
@@ -338,7 +328,6 @@
ServiceLoaderContext c = (ServiceLoaderContext) context;
m_includes = c.getIncludes();
m_verbose = c.getVerbose();
- m_priority = c.getLoggingPriority();
m_policy = c.getDisposalPolicy();
m_target = c.getTarget();
}
@@ -813,12 +802,21 @@
public ServiceLoaderContext getContext()
{
- return new ServiceLoaderContext( m_args, m_target, m_files,
m_policy, m_priority, m_verbose );
+ return new ServiceLoaderContext( m_args, m_target, m_files,
m_policy, m_verbose );
}
public File getConfigurationPath()
{
return m_path;
+ }
+
+ /**
+ * Returns the logging priority.
+ * @return Priority the logging priority to apply.
+ */
+ public Priority getLoggingPriority()
+ {
+ return m_priority;
}
}
}
1.2 +1 -25
jakarta-avalon-apps/enterprise/tools/src/java/org/apache/avalon/excalibur/service/ServiceLoaderContext.java
Index: ServiceLoaderContext.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-apps/enterprise/tools/src/java/org/apache/avalon/excalibur/service/ServiceLoaderContext.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ServiceLoaderContext.java 3 Mar 2002 15:45:58 -0000 1.1
+++ ServiceLoaderContext.java 4 Mar 2002 09:06:26 -0000 1.2
@@ -52,12 +52,6 @@
public static final String DISPOSAL_POLICY_KEY = "DISPOSAL.POLICY";
/**
- * Context key for the logging priority.
- * @see #getLoggingPriority()
- */
- public static final String LOGGING_PRIORITY_KEY = "LOGGING.PRIORITY";
-
- /**
* Context key for the verbose policy.
* @see #getVerbose()
*/
@@ -73,7 +67,7 @@
* @param priority logging priority
* @param verbose policy concerning display of loader debug messages
*/
- public ServiceLoaderContext( final String[] args, final String target,
final File[] includes, final boolean disposal, final Priority priority, final
boolean verbose )
+ public ServiceLoaderContext( final String[] args, final String target,
final File[] includes, final boolean disposal, final boolean verbose )
{
super.put( ARGS_KEY, args );
super.put( TARGET_KEY, target );
@@ -81,7 +75,6 @@
super.put( INCLUDES_KEY, includes );
super.put( DISPOSAL_POLICY_KEY, new Boolean( disposal ));
super.put( VERBOSE_POLICY_KEY, new Boolean( verbose ));
- super.put( LOGGING_PRIORITY_KEY, priority );
}
/**
@@ -166,23 +159,6 @@
catch( ContextException e )
{
final String error = "Unexpected exception while retrieving
include files.";
- throw new PipelineRuntimeException( error, e );
- }
- }
-
- /**
- * Returns the logging priority.
- * @return Priority the logging priority to apply.
- */
- public Priority getLoggingPriority()
- {
- try
- {
- return (Priority) super.get( LOGGING_PRIORITY_KEY );
- }
- catch( ContextException e )
- {
- final String error = "Unexpected exception while retrieving
logging priority.";
throw new PipelineRuntimeException( error, e );
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>