Salome HOME
Update copyrights 2014.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / ServiceLocatorImpl.java
index 5810b0ac0cdbc0ccb8af50f8acdaa2dd5499db63..745c80cb1f5e914084dbc3543b7584519aa45e23 100644 (file)
@@ -5,7 +5,7 @@
  * Creation date   19.10.2012
  * @author         $Author$
  * @version        $Revision$
- * @copyright      OPEN CASCADE 2012
+ * @copyright      OPEN CASCADE 2012-2014
  *****************************************************************************/
 
 package org.splat.service; 
@@ -16,21 +16,18 @@ package org.splat.service;
  * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
  */
 @Deprecated
-public class ServiceLocatorImpl implements ServiceLocator {
+public final class ServiceLocatorImpl implements ServiceLocator {
 
        /**
         * The Locator instance.
         */
-       static ServiceLocator theInstance;
+       static private ServiceLocator theInstance = new ServiceLocatorImpl();
 
        /**
         * Get the locator instance.
         * @return the locator instance
         */
        public static ServiceLocator getInstance() {
-               if (theInstance == null) {
-                       theInstance = new ServiceLocatorImpl();
-               }
                return theInstance;
        }
        
@@ -48,6 +45,10 @@ public class ServiceLocatorImpl implements ServiceLocator {
         * Injected user service.
         */
        private UserService _userService;
+       /**
+        * Injected publication service.
+        */
+       private PublicationService _publicationService;
 
        /**
         * Get the studyService.
@@ -61,7 +62,7 @@ public class ServiceLocatorImpl implements ServiceLocator {
         * Set the studyService.
         * @param studyService the studyService to set
         */
-       public void setStudyService(StudyService studyService) {
+       public void setStudyService(final StudyService studyService) {
                _studyService = studyService;
        }
 
@@ -77,7 +78,23 @@ public class ServiceLocatorImpl implements ServiceLocator {
         * Set the userService.
         * @param userService the userService to set
         */
-       public void setUserService(UserService userService) {
+       public void setUserService(final UserService userService) {
                _userService = userService;
        }
+
+       /**
+        * Get the publicationService.
+        * @return the publicationService
+        */
+       public PublicationService getPublicationService() {
+               return _publicationService;
+       }
+
+       /**
+        * Set the publicationService.
+        * @param publicationService the publicationService to set
+        */
+       public void setPublicationService(final PublicationService publicationService) {
+               _publicationService = publicationService;
+       }
 }