mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
remove serializable as it does not make sense
This commit is contained in:
@@ -7,6 +7,8 @@ import java.util.concurrent.Future;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
import javax.ejb.ConcurrencyManagement;
|
||||
import javax.ejb.ConcurrencyManagementType;
|
||||
import javax.ejb.Singleton;
|
||||
import javax.ejb.Startup;
|
||||
import javax.inject.Inject;
|
||||
@@ -27,6 +29,7 @@ import com.google.api.client.util.Lists;
|
||||
|
||||
@Startup
|
||||
@Singleton
|
||||
@ConcurrencyManagement(ConcurrencyManagementType.BEAN)
|
||||
public class StartupBean {
|
||||
|
||||
private static Logger log = LoggerFactory.getLogger(StartupBean.class);
|
||||
@@ -65,8 +68,10 @@ public class StartupBean {
|
||||
}
|
||||
|
||||
ApplicationSettings settings = applicationSettingsService.get();
|
||||
log.info("Starting {} background threads",
|
||||
settings.getBackgroundThreads());
|
||||
for (int i = 0; i < settings.getBackgroundThreads(); i++) {
|
||||
Future<Void> thread = worker.start();
|
||||
Future<Void> thread = worker.start("Thread " + i);
|
||||
threads.add(thread);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import javax.ejb.Stateless;
|
||||
|
||||
import com.commafeed.backend.model.ApplicationSettings;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Stateless
|
||||
public class ApplicationSettingsDAO extends GenericDAO<ApplicationSettings> {
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ import com.google.common.collect.Lists;
|
||||
import com.uaihebert.model.EasyCriteria;
|
||||
|
||||
@Stateless
|
||||
@SuppressWarnings("serial")
|
||||
public class FeedCategoryDAO extends GenericDAO<FeedCategory> {
|
||||
|
||||
public List<FeedCategory> findAll(User user) {
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.google.common.collect.Iterables;
|
||||
import com.uaihebert.model.EasyCriteria;
|
||||
|
||||
@Stateless
|
||||
@SuppressWarnings("serial")
|
||||
public class FeedDAO extends GenericDAO<Feed> {
|
||||
|
||||
public List<Feed> findNextUpdatable(int count) {
|
||||
|
||||
@@ -16,7 +16,6 @@ import com.google.api.client.util.Lists;
|
||||
import com.uaihebert.model.EasyCriteria;
|
||||
|
||||
@Stateless
|
||||
@SuppressWarnings("serial")
|
||||
public class FeedEntryDAO extends GenericDAO<FeedEntry> {
|
||||
|
||||
public List<FeedEntry> findByGuids(List<String> guids) {
|
||||
|
||||
@@ -29,7 +29,6 @@ import com.google.api.client.util.Maps;
|
||||
import com.uaihebert.model.EasyCriteria;
|
||||
|
||||
@Stateless
|
||||
@SuppressWarnings("serial")
|
||||
public class FeedEntryStatusDAO extends GenericDAO<FeedEntryStatus> {
|
||||
|
||||
public FeedEntryStatus findById(User user, Long id) {
|
||||
|
||||
@@ -14,7 +14,6 @@ import com.uaihebert.factory.EasyCriteriaFactory;
|
||||
import com.uaihebert.model.EasyCriteria;
|
||||
|
||||
@Stateless
|
||||
@SuppressWarnings("serial")
|
||||
public class FeedSubscriptionDAO extends GenericDAO<FeedSubscription> {
|
||||
|
||||
public FeedSubscription findById(User user, Long id) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.commafeed.backend.dao;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@@ -20,8 +19,7 @@ import com.uaihebert.factory.EasyCriteriaFactory;
|
||||
import com.uaihebert.model.EasyCriteria;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class GenericDAO<T extends AbstractModel> implements
|
||||
Serializable {
|
||||
public abstract class GenericDAO<T extends AbstractModel> {
|
||||
|
||||
private TypeToken<T> type = new TypeToken<T>(getClass()) {
|
||||
};
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.commafeed.backend.model.User;
|
||||
import com.commafeed.backend.model.User_;
|
||||
|
||||
@Stateless
|
||||
@SuppressWarnings("serial")
|
||||
public class UserDAO extends GenericDAO<User> {
|
||||
|
||||
public User findByName(String name) {
|
||||
|
||||
@@ -11,7 +11,6 @@ import com.commafeed.backend.model.UserRole.Role;
|
||||
import com.commafeed.backend.model.UserRole_;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Stateless
|
||||
public class UserRoleDAO extends GenericDAO<UserRole> {
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.uaihebert.factory.EasyCriteriaFactory;
|
||||
import com.uaihebert.model.EasyCriteria;
|
||||
|
||||
@Stateless
|
||||
@SuppressWarnings("serial")
|
||||
public class UserSettingsDAO extends GenericDAO<UserSettings> {
|
||||
|
||||
public UserSettings findByUser(User user) {
|
||||
|
||||
@@ -52,7 +52,8 @@ public class FeedRefreshWorker {
|
||||
private boolean running = true;
|
||||
|
||||
@Asynchronous
|
||||
public Future<Void> start() {
|
||||
public Future<Void> start(String threadName) {
|
||||
log.info("{} starting", threadName);
|
||||
while (running) {
|
||||
try {
|
||||
Feed feed = getNextFeed();
|
||||
|
||||
Reference in New Issue
Block a user