Coverage report

  %line %branch
org.demosys.web.ServiceLocator
77% 
100% 

 1  
 /*
 2  
  * Demosys.
 3  
  *
 4  
  * Terms of license - http://opensource.org/licenses/apachepl.php
 5  
  */
 6  
 package org.demosys.web;
 7  
 import org.demosys.task.MemoryTaskService;
 8  
 import org.demosys.task.TaskService;
 9  
 import org.demosys.web.iteration.IterationService;
 10  
 import org.demosys.web.iteration.impl.MemoryIterationService;
 11  
 import org.demosys.web.project.ProjectService;
 12  
 import org.demosys.web.project.impl.MemoryProjectService;
 13  
 import org.demosys.web.story.StoryService;
 14  
 import org.demosys.web.story.impl.MemoryStoryService;
 15  
 import org.demosys.web.user.UserService;
 16  
 import org.demosys.web.user.impl.MemoryUserService;
 17  
 /**
 18  
  * TODO : Voir si on remplace le _service locator par des plugins (cf. struts-exemples.war
 19  
  * de la distribution strtus).
 20  
  */
 21  18
 public class ServiceLocator {
 22  12
     private static ServiceLocator _locator = null;
 23  18
     private StoryService _storyService = new MemoryStoryService();
 24  18
     private IterationService iterationService = new MemoryIterationService();
 25  18
     private TaskService taskService = new MemoryTaskService();
 26  18
     private ProjectService projectService = new MemoryProjectService();
 27  24
     private UserService _userService = new MemoryUserService();
 28  4
 
 29  6
     public UserService getUserService() {
 30  48
         return _userService;
 31  6
     }
 32  6
 
 33  6
 
 34  
     public ProjectService getProjectService() {
 35  0
         return projectService;
 36  14
     }
 37  
 
 38  
 
 39  
     public TaskService getTaskService() {
 40  0
         return taskService;
 41  
     }
 42  
 
 43  
 
 44  
     /**
 45  
      * Shutdow the current ServiceLocator with all current services.
 46  
      *
 47  
      * <p>
 48  
      * TODO : Make a ServiceInterface with a shutdown method to delegate the call.
 49  
      * </p>
 50  
      */
 51  
     public synchronized void shutdown() {
 52  9
         _locator = null;
 53  9
     }
 54  
 
 55  
 
 56  
     /**
 57  
      * Service des Story.
 58  3
      *
 59  3
      * @return Le _service responsable des story.
 60  
      */
 61  
     public StoryService getStoryService() {
 62  0
         return _storyService;
 63  
     }
 64  
 
 65  
 
 66  
     public IterationService getIterationService() {
 67  0
         return iterationService;
 68  
     }
 69  
 
 70  
 
 71  
     public static final synchronized ServiceLocator getServiceLocator() {
 72  51
         if (_locator == null) {
 73  18
             _locator = new ServiceLocator();
 74  
         }
 75  
 
 76  51
         return _locator;
 77  
     }
 78  17
 }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.