com.sun.sgs.impl.profile
Class ProfileCollectorHandleImpl

java.lang.Object
  extended by com.sun.sgs.impl.profile.ProfileCollectorHandleImpl
All Implemented Interfaces:
ProfileCollectorHandle

public class ProfileCollectorHandleImpl
extends Object
implements ProfileCollectorHandle

The portion of a profile collector that allows the kernel to modify the state of a particular collection record (initiates one, finishes one, that sort of thing). Only particular classes are given access to instances of this class by the kernel.


Constructor Summary
ProfileCollectorHandleImpl(ProfileCollectorImpl profileCollector)
          Instantiate a ProfileCollectorHandle.
 
Method Summary
 void addListener(TransactionListenerDetail listenerDetail)
          Tells the collector about a listener of a transaction when that listener is finished with its work (i.e., after its afterCompletion} method has been called).
 void addParticipant(ProfileParticipantDetail participantDetail)
          Tells the collector about a participant of a transaction when that participant has finished participating (i.e., has committed, has prepared read-only, or has aborted).
 void finishTask(int tryCount)
          Tells the collector that the current task associated with the calling thread (as associated by a call to startTask) has now successfully finished.
 void finishTask(int tryCount, Throwable t)
          Tells the collector that the current task associated with the calling thread (as associated by a call to startTask) is now finished and that an exception occured during its execution.
 ProfileCollector getCollector()
          Returns the underlying profile collector that this interface controls.
 void noteTransactional(byte[] transactionId)
          Tells the collector that the current task associated with the calling thread (as associated by a call to startTask) is transactional.
 void notifyNodeIdAssigned(long nodeId)
          Notifies the collector that the node has been assigned its identifier.
 void notifyThreadAdded()
          Notifies the collector that a thread has been added to the scheduler.
 void notifyThreadRemoved()
          Notifies the collector that a thread has been removed from the scheduler.
 void setAccessedObjectsDetail(AccessedObjectsDetail detail)
          Sets the detail for all objects accessed during the task as reported to the AccessCoordinator.
 void startTask(KernelRunnable task, Identity owner, long scheduledStartTime, int readyCount)
          Tells the collector that a new task is starting in the context of the calling thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProfileCollectorHandleImpl

public ProfileCollectorHandleImpl(ProfileCollectorImpl profileCollector)
Instantiate a ProfileCollectorHandle.

Parameters:
profileCollector - the backing profile collector
Method Detail

notifyThreadAdded

public void notifyThreadAdded()
Notifies the collector that a thread has been added to the scheduler.

Specified by:
notifyThreadAdded in interface ProfileCollectorHandle

notifyThreadRemoved

public void notifyThreadRemoved()
Notifies the collector that a thread has been removed from the scheduler.

Specified by:
notifyThreadRemoved in interface ProfileCollectorHandle

notifyNodeIdAssigned

public void notifyNodeIdAssigned(long nodeId)
Notifies the collector that the node has been assigned its identifier.

Specified by:
notifyNodeIdAssigned in interface ProfileCollectorHandle
Parameters:
nodeId - the identifier for the node

startTask

public void startTask(KernelRunnable task,
                      Identity owner,
                      long scheduledStartTime,
                      int readyCount)
Tells the collector that a new task is starting in the context of the calling thread. If another task was alrady being profiled in the context of the calling thread then that profiling data is pushed onto a stack until the new task finishes from a call to finishTask.

Specified by:
startTask in interface ProfileCollectorHandle
Parameters:
task - the KernelRunnable that is starting
owner - the Identity of the task owner
scheduledStartTime - the requested starting time for the task
readyCount - the number of ready tasks at the scheduler

noteTransactional

public void noteTransactional(byte[] transactionId)
Tells the collector that the current task associated with the calling thread (as associated by a call to startTask) is transactional. This does not mean that all operations of the task are transactional, but that at least some of the task is run in a transactional context.

Specified by:
noteTransactional in interface ProfileCollectorHandle
Parameters:
transactionId - the identifier for the transaction

addParticipant

public void addParticipant(ProfileParticipantDetail participantDetail)
Tells the collector about a participant of a transaction when that participant has finished participating (i.e., has committed, has prepared read-only, or has aborted). The transaction must be the current transaction for the current task, and therefore noteTransactional must first have been called in the context of the current thread.

Specified by:
addParticipant in interface ProfileCollectorHandle
Parameters:
participantDetail - the detail associated with the participant

addListener

public void addListener(TransactionListenerDetail listenerDetail)
Tells the collector about a listener of a transaction when that listener is finished with its work (i.e., after its afterCompletion} method has been called). The transaction must be the current transaction for the current task, and therefore noteTransactional must first have been called in the context of the current thread.

Specified by:
addListener in interface ProfileCollectorHandle
Parameters:
listenerDetail - the detail associated with the listener

setAccessedObjectsDetail

public void setAccessedObjectsDetail(AccessedObjectsDetail detail)
Sets the detail for all objects accessed during the task as reported to the AccessCoordinator.

Specified by:
setAccessedObjectsDetail in interface ProfileCollectorHandle
Parameters:
detail - all detail of the accessed objects

finishTask

public void finishTask(int tryCount)
Tells the collector that the current task associated with the calling thread (as associated by a call to startTask) has now successfully finished.

Specified by:
finishTask in interface ProfileCollectorHandle
Parameters:
tryCount - the number of times that the task has tried to run

finishTask

public void finishTask(int tryCount,
                       Throwable t)
Tells the collector that the current task associated with the calling thread (as associated by a call to startTask) is now finished and that an exception occured during its execution.

Specified by:
finishTask in interface ProfileCollectorHandle
Parameters:
tryCount - the number of times that the task has tried to run
t - the Throwable thrown during task execution

getCollector

public ProfileCollector getCollector()
Returns the underlying profile collector that this interface controls.

Specified by:
getCollector in interface ProfileCollectorHandle
Returns:
the underlying profile collector that this interface controls

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved