org.abstracthorizon.extend.server.support
Class KernelScheduler

java.lang.Object
  extended by org.abstracthorizon.extend.server.support.KernelScheduler
All Implemented Interfaces:
SimpleScheduler

public class KernelScheduler
extends Object
implements SimpleScheduler

Simple scheduler adapter used by the server. It schedules tasks each second.

Author:
Daniel Sendula

Field Summary
protected  ScheduledThreadPoolExecutor scheduler
          Executor
 
Constructor Summary
KernelScheduler()
          Empty constructor
 
Method Summary
 void destroy()
          Stops the executor
 ScheduledThreadPoolExecutor getScheduler()
          Returns executor
 void remove(Runnable client)
          Removes client from list of clients to be executed each second
 void schedule(Runnable client)
          Schedules client for execution
 void setScheduler(ScheduledThreadPoolExecutor scheduler)
          Sets executor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scheduler

protected ScheduledThreadPoolExecutor scheduler
Executor

Constructor Detail

KernelScheduler

public KernelScheduler()
Empty constructor

Method Detail

schedule

public void schedule(Runnable client)
Schedules client for execution

Specified by:
schedule in interface SimpleScheduler
Parameters:
client - runnable client

remove

public void remove(Runnable client)
Removes client from list of clients to be executed each second

Specified by:
remove in interface SimpleScheduler
Parameters:
client - client to be removed

setScheduler

public void setScheduler(ScheduledThreadPoolExecutor scheduler)
Sets executor

Parameters:
scheduler - executor

getScheduler

public ScheduledThreadPoolExecutor getScheduler()
Returns executor

Returns:
executor that is used

destroy

public void destroy()
Stops the executor



Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.