mcconnell 2003/02/17 04:08:47
Modified: assembly/src/test/org/apache/avalon/playground
ComplexComponent.java SimpleComponent.java
assembly/src/test/org/apache/avalon/playground/basic
BasicComponent.java
Log:
Made logging messages on demo components more verbose so that its easier to see what
is happenning at the target component lifecycle level.
Revision Changes Path
1.6 +7 -8
avalon-sandbox/assembly/src/test/org/apache/avalon/playground/ComplexComponent.java
Index: ComplexComponent.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/assembly/src/test/org/apache/avalon/playground/ComplexComponent.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ComplexComponent.java 7 Feb 2003 15:39:15 -0000 1.5
+++ ComplexComponent.java 17 Feb 2003 12:08:47 -0000 1.6
@@ -116,9 +116,9 @@
public void initialize()
throws Exception
{
- if( getLogger().isDebugEnabled() )
+ if( getLogger().isInfoEnabled() )
{
- getLogger().debug( "initialize" );
+ getLogger().info( "initialize" );
}
//
@@ -161,7 +161,7 @@
*/
public void start() throws Exception
{
- getLogger().debug( "starting" );
+ getLogger().info( "starting" );
m_continue = true;
m_thread = new Thread(
new Runnable()
@@ -183,7 +183,7 @@
}
);
m_thread.start();
- getLogger().debug( "started" );
+ getLogger().info( "started" );
}
/**
@@ -191,7 +191,7 @@
*/
public void stop()
{
- getLogger().debug( "stopping" );
+ getLogger().info( "stopping" );
m_continue = false;
try
{
@@ -213,14 +213,13 @@
*/
public void dispose()
{
- if( getLogger().isDebugEnabled() )
+ if( getLogger().isInfoEnabled() )
{
- getLogger().debug( "dispose" );
+ getLogger().info( "dispose" );
}
m_manager.release( m_simple );
m_manager.release( m_basic );
m_manager = null;
}
-
}
1.5 +9 -9
avalon-sandbox/assembly/src/test/org/apache/avalon/playground/SimpleComponent.java
Index: SimpleComponent.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/assembly/src/test/org/apache/avalon/playground/SimpleComponent.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SimpleComponent.java 7 Feb 2003 15:39:26 -0000 1.4
+++ SimpleComponent.java 17 Feb 2003 12:08:47 -0000 1.5
@@ -92,7 +92,7 @@
*/
public void configure( Configuration config )
{
- getLogger().debug( "configure" );
+ getLogger().info( "configure" );
m_message = config.getChild( "message" ).getValue( null );
}
@@ -107,7 +107,7 @@
*/
public void service( ServiceManager manager ) throws ServiceException
{
- getLogger().debug( "service" );
+ getLogger().info( "service" );
m_basic = (BasicService)manager.lookup( "basic" );
manager.release( m_basic );
}
@@ -121,7 +121,7 @@
*/
public void incarnate()
{
- getLogger().debug( "incarnation stage" );
+ getLogger().info( "incarnation stage" );
}
/**
@@ -129,7 +129,7 @@
*/
public void etherialize()
{
- getLogger().debug( "etherialize stage" );
+ getLogger().info( "etherialize stage" );
}
@@ -143,7 +143,7 @@
*/
public void demo( String message )
{
- getLogger().info( message );
+ getLogger().info( "handling demonstratable stage: " + message );
}
//=======================================================================
@@ -155,7 +155,7 @@
*/
public void initialize()
{
- getLogger().debug( "initialize" );
+ getLogger().info( "initialize" );
getLogger().debug( "context: " +
Thread.currentThread().getContextClassLoader() );
doObjective();
}
@@ -200,7 +200,7 @@
*/
public void stop()
{
- getLogger().debug( "stopping" );
+ getLogger().info( "stopping" );
m_continuation = false;
try
{
@@ -221,7 +221,7 @@
*/
public void dispose()
{
- getLogger().debug( "dispose" );
+ getLogger().info( "dispose" );
}
//=======================================================================
@@ -233,7 +233,7 @@
*/
public void doObjective()
{
- getLogger().info( "message: " + m_message );
+ getLogger().info( "handling service operation: " + m_message );
}
}
1.3 +11 -5
avalon-sandbox/assembly/src/test/org/apache/avalon/playground/basic/BasicComponent.java
Index: BasicComponent.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/assembly/src/test/org/apache/avalon/playground/basic/BasicComponent.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- BasicComponent.java 7 Feb 2003 15:39:26 -0000 1.2
+++ BasicComponent.java 17 Feb 2003 12:08:47 -0000 1.3
@@ -79,6 +79,7 @@
private String m_location;
private String m_message;
private File m_home;
+ private boolean m_started = false;
//=======================================================================
// Contextualizable
@@ -105,7 +106,7 @@
*/
public void configure( Configuration config )
{
- getLogger().debug( "configure" );
+ getLogger().info( "configure" );
m_message = config.getChild( "message" ).getValue( null );
}
@@ -118,7 +119,7 @@
*/
public void initialize()
{
- getLogger().debug( "initialize" );
+ getLogger().info( "initialize" );
getLogger().debug( "location: " + m_location );
getLogger().debug( "home: " + m_home );
getLogger().debug( "message: " + m_message );
@@ -133,7 +134,12 @@
*/
public void start()
{
- doPrimeObjective();
+ if( !m_started )
+ {
+ getLogger().info( "starting" );
+ doPrimeObjective();
+ m_started = true;
+ }
}
/**
@@ -141,7 +147,7 @@
*/
public void stop()
{
- getLogger().debug( "stopping" );
+ getLogger().info( "stopping" );
}
/**
@@ -149,7 +155,7 @@
*/
public void dispose()
{
- getLogger().debug( "dispose" );
+ getLogger().info( "dispose" );
}
//=======================================================================
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]