Coverage Report - org.directdemocracyportal.democracy.web.actionlistener.ApplicationEventHandler
 
Classes in this File Line Coverage Branch Coverage Complexity
ApplicationEventHandler
85%
6/7
100%
2/2
1.5
 
 1  
 /*
 2  
 Copyright 2010 James Pether Sörling Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 
 3  
         $Id
 4  
 */
 5  
 package org.directdemocracyportal.democracy.web.actionlistener;
 6  
 
 7  
 import org.apache.commons.logging.Log;
 8  
 import org.apache.commons.logging.LogFactory;
 9  
 import org.springframework.context.ApplicationEvent;
 10  
 import org.springframework.context.ApplicationListener;
 11  
 import org.springframework.context.event.ContextRefreshedEvent;
 12  
 
 13  
 /**
 14  
  * The Class ApplicationEventHandler.
 15  
  */
 16  
 public class ApplicationEventHandler implements ApplicationListener
 17  
 {
 18  
 
 19  
     /** The log. */
 20  1
     private static Log log = LogFactory.getLog(ApplicationEventHandler.class);
 21  
 
 22  
     /**
 23  
      * Instantiates a new application event handler.
 24  
      */
 25  1
     public ApplicationEventHandler() {
 26  1
     }
 27  
 
 28  
     /*
 29  
      * (non-Javadoc)
 30  
      *
 31  
      * @see org.springframework.context.ApplicationListener#onApplicationEvent(org.springframework.context.ApplicationEvent)
 32  
      */
 33  
     public void onApplicationEvent(ApplicationEvent event) {
 34  1
         if (event instanceof ContextRefreshedEvent) {
 35  1
             log.info("Application started");
 36  
         } else {
 37  0
             log.warn("Unhandled event " + event);
 38  
         }
 39  1
     }
 40  
 }