From 9a845c8ebbb0cc1517935bfd0f6cade8ac6d73ef Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Fri, 4 May 2012 14:59:24 +0000 Subject: [PATCH] Removing one database table from use. --- .../gempukku/lotro/db/DbLeaguePointsDAO.java | 104 ---------------- .../gempukku/lotro/db/LeaguePointsDAO.java | 32 ----- .../lotro/league/CachedLeaguePointsDAO.java | 116 ------------------ .../gempukku/lotro/league/LeagueService.java | 83 +++++-------- .../lotro/league/LeagueServiceTest.java | 15 +-- .../lotro/server/provider/DaoProvider.java | 16 --- .../lotro/server/provider/ServerProvider.java | 4 +- 7 files changed, 41 insertions(+), 329 deletions(-) delete mode 100644 gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/db/DbLeaguePointsDAO.java delete mode 100644 gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/db/LeaguePointsDAO.java delete mode 100644 gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/league/CachedLeaguePointsDAO.java diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/db/DbLeaguePointsDAO.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/db/DbLeaguePointsDAO.java deleted file mode 100644 index f3be659c7..000000000 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/db/DbLeaguePointsDAO.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.gempukku.lotro.db; - -import com.gempukku.lotro.db.vo.League; -import com.gempukku.lotro.league.LeagueSerieData; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; - -public class DbLeaguePointsDAO implements LeaguePointsDAO { - private DbAccess _dbAccess; - - public DbLeaguePointsDAO(DbAccess dbAccess) { - _dbAccess = dbAccess; - } - - @Override - public void addPoints(League league, LeagueSerieData serie, String playerName, int points) { - try { - Connection conn = _dbAccess.getDataSource().getConnection(); - try { - PreparedStatement statement = conn.prepareStatement("insert into league_points (league_type, season_type, player_name, points) values (?, ?, ?, ?)"); - try { - statement.setString(1, league.getType()); - statement.setString(2, serie.getName()); - statement.setString(3, playerName); - statement.setInt(4, points); - statement.execute(); - } finally { - statement.close(); - } - } finally { - conn.close(); - } - } catch (SQLException exp) { - throw new RuntimeException(exp); - } - } - - @Override - public Map getLeaguePoints(League league) { - try { - Connection conn = _dbAccess.getDataSource().getConnection(); - try { - PreparedStatement statement = conn.prepareStatement("select player_name, sum(points), count(*) from league_points where league_type=? group by player_name order by 2 desc, 3 asc"); - try { - statement.setString(1, league.getType()); - ResultSet rs = statement.executeQuery(); - try { - return createPoints(rs); - } finally { - rs.close(); - } - } finally { - statement.close(); - } - } finally { - conn.close(); - } - } catch (SQLException exp) { - throw new RuntimeException(exp); - } - } - - private Map createPoints(ResultSet rs) throws SQLException { - Map result = new HashMap(); - while (rs.next()) { - String playerName = rs.getString(1); - int sumPoints = rs.getInt(2); - int gamesPlayed = rs.getInt(3); - result.put(playerName, new Points(sumPoints, gamesPlayed)); - } - return result; - } - - @Override - public Map getLeagueSeriePoints(League league, LeagueSerieData serie) { - try { - Connection conn = _dbAccess.getDataSource().getConnection(); - try { - PreparedStatement statement = conn.prepareStatement("select player_name, sum(points), count(*) from league_points where league_type=? and season_type=? group by player_name order by 2 desc, 3 asc"); - try { - statement.setString(1, league.getType()); - statement.setString(2, serie.getName()); - ResultSet rs = statement.executeQuery(); - try { - return createPoints(rs); - } finally { - rs.close(); - } - } finally { - statement.close(); - } - } finally { - conn.close(); - } - } catch (SQLException exp) { - throw new RuntimeException(exp); - } - } -} diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/db/LeaguePointsDAO.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/db/LeaguePointsDAO.java deleted file mode 100644 index b9ee08a7c..000000000 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/db/LeaguePointsDAO.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.gempukku.lotro.db; - -import com.gempukku.lotro.db.vo.League; -import com.gempukku.lotro.league.LeagueSerieData; - -import java.util.Map; - -public interface LeaguePointsDAO { - public void addPoints(League league, LeagueSerieData serie, String playerName, int points); - - public Map getLeaguePoints(League league); - - public Map getLeagueSeriePoints(League league, LeagueSerieData serie); - - public static class Points { - private final int _points; - private final int _gamesPlayed; - - public Points(int points, int gamesPlayed) { - _points = points; - _gamesPlayed = gamesPlayed; - } - - public int getPoints() { - return _points; - } - - public int getGamesPlayed() { - return _gamesPlayed; - } - } -} diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/league/CachedLeaguePointsDAO.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/league/CachedLeaguePointsDAO.java deleted file mode 100644 index 9ab309275..000000000 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/league/CachedLeaguePointsDAO.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.gempukku.lotro.league; - -import com.gempukku.lotro.db.LeaguePointsDAO; -import com.gempukku.lotro.db.vo.League; - -import java.util.Collections; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.locks.ReadWriteLock; -import java.util.concurrent.locks.ReentrantReadWriteLock; - -public class CachedLeaguePointsDAO implements LeaguePointsDAO { - private LeaguePointsDAO _leaguePointsDAO; - private Map> _cachedPoints = new ConcurrentHashMap>(); - - private ReadWriteLock _readWriteLock = new ReentrantReadWriteLock(); - - public CachedLeaguePointsDAO(LeaguePointsDAO leaguePointsDAO) { - _leaguePointsDAO = leaguePointsDAO; - } - - @Override - public void addPoints(League league, LeagueSerieData serie, String playerName, int points) { - _readWriteLock.writeLock().lock(); - try { - Map leaguePointsInWriteLock = getLeaguePointsInWriteLock(league); - Points previousPointsInLeague = leaguePointsInWriteLock.get(playerName); - Points newLeaguePoints = new Points( - points + ((previousPointsInLeague != null) ? previousPointsInLeague.getPoints() : 0), - 1 + ((previousPointsInLeague != null) ? previousPointsInLeague.getGamesPlayed() : 0)); - leaguePointsInWriteLock.put(playerName, newLeaguePoints); - - Map leagueSeriePointsInWriteLock = getLeagueSeriePointsInWriteLock(league, serie); - Points previousPointsInLeagueSerie = leagueSeriePointsInWriteLock.get(playerName); - Points newSeriePoints = new Points( - points + ((previousPointsInLeagueSerie != null) ? previousPointsInLeagueSerie.getPoints() : 0), - 1 + ((previousPointsInLeagueSerie != null) ? previousPointsInLeagueSerie.getGamesPlayed() : 0)); - leagueSeriePointsInWriteLock.put(playerName, newSeriePoints); - - _leaguePointsDAO.addPoints(league, serie, playerName, points); - } finally { - _readWriteLock.writeLock().unlock(); - } - } - - @Override - public Map getLeaguePoints(League league) { - _readWriteLock.readLock().lock(); - try { - Map leaguePoints = _cachedPoints.get(LeagueMapKeys.getLeagueMapKey(league)); - if (leaguePoints == null) { - _readWriteLock.readLock().unlock(); - _readWriteLock.writeLock().lock(); - try { - leaguePoints = getLeaguePointsInWriteLock(league); - } finally { - _readWriteLock.readLock().lock(); - _readWriteLock.writeLock().unlock(); - } - } - return Collections.unmodifiableMap(leaguePoints); - } finally { - _readWriteLock.readLock().unlock(); - } - } - - @Override - public Map getLeagueSeriePoints(League league, LeagueSerieData serie) { - _readWriteLock.readLock().lock(); - try { - Map leagueMatches = _cachedPoints.get(LeagueMapKeys.getLeagueMapKey(league)); - if (leagueMatches == null) { - _readWriteLock.readLock().unlock(); - _readWriteLock.writeLock().lock(); - try { - leagueMatches = getLeaguePointsInWriteLock(league); - } finally { - _readWriteLock.readLock().lock(); - _readWriteLock.writeLock().unlock(); - } - } - return Collections.unmodifiableMap(leagueMatches); - } finally { - _readWriteLock.readLock().unlock(); - } - } - - private Map getLeaguePointsInWriteLock(League league) { - Map leaguePoints; - leaguePoints = _cachedPoints.get(LeagueMapKeys.getLeagueMapKey(league)); - if (leaguePoints == null) { - leaguePoints = new ConcurrentHashMap(_leaguePointsDAO.getLeaguePoints(league)); - _cachedPoints.put(LeagueMapKeys.getLeagueMapKey(league), leaguePoints); - } - return leaguePoints; - } - - private Map getLeagueSeriePointsInWriteLock(League league, LeagueSerieData leagueSerie) { - Map leagueSeriePoints; - leagueSeriePoints = _cachedPoints.get(LeagueMapKeys.getLeagueSerieMapKey(league, leagueSerie)); - if (leagueSeriePoints == null) { - leagueSeriePoints = new ConcurrentHashMap(_leaguePointsDAO.getLeagueSeriePoints(league, leagueSerie)); - _cachedPoints.put(LeagueMapKeys.getLeagueSerieMapKey(league, leagueSerie), leagueSeriePoints); - } - return leagueSeriePoints; - } - - public void clearCache() { - _readWriteLock.writeLock().lock(); - try { - _cachedPoints.clear(); - } finally { - _readWriteLock.writeLock().unlock(); - } - } -} diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/league/LeagueService.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/league/LeagueService.java index 871d46616..807e8e674 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/league/LeagueService.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/league/LeagueService.java @@ -6,7 +6,6 @@ import com.gempukku.lotro.collection.CollectionsManager; import com.gempukku.lotro.db.LeagueDAO; import com.gempukku.lotro.db.LeagueMatchDAO; import com.gempukku.lotro.db.LeagueParticipationDAO; -import com.gempukku.lotro.db.LeaguePointsDAO; import com.gempukku.lotro.db.vo.CollectionType; import com.gempukku.lotro.db.vo.League; import com.gempukku.lotro.db.vo.LeagueMatch; @@ -19,6 +18,7 @@ import java.io.IOException; import java.sql.SQLException; import java.util.*; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicInteger; public class LeagueService { private Comparator LEAGUE_STANDING_COMPARATOR = @@ -30,7 +30,6 @@ public class LeagueService { private LeagueDAO _leagueDao; // Cached on this layer - private CachedLeaguePointsDAO _leaguePointsDao; private CachedLeagueMatchDAO _leagueMatchDao; private CachedLeagueParticipationDAO _leagueParticipationDAO; @@ -42,10 +41,9 @@ public class LeagueService { private int _activeLeaguesLoadedDate; private List _activeLeagues; - public LeagueService(LeagueDAO leagueDao, LeaguePointsDAO leaguePointsDao, LeagueMatchDAO leagueMatchDao, + public LeagueService(LeagueDAO leagueDao, LeagueMatchDAO leagueMatchDao, LeagueParticipationDAO leagueParticipationDAO, CollectionsManager collectionsManager) { _leagueDao = leagueDao; - _leaguePointsDao = new CachedLeaguePointsDAO(leaguePointsDao); _leagueMatchDao = new CachedLeagueMatchDAO(leagueMatchDao); _leagueParticipationDAO = new CachedLeagueParticipationDAO(leagueParticipationDAO); _collectionsManager = collectionsManager; @@ -57,7 +55,6 @@ public class LeagueService { _activeLeaguesLoadedDate = 0; _leagueMatchDao.clearCache(); - _leaguePointsDao.clearCache(); _leagueParticipationDAO.clearCache(); } @@ -65,7 +62,6 @@ public class LeagueService { int currentDate = DateUtils.getCurrentDate(); if (currentDate != _activeLeaguesLoadedDate) { _leagueMatchDao.clearCache(); - _leaguePointsDao.clearCache(); _leagueParticipationDAO.clearCache(); try { @@ -148,9 +144,6 @@ public class LeagueService { public void reportLeagueGameResult(League league, LeagueSerieData serie, String winner, String loser) { _leagueMatchDao.addPlayedMatch(league, serie, winner, loser); - _leaguePointsDao.addPoints(league, serie, winner, 2); - _leaguePointsDao.addPoints(league, serie, loser, 1); - _leagueStandings.remove(LeagueMapKeys.getLeagueMapKey(league)); _leagueSerieStandings.remove(LeagueMapKeys.getLeagueSerieMapKey(league, serie)); @@ -208,7 +201,7 @@ public class LeagueService { } private List createLeagueSerieStandings(League league, LeagueSerieData leagueSerie) { - final Map points = _leaguePointsDao.getLeagueSeriePoints(league, leagueSerie); + final Collection playersParticipating = _leagueParticipationDAO.getUsersParticipating(league); final Collection matches = _leagueMatchDao.getLeagueMatches(league); Set matchesInSerie = new HashSet(); @@ -217,37 +210,51 @@ public class LeagueService { matchesInSerie.add(match); } - return createStandingsForMatchesAndPoints(points, matchesInSerie); + return createStandingsForMatchesAndPoints(playersParticipating, matchesInSerie); } private List createLeagueStandings(League league) { - final Map points = _leaguePointsDao.getLeaguePoints(league); + final Collection playersParticipating = _leagueParticipationDAO.getUsersParticipating(league); final Collection matches = _leagueMatchDao.getLeagueMatches(league); - return createStandingsForMatchesAndPoints(points, matches); + return createStandingsForMatchesAndPoints(playersParticipating, matches); } - private List createStandingsForMatchesAndPoints(Map points, Collection matches) { + private List createStandingsForMatchesAndPoints(Collection playersParticipating, Collection matches) { Map> playerOpponents = new HashMap>(); - Map playerWins = new HashMap(); - Map playerLoss = new HashMap(); + Map playerWinCounts = new HashMap(); + Map playerLossCounts = new HashMap(); + + // Initialize the list + for (String playerName : playersParticipating) { + playerOpponents.put(playerName, new ArrayList()); + playerWinCounts.put(playerName, new AtomicInteger(0)); + playerLossCounts.put(playerName, new AtomicInteger(0)); + } + for (LeagueMatch leagueMatch : matches) { - appendPlayer(playerOpponents, leagueMatch.getWinner(), leagueMatch.getLoser()); - appendPlayer(playerOpponents, leagueMatch.getLoser(), leagueMatch.getWinner()); - appendMatch(playerWins, playerLoss, leagueMatch.getWinner(), leagueMatch.getLoser()); + playerOpponents.get(leagueMatch.getWinner()).add(leagueMatch.getLoser()); + playerOpponents.get(leagueMatch.getLoser()).add(leagueMatch.getWinner()); + playerWinCounts.get(leagueMatch.getWinner()).incrementAndGet(); + playerLossCounts.get(leagueMatch.getLoser()).incrementAndGet(); } List leagueStandings = new LinkedList(); - for (Map.Entry playerPoints : points.entrySet()) { - PlayerStanding standing = new PlayerStanding(playerPoints.getKey(), playerPoints.getValue().getPoints(), playerPoints.getValue().getGamesPlayed()); - List opponents = playerOpponents.get(playerPoints.getKey()); + for (String playerName : playersParticipating) { + int points = playerWinCounts.get(playerName).intValue() * 2 + playerLossCounts.get(playerName).intValue(); + int gamesPlayed = playerWinCounts.get(playerName).intValue() + playerLossCounts.get(playerName).intValue(); + PlayerStanding standing = new PlayerStanding(playerName, points, gamesPlayed); + List opponents = playerOpponents.get(playerName); int opponentWins = 0; int opponentGames = 0; for (String opponent : opponents) { - opponentWins += playerWins.get(opponent); - opponentGames += playerWins.get(opponent) + playerLoss.get(opponent); + opponentWins += playerWinCounts.get(opponent).intValue(); + opponentGames += playerWinCounts.get(opponent).intValue() + playerLossCounts.get(opponent).intValue(); } - standing.setOpponentWin(opponentWins * 1f / opponentGames); + if (opponentGames != 0) + standing.setOpponentWin(opponentWins * 1f / opponentGames); + else + standing.setOpponentWin(0f); leagueStandings.add(standing); } @@ -266,32 +273,6 @@ public class LeagueService { return leagueStandings; } - private void appendMatch(Map playerWins, Map playerLoss, String winner, String loser) { - append(playerWins, winner); - append(playerLoss, loser); - if (!playerWins.containsKey(loser)) - playerWins.put(loser, 0); - if (!playerLoss.containsKey(winner)) - playerLoss.put(winner, 0); - } - - private void append(Map playerCounts, String player) { - Integer count = playerCounts.get(player); - if (count == null) - count = 0; - count++; - playerCounts.put(player, count); - } - - private void appendPlayer(Map> playerOpponents, String player, String opponent) { - List opponents = playerOpponents.get(player); - if (opponents == null) { - opponents = new LinkedList(); - playerOpponents.put(player, opponents); - } - opponents.add(opponent); - } - public boolean canPlayRankedGame(League league, LeagueSerieData season, String player) { int maxMatches = season.getMaxMatches(); Collection playedInSeason = getPlayerMatchesInSerie(league, season, player); diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/league/LeagueServiceTest.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/league/LeagueServiceTest.java index e7127955f..1bc7d7a40 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/league/LeagueServiceTest.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/league/LeagueServiceTest.java @@ -5,7 +5,6 @@ import com.gempukku.lotro.collection.CollectionsManager; import com.gempukku.lotro.db.LeagueDAO; import com.gempukku.lotro.db.LeagueMatchDAO; import com.gempukku.lotro.db.LeagueParticipationDAO; -import com.gempukku.lotro.db.LeaguePointsDAO; import com.gempukku.lotro.db.vo.League; import com.gempukku.lotro.db.vo.LeagueMatch; import org.junit.Test; @@ -37,7 +36,6 @@ public class LeagueServiceTest { Mockito.when(leagueDao.loadActiveLeagues(Mockito.anyInt())).thenReturn(leagues); - LeaguePointsDAO leaguePointsDAO = Mockito.mock(LeaguePointsDAO.class); LeagueMatchDAO leagueMatchDAO = Mockito.mock(LeagueMatchDAO.class); Set matches = new HashSet(); @@ -47,7 +45,7 @@ public class LeagueServiceTest { LeagueParticipationDAO leagueParticipationDAO = Mockito.mock(LeagueParticipationDAO.class); CollectionsManager collectionsManager = Mockito.mock(CollectionsManager.class); - LeagueService leagueService = new LeagueService(leagueDao, leaguePointsDAO, leagueMatchDAO, leagueParticipationDAO, collectionsManager); + LeagueService leagueService = new LeagueService(leagueDao, leagueMatchDAO, leagueParticipationDAO, collectionsManager); assertTrue(leagueService.canPlayRankedGame(league, leagueSerie, "player1")); assertTrue(leagueService.canPlayRankedGameAgainst(league, leagueSerie, "player1", "player2")); @@ -91,7 +89,6 @@ public class LeagueServiceTest { Mockito.when(leagueDao.loadActiveLeagues(Mockito.anyInt())).thenReturn(leagues); - LeaguePointsDAO leaguePointsDAO = Mockito.mock(LeaguePointsDAO.class); LeagueMatchDAO leagueMatchDAO = Mockito.mock(LeagueMatchDAO.class); Set matches = new HashSet(); @@ -102,7 +99,7 @@ public class LeagueServiceTest { LeagueParticipationDAO leagueParticipationDAO = Mockito.mock(LeagueParticipationDAO.class); CollectionsManager collectionsManager = Mockito.mock(CollectionsManager.class); - LeagueService leagueService = new LeagueService(leagueDao, leaguePointsDAO, leagueMatchDAO, leagueParticipationDAO, collectionsManager); + LeagueService leagueService = new LeagueService(leagueDao, leagueMatchDAO, leagueParticipationDAO, collectionsManager); assertTrue(leagueService.canPlayRankedGame(league, leagueSerie, "player1")); assertFalse(leagueService.canPlayRankedGameAgainst(league, leagueSerie, "player1", "player2")); @@ -138,7 +135,6 @@ public class LeagueServiceTest { Mockito.when(leagueDao.loadActiveLeagues(Mockito.anyInt())).thenReturn(leagues); - LeaguePointsDAO leaguePointsDAO = Mockito.mock(LeaguePointsDAO.class); LeagueMatchDAO leagueMatchDAO = Mockito.mock(LeagueMatchDAO.class); Set matches = new HashSet(); @@ -146,9 +142,14 @@ public class LeagueServiceTest { Mockito.when(leagueMatchDAO.getLeagueMatches(league)).thenReturn(new HashSet(matches)); LeagueParticipationDAO leagueParticipationDAO = Mockito.mock(LeagueParticipationDAO.class); + Set players = new HashSet(); + players.add("player1"); + players.add("player2"); + players.add("player3"); + Mockito.when(leagueParticipationDAO.getUsersParticipating(league)).thenReturn(players); CollectionsManager collectionsManager = Mockito.mock(CollectionsManager.class); - LeagueService leagueService = new LeagueService(leagueDao, leaguePointsDAO, leagueMatchDAO, leagueParticipationDAO, collectionsManager); + LeagueService leagueService = new LeagueService(leagueDao, leagueMatchDAO, leagueParticipationDAO, collectionsManager); leagueService.reportLeagueGameResult(league, leagueSerie, "player1", "player2"); leagueService.reportLeagueGameResult(league, leagueSerie, "player1", "player3"); diff --git a/gemp-lotr/gemp-lotr-web-server/src/main/java/com/gempukku/lotro/server/provider/DaoProvider.java b/gemp-lotr/gemp-lotr-web-server/src/main/java/com/gempukku/lotro/server/provider/DaoProvider.java index e46a983ba..a318c12fb 100644 --- a/gemp-lotr/gemp-lotr-web-server/src/main/java/com/gempukku/lotro/server/provider/DaoProvider.java +++ b/gemp-lotr/gemp-lotr-web-server/src/main/java/com/gempukku/lotro/server/provider/DaoProvider.java @@ -22,7 +22,6 @@ public class DaoProvider implements InjectableProvider { private Injectable _leagueDaoInjectable; private Injectable _leagueMatchDAOInjectable; - private Injectable _leaguePointsDAOInjectable; private Injectable _leagueParticipationDAOInjectable; private DbAccess _dbAccess; @@ -51,8 +50,6 @@ public class DaoProvider implements InjectableProvider { return getLeagueDaoSafely(); else if (type.equals(LeagueMatchDAO.class)) return getLeagueMatchDaoSafely(); - else if (type.equals(LeaguePointsDAO.class)) - return getLeaguePointsDaoSafely(); else if (type.equals(LeagueParticipationDAO.class)) return getLeagueParticipationDaoSafely(); else if (type.equals(MerchantDAO.class)) @@ -73,19 +70,6 @@ public class DaoProvider implements InjectableProvider { return _leagueParticipationDAOInjectable; } - private synchronized Injectable getLeaguePointsDaoSafely() { - if (_leaguePointsDAOInjectable == null) { - final LeaguePointsDAO leaguePointsDAO = new DbLeaguePointsDAO(_dbAccess); - _leaguePointsDAOInjectable = new Injectable() { - @Override - public LeaguePointsDAO getValue() { - return leaguePointsDAO; - } - }; - } - return _leaguePointsDAOInjectable; - } - private synchronized Injectable getLeagueMatchDaoSafely() { if (_leagueMatchDAOInjectable == null) { final LeagueMatchDAO leagueMatchDao = new DbLeagueMatchDAO(_dbAccess); diff --git a/gemp-lotr/gemp-lotr-web-server/src/main/java/com/gempukku/lotro/server/provider/ServerProvider.java b/gemp-lotr/gemp-lotr-web-server/src/main/java/com/gempukku/lotro/server/provider/ServerProvider.java index f7a248816..a68550a28 100644 --- a/gemp-lotr/gemp-lotr-web-server/src/main/java/com/gempukku/lotro/server/provider/ServerProvider.java +++ b/gemp-lotr/gemp-lotr-web-server/src/main/java/com/gempukku/lotro/server/provider/ServerProvider.java @@ -46,8 +46,6 @@ public class ServerProvider implements InjectableProvider { @Context private LeagueMatchDAO _leagueMatchDao; @Context - private LeaguePointsDAO _leaguePointsDao; - @Context private LeagueParticipationDAO _leagueParticipationDao; @Context private GameHistoryDAO _gameHistoryDao; @@ -100,7 +98,7 @@ public class ServerProvider implements InjectableProvider { private synchronized Injectable getLeagueServiceInjectable() { if (_leagueServiceInjectable == null) { - final LeagueService leagueService = new LeagueService(_leagueDao, _leaguePointsDao, _leagueMatchDao, _leagueParticipationDao, getCollectionsManagerInjectable().getValue()); + final LeagueService leagueService = new LeagueService(_leagueDao, _leagueMatchDao, _leagueParticipationDao, getCollectionsManagerInjectable().getValue()); _leagueServiceInjectable = new Injectable() { @Override public LeagueService getValue() {