net.sf.sasl.common.schedule
Class ScheduledExecutorServiceAdapter

java.lang.Object
  extended by net.sf.sasl.common.schedule.ScheduledExecutorServiceAdapter
All Implemented Interfaces:
IScheduleService

public class ScheduledExecutorServiceAdapter
extends Object
implements IScheduleService

Adapter class which delegates calls to IScheduleService to an instance of ScheduledExecutorService (the adapted class).

Since:
0.0.1 (sasl-common-aspect-library)
Author:
Philipp Förmer

Constructor Summary
ScheduledExecutorServiceAdapter()
           
 
Method Summary
 ScheduledExecutorService getScheduledExecutorService()
          Returns the ScheduledExecutorService which is adapted by this object.
<V> ScheduledFuture<V>
schedule(Callable<V> callable, long millis)
          Tries to schedule the callable at now + millis for execution.
 void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
          Sets the ScheduledExecutorService which is adapted by this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScheduledExecutorServiceAdapter

public ScheduledExecutorServiceAdapter()
Method Detail

getScheduledExecutorService

public ScheduledExecutorService getScheduledExecutorService()
Returns the ScheduledExecutorService which is adapted by this object.

Returns:
null or non null.
Since:
0.0.1 (sasl-common-aspect-library)

setScheduledExecutorService

public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
Sets the ScheduledExecutorService which is adapted by this object.

Parameters:
scheduledExecutorService - non null
Throws:
IllegalArgumentException - if scheduledExecutorService is null
Since:
0.0.1 (sasl-common-aspect-library)

schedule

public <V> ScheduledFuture<V> schedule(Callable<V> callable,
                                       long millis)
                            throws IllegalArgumentException
Description copied from interface: IScheduleService
Tries to schedule the callable at now + millis for execution.

Specified by:
schedule in interface IScheduleService
Parameters:
callable - non null
millis - integer value greater or equal 0.
Returns:
null, if the callable could not get scheduled, a scheduled future else.
Throws:
IllegalArgumentException - if callable is null or millis lesser than 0.
Since:
0.0.1 (sasl-common-aspect-library)
See Also:
IScheduleService.schedule(java.util.concurrent.Callable, long)


Copyright © 2010. All Rights Reserved.