mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-05 23:22:47 +00:00
Fixes a bug in ThreadService start method
This commit is contained in:
@@ -62,8 +62,8 @@ public class ThreadServiceImpl extends AbstractService implements ThreadService
|
||||
|
||||
@Override
|
||||
protected void doStart() throws ServiceStartException {
|
||||
pool = createThreadPool("shared", 20);
|
||||
threadPools = CollectionFactory.newMap();
|
||||
pool = createThreadPool("shared", 20);
|
||||
|
||||
pool.async(50, TimeUnit.MILLISECONDS, 50, new Runnable() {
|
||||
@Override
|
||||
|
||||
@@ -59,6 +59,16 @@ public abstract class AbstractDAO<T extends Model<?>, I extends ID<?>>
|
||||
this.database = database;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncFuture<T> selectAsync(final I id) {
|
||||
return threadService.async(new Callable<T>() {
|
||||
@Override
|
||||
public T call() throws Exception {
|
||||
return select(id);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int save(T object) {
|
||||
return save(object, false);
|
||||
|
||||
@@ -58,6 +58,18 @@ public interface DataAccessObject<O extends Model<?>, I extends ID<?>> extends
|
||||
*/
|
||||
O select(I id);
|
||||
|
||||
/**
|
||||
* Asynchronously load the instance represented by <tt>id</tt> from the
|
||||
* database
|
||||
*
|
||||
* @param id
|
||||
* the id
|
||||
* @return the {@link AsyncFuture} that will load the selected object.
|
||||
* {@link AsyncFuture} might return <tt>null</tt> if the object
|
||||
* could not be found in the database.
|
||||
*/
|
||||
AsyncFuture<O> selectAsync(I id);
|
||||
|
||||
/**
|
||||
* Loads an List of all {@link ID}s in the database
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user