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