#30 WIP on using the new apache mina library

This commit is contained in:
Denny
2016-12-18 09:09:47 -05:00
parent d085ecc0c9
commit 1d7354b4a8
6 changed files with 228 additions and 277 deletions

View File

@@ -59,14 +59,10 @@ public class ThreadPoolManager
TimeUnit unit )
throws RejectedExecutionException
{
if( mExecutor == null )
{
mExecutor = Executors.newScheduledThreadPool( THREAD_POOL_SIZE,
new NamingThreadFactory( "sdrtrunk" ) );
}
ScheduledExecutorService executorService = getScheduledExecutorService();
ScheduledFuture<?> task =
mExecutor.scheduleAtFixedRate( command, 0, period, unit );
executorService.scheduleAtFixedRate( command, 0, period, unit );
mTasks.put( task, type );
@@ -76,13 +72,9 @@ public class ThreadPoolManager
public void scheduleOnce( Runnable command, long delay, TimeUnit unit )
throws RejectedExecutionException
{
if( mExecutor == null )
{
mExecutor = Executors.newScheduledThreadPool( THREAD_POOL_SIZE,
new NamingThreadFactory( "sdrtrunk" ) );
}
ScheduledExecutorService executorService = getScheduledExecutorService();
mExecutor.schedule( command, delay, unit );
executorService.schedule( command, delay, unit );
}
public boolean cancel( ScheduledFuture<?> task )