This repository has been archived by the owner on Feb 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build REST APIs for RepositoryQueryService See merge request !19
- Loading branch information
Showing
33 changed files
with
1,177 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
jaffa-core/source/java/org/jaffa/loader/ManagerRepositoryService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package org.jaffa.loader; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
/** | ||
* ManagerRepositoryService - Singleton service to collect all repository managers in the application | ||
*/ | ||
public class ManagerRepositoryService { | ||
|
||
/** | ||
* The singleton ManagerRepositoryService instance | ||
*/ | ||
private static volatile ManagerRepositoryService managerRepositoryService = null; | ||
|
||
/** | ||
* HashMap to store repositories. The key is the repository name, and the value is | ||
* the repository instance | ||
*/ | ||
private Map<String, IManager> managerMap = new HashMap<>(); | ||
|
||
/** | ||
* Default constructor for the ManagerRepositoryService class | ||
*/ | ||
private ManagerRepositoryService() { | ||
} | ||
|
||
/** | ||
* Public method to retrieve the ManagerRepositoryService instance | ||
* @return The ManagerRepositoryService instance | ||
*/ | ||
public static ManagerRepositoryService getInstance() { | ||
if (managerRepositoryService == null) { | ||
synchronized (ManagerRepositoryService.class) { | ||
if (managerRepositoryService == null) { | ||
managerRepositoryService = new ManagerRepositoryService(); | ||
} | ||
} | ||
} | ||
return managerRepositoryService; | ||
} | ||
|
||
/** | ||
* Add managers to the ManagerRepositoryService HashMap | ||
* @param className The class name of the manager to be added | ||
* @param manager The instance of the manager to be added | ||
*/ | ||
public void add(String className, IManager manager) { | ||
managerMap.put(className, manager); | ||
} | ||
|
||
/** | ||
* Retrieve the manager HashMap | ||
* @return The manager HashMap | ||
*/ | ||
public Map<String, IManager> getManagerMap() { | ||
return managerMap; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.