Rice Pastry API

rice.selector
Class ProfileSelector

java.lang.Object
  extended by java.lang.Thread
      extended by rice.selector.SelectorManager
          extended by rice.selector.ProfileSelector
All Implemented Interfaces:
java.lang.Runnable, Destructable, Timer

public class ProfileSelector
extends SelectorManager

Author:
jeffh To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and Comments

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 java.lang.String lastTaskClass
           
 long lastTaskHash
           
 java.lang.String lastTaskToString
           
 java.lang.String lastTaskType
           
static boolean recordStats
           
static boolean useHeartbeat
           
 
Fields inherited from class rice.selector.SelectorManager
cancelledKeys, instance, invocations, logger, modifyKeys, running, select, selector, TIMEOUT, timerQueue, timeSource, useLoopListeners, wakeupTime
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ProfileSelector(java.lang.String instance, TimeSource timeSource, LogManager log)
           
 
Method Summary
 void addStat(java.lang.String s, long time)
           
protected  void doInvocations()
          Method which invokes all pending invocations.
protected  void doInvocations2()
           
protected  void doSelections()
           
 void invoke(java.lang.Runnable d)
          This method schedules a runnable task to be done by the selector thread during the next select() call.
protected  void onLoop()
          This method is to be implemented by a subclass to do some task each loop.
 void printStats()
           
 
Methods inherited from class rice.selector.SelectorManager
addLoopObserver, cancel, destroy, executeDueTasks, getInvocation, getKey, getModifyKey, getNextTaskExecutionTime, getNumInvocations, getSelector, getTimer, isSelectorThread, modifyKey, notifyLoopListeners, register, removeLoopObserver, removeTask, run, schedule, schedule, schedule, scheduleAtFixedRate, selectedKeys, setEnvironment, setSelect, useLoopListeners, wakeup
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

useHeartbeat

public static boolean useHeartbeat

recordStats

public static boolean recordStats

lastTaskType

public java.lang.String lastTaskType

lastTaskClass

public java.lang.String lastTaskClass

lastTaskToString

public java.lang.String lastTaskToString

lastTaskHash

public long lastTaskHash
Constructor Detail

ProfileSelector

public ProfileSelector(java.lang.String instance,
                       TimeSource timeSource,
                       LogManager log)
Method Detail

onLoop

protected void onLoop()
Description copied from class: SelectorManager
This method is to be implemented by a subclass to do some task each loop.

Overrides:
onLoop in class SelectorManager

invoke

public void invoke(java.lang.Runnable d)
Description copied from class: SelectorManager
This method schedules a runnable task to be done by the selector thread during the next select() call. All operations which modify the selector should be done using this method, as they must be done in the selector thread.

Overrides:
invoke in class SelectorManager
Parameters:
d - The runnable task to invoke

addStat

public void addStat(java.lang.String s,
                    long time)

printStats

public void printStats()

doSelections

protected void doSelections()
                     throws java.io.IOException
Overrides:
doSelections in class SelectorManager
Throws:
java.io.IOException

doInvocations

protected void doInvocations()
Method which invokes all pending invocations. This method should *only* be called by the selector thread.

Overrides:
doInvocations in class SelectorManager

doInvocations2

protected void doInvocations2()

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection