1 17 18 package org.apache.avalon.fortress.impl.handler; 19 20 import org.apache.avalon.framework.logger.Logger; 21 import org.apache.avalon.framework.logger.NullLogger; 22 import org.apache.excalibur.event.command.Command; 23 24 30 public final class PrepareHandlerCommand implements Command 31 { 32 private final ComponentHandler m_handler; 33 private final Logger m_logger; 34 35 40 public PrepareHandlerCommand( final ComponentHandler handler, 41 final Logger logger ) 42 { 43 m_handler = handler; 44 m_logger = ( null == logger ) ? new NullLogger() : logger; 45 } 46 47 52 public ComponentHandler getHandler() 53 { 54 return m_handler; 55 } 56 57 61 public void execute() 62 throws Exception 63 { 64 try 65 { 66 m_handler.prepareHandler(); 67 } 68 catch ( final Exception e ) 69 { 70 if ( m_logger.isErrorEnabled() ) 71 { 72 } 74 75 throw e; 76 } 77 } 78 } 79 80 | Popular Tags |