colus 02/04/30 08:54:54
Modified: src/java/org/apache/avalon/phoenix/components/kernel
DefaultKernel.java
src/java/org/apache/avalon/phoenix/components/application
DefaultApplication.java
Log:
Zap tab.
Added braces.
Revision Changes Path
1.57 +4 -4
jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel/DefaultKernel.java
Index: DefaultKernel.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel/DefaultKernel.java,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- DefaultKernel.java 30 Apr 2002 10:22:52 -0000 1.56
+++ DefaultKernel.java 30 Apr 2002 15:54:53 -0000 1.57
@@ -95,13 +95,13 @@
{
final SarEntry entry = (SarEntry)m_entrys.get( name );
if( null == entry )
- {
+ {
return null;
- }
+ }
else
- {
+ {
return entry.getApplication();
- }
+ }
}
/**
1.13 +54 -51
jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/DefaultApplication.java
Index: DefaultApplication.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/DefaultApplication.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- DefaultApplication.java 30 Apr 2002 09:45:16 -0000 1.12
+++ DefaultApplication.java 30 Apr 2002 15:54:54 -0000 1.13
@@ -10,10 +10,10 @@
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
+import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.avalon.excalibur.i18n.ResourceManager;
import org.apache.avalon.excalibur.i18n.Resources;
import org.apache.excalibur.threadcontext.ThreadContext;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.avalon.phoenix.ApplicationEvent;
import org.apache.avalon.phoenix.Block;
import org.apache.avalon.phoenix.interfaces.Application;
@@ -76,14 +76,16 @@
public void start()
throws IllegalStateException, ApplicationException
{
- if( isRunning() )
+ if ( isRunning() )
+ {
throw new IllegalStateException();
+ }
else
{
try
{
final BlockMetaData[] blocks =
m_context.getMetaData().getBlocks();
- for( int i = 0; i < blocks.length; i++ )
+ for ( int i = 0; i < blocks.length; i++ )
{
final String blockName = blocks[ i ].getName();
final BlockEntry blockEntry = new BlockEntry( blocks[ i
] );
@@ -96,7 +98,7 @@
// load blocks
runPhase( PHASE_STARTUP );
}
- catch( Throwable t )
+ catch ( final Throwable t )
{
getLogger().info( "exception while starting:" +
t.getMessage() + "\n" );
t.printStackTrace();
@@ -139,15 +141,17 @@
public void stop()
throws IllegalStateException, ApplicationException
{
- if( !isRunning() )
+ if ( !isRunning() )
+ {
throw new IllegalStateException();
+ }
else
{
try
{
runPhase( PHASE_SHUTDOWN );
}
- catch( Throwable t )
+ catch ( final Throwable t )
{
getLogger().info( "exception while stopping:" +
t.getMessage() + "\n" );
t.printStackTrace();
@@ -181,7 +185,7 @@
public Block getBlock( final String name )
{
final BlockEntry entry = (BlockEntry)m_entrys.get( name );
- if( null == entry ) return null;
+ if ( null == entry ) return null;
return entry.getProxy();
}
@@ -246,40 +250,40 @@
//Setup thread context for calling visitors
ThreadContext.setThreadContext( m_context.getThreadContext() );
- try
- {
- doLoadBlockListeners();
- }
- finally
- {
- ThreadContext.setThreadContext( null );
- }
+ try
+ {
+ doLoadBlockListeners();
+ }
+ finally
+ {
+ ThreadContext.setThreadContext( null );
+ }
}
/**
* Actually perform loading of each individual Listener.
- * Note that by this stage it is assumed that the ThreadContext
+ * Note that by this stage it is assumed that the ThreadContext
* has already been setup correctly.
*/
private void doLoadBlockListeners()
- throws Exception
+ throws Exception
{
- final BlockListenerMetaData[] listeners =
m_context.getMetaData().getListeners();
- for( int i = 0; i < listeners.length; i++ )
+ final BlockListenerMetaData[] listeners =
m_context.getMetaData().getListeners();
+ for ( int i = 0; i < listeners.length; i++ )
{
- try
- {
- m_lifecycle.startupListener( listeners[ i ] );
- }
- catch( final Exception e )
- {
- final String name = listeners[ i ].getName();
- final String message =
- REZ.getString( "bad-listener", "startup", name,
e.getMessage() );
- getLogger().error( message, e );
- throw e;
- }
- }
+ try
+ {
+ m_lifecycle.startupListener( listeners[ i ] );
+ }
+ catch ( final Exception e )
+ {
+ final String name = listeners[ i ].getName();
+ final String message =
+ REZ.getString( "bad-listener", "startup", name,
e.getMessage() );
+ getLogger().error( message, e );
+ throw e;
+ }
+ }
}
/**
@@ -297,14 +301,14 @@
//Setup thread context for calling visitors
ThreadContext.setThreadContext( m_context.getThreadContext() );
- try
- {
- doRunPhase( name );
- }
- finally
- {
- ThreadContext.setThreadContext( null );
- }
+ try
+ {
+ doRunPhase( name );
+ }
+ finally
+ {
+ ThreadContext.setThreadContext( null );
+ }
}
/**
@@ -324,7 +328,7 @@
//Log message describing the number of blocks
//the phase in and the order in which they will be
//processed
- if( getLogger().isInfoEnabled() )
+ if ( getLogger().isInfoEnabled() )
{
final Integer count = new Integer( blocks.length );
final List pathList = Arrays.asList( order );
@@ -334,11 +338,11 @@
}
//All blocks about to be processed ...
- if( PHASE_STARTUP == name )
+ if ( PHASE_STARTUP == name )
{
//... for startup, so indicate to applicable listeners
- final ApplicationEvent event =
- new ApplicationEvent( m_sarMetaData.getName(), m_sarMetaData );
+ final ApplicationEvent event =
+ new ApplicationEvent( m_sarMetaData.getName(), m_sarMetaData
);
m_lifecycle.applicationStarting( event );
}
else
@@ -349,12 +353,12 @@
//Process blocks, one by one.
- for( int i = 0; i < order.length; i++ )
+ for ( int i = 0; i < order.length; i++ )
{
final String block = order[ i ];
//Log message saying we are processing block
- if( getLogger().isDebugEnabled() )
+ if ( getLogger().isDebugEnabled() )
{
final String message = REZ.getString( "process-block",
block, name );
getLogger().debug( message );
@@ -363,12 +367,12 @@
try
{
final BlockEntry entry = (BlockEntry)m_entrys.get( block );
- if( PHASE_STARTUP == name )
+ if ( PHASE_STARTUP == name )
m_lifecycle.startup( entry );
else
m_lifecycle.shutdown( entry );
}
- catch( final Exception e )
+ catch ( final Exception e )
{
final String message =
REZ.getString( "app.error.run-phase", name, block,
e.getMessage() );
@@ -378,7 +382,7 @@
}
//Log message saying we have processed block
- if( getLogger().isDebugEnabled() )
+ if ( getLogger().isDebugEnabled() )
{
final String message = REZ.getString( "processed-block",
block, name );
getLogger().debug( message );
@@ -386,7 +390,7 @@
}
//All blocks processed ...
- if( PHASE_STARTUP == name )
+ if ( PHASE_STARTUP == name )
{
//... for startup, so indicate to applicable listeners
m_lifecycle.applicationStarted();
@@ -396,6 +400,5 @@
//... for shutdown, so indicate to applicable listeners
m_lifecycle.applicationStopped();
}
-
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>