wt.tools.profiler
Class StandardProfilerService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.tools.profiler.StandardProfilerService
All Implemented Interfaces:
Manager, NetFactor, ProfilerService, ProfilerServiceSvr, Serializable

public class StandardProfilerService
extends StandardManager
implements ProfilerService, ProfilerServiceSvr, Serializable

Use the newStandardProfilerService static factory method(s), not the StandardProfilerService constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.

See Also:
Serialized Form

Nested Class Summary
 class StandardProfilerService.ProfTimerTask
           
 
Field Summary
private  HashMap adaptListMap
           
private  Map callMap
           
private static String CLASSNAME
           
private static Object dummy
           
private static int MAX_PROF_HITS
           
static int OCCDATA
           
static int occHits
           
private static Object occHitsLock
           
static int OCCKEY
           
private static long PROF_TIMEOUT
           
static Object profLock
           
static boolean profStarted
           
private static String RESOURCE
           
static int STACK
           
private  Map threadFrameMap
           
private  Map threadsRunning
           
private  TimerTask timeTask
           
private static boolean VERBOSE
           
 
Fields inherited from class wt.services.StandardManager
 
Fields inherited from interface wt.services.Manager
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE
 
Constructor Summary
StandardProfilerService()
           
 
Method Summary
private static void checkAdmin()
           
 int disableAdapters(ProfilingKey[] keys)
           
 int enableAdapters(ProfilingKey[] keys)
           
 String getConceptualClassname()
          Deprecated.  
 ProfilerWrapper getProfData()
           
 ProfilerPollWrapper getProfPollData()
           
 ProfilingKey[] getRegAdapters()
           
protected  void initialize()
          

Supported API: false
static StandardProfilerService newStandardProfilerService()
          Default factory for the class.
 ProfilerFeedback pollProfData()
          This call makes use of wt.feedback to report the profiling data at regular intervals
 void regProfOperation(ProfilingKey key, ProfilingListener adapter)
          Any service/function that wants to make one of its operations profilable, creates an adapter & a listener.
 void reportOpData(ProfilingKey key, Object occuranceKey, int cost, Object occuranceData)
          Operations being profiled will report data using this method.
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, performStartupProcess, registerEvents, setManagerService, shutdown, shutdownFailure, shutdownSuccess, shuttingDown, started, startedErrors, startingUp, startup, startupFailure, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

VERBOSE

private static boolean VERBOSE

adaptListMap

private HashMap adaptListMap

threadFrameMap

private Map threadFrameMap

threadsRunning

private Map threadsRunning

callMap

private Map callMap

STACK

public static final int STACK
See Also:
Constant Field Values

OCCKEY

public static final int OCCKEY
See Also:
Constant Field Values

OCCDATA

public static final int OCCDATA
See Also:
Constant Field Values

profLock

public static Object profLock

occHits

public static int occHits

occHitsLock

private static Object occHitsLock

dummy

private static Object dummy

profStarted

public static boolean profStarted

MAX_PROF_HITS

private static final int MAX_PROF_HITS

PROF_TIMEOUT

private static final long PROF_TIMEOUT

timeTask

private TimerTask timeTask
Constructor Detail

StandardProfilerService

public StandardProfilerService()
Method Detail

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Overrides:
getConceptualClassname in class StandardManager
Returns:
String

newStandardProfilerService

public static StandardProfilerService newStandardProfilerService()
                                                          throws WTException
Default factory for the class.

Returns:
StandardProfilerService
Throws:
WTException

getRegAdapters

public ProfilingKey[] getRegAdapters()
                              throws WTException
Specified by:
getRegAdapters in interface ProfilerService
Returns:
ProfilingKey[]
Throws:
WTException

enableAdapters

public int enableAdapters(ProfilingKey[] keys)
                   throws WTException
Specified by:
enableAdapters in interface ProfilerService
Parameters:
keys -
Returns:
int
Throws:
WTException

disableAdapters

public int disableAdapters(ProfilingKey[] keys)
                    throws WTException
Specified by:
disableAdapters in interface ProfilerService
Parameters:
keys -
Returns:
int
Throws:
WTException

getProfData

public ProfilerWrapper getProfData()
                            throws WTException
Specified by:
getProfData in interface ProfilerService
Returns:
ProfilerWrapper
Throws:
WTException

pollProfData

public ProfilerFeedback pollProfData()
                              throws WTException
This call makes use of wt.feedback to report the profiling data at regular intervals

Specified by:
pollProfData in interface ProfilerService
Returns:
ProfilerFeedback
Throws:
WTException

regProfOperation

public void regProfOperation(ProfilingKey key,
                             ProfilingListener adapter)
Any service/function that wants to make one of its operations profilable, creates an adapter & a listener. It then calls this function passing it the adapter and listener, to let the StandardProfilingService know that it is available for profiling.

Specified by:
regProfOperation in interface ProfilerServiceSvr
Parameters:
key -
adapter -

reportOpData

public void reportOpData(ProfilingKey key,
                         Object occuranceKey,
                         int cost,
                         Object occuranceData)
Operations being profiled will report data using this method.

Specified by:
reportOpData in interface ProfilerServiceSvr
Parameters:
key -
occuranceKey -
cost -
occuranceData -

initialize

protected void initialize()
                   throws WTException
Description copied from class: StandardManager


Supported API: false

Overrides:
initialize in class StandardManager
Throws:
WTException

getProfPollData

public ProfilerPollWrapper getProfPollData()
                                    throws WTException
Throws:
WTException

checkAdmin

private static void checkAdmin()
                        throws WTException
Throws:
WTException