com.sun.xml.ws.commons
Class ScheduledTaskManager

java.lang.Object
  extended by com.sun.xml.ws.commons.AbstractTaskManager
      extended by com.sun.xml.ws.commons.ScheduledTaskManager

public final class ScheduledTaskManager
extends AbstractTaskManager

Scheduled task manager provides a higher-level API for scheduling and controlling tasks that should run on a separate thread(s). WARNING: This class is a private utility class used by WSIT implementation. Any usage outside the intedned scope is strongly discouraged. The API exposed by this class may be changed, replaced or removed without any advance notice.

Author:
Marek Potociar (marek.potociar at sun.com)

Constructor Summary
ScheduledTaskManager(String name, Component component)
          TODO javadoc
 
Method Summary
protected  ThreadFactory createThreadFactory()
           
protected  Component getComponent()
           
protected  Logger getLogger()
           
protected  String getThreadPoolName()
           
protected  int getThreadPoolSize()
           
 ScheduledFuture<?> runOnce(Runnable task)
          Adds a new task for scheduled execution.
 void shutdown()
          Stops all the tasks and shuts down the scheduled task executor
 ScheduledFuture<?> startTask(Runnable task, long initialDelay, long period)
          Adds a new task for scheduled execution.
 void stopAllTasks()
           
 
Methods inherited from class com.sun.xml.ws.commons.AbstractTaskManager
close, close, getExecutorService, isClosed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScheduledTaskManager

public ScheduledTaskManager(String name,
                            Component component)
TODO javadoc

Method Detail

stopAllTasks

public void stopAllTasks()

shutdown

public void shutdown()
Stops all the tasks and shuts down the scheduled task executor


startTask

public ScheduledFuture<?> startTask(Runnable task,
                                    long initialDelay,
                                    long period)
Adds a new task for scheduled execution.

Parameters:
task - new task to be executed regularly at a defined rate
initialDelay - the time to delay first execution (in milliseconds)
period - the period between successive executions (in milliseconds)

runOnce

public ScheduledFuture<?> runOnce(Runnable task)
Adds a new task for scheduled execution.

Parameters:
task - new task to be executed regularly at a predefined rate

createThreadFactory

protected ThreadFactory createThreadFactory()
Specified by:
createThreadFactory in class AbstractTaskManager

getThreadPoolName

protected String getThreadPoolName()
Specified by:
getThreadPoolName in class AbstractTaskManager

getThreadPoolSize

protected int getThreadPoolSize()
Specified by:
getThreadPoolSize in class AbstractTaskManager

getComponent

protected Component getComponent()
Specified by:
getComponent in class AbstractTaskManager

getLogger

protected Logger getLogger()
Specified by:
getLogger in class AbstractTaskManager


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.