com.sun.sgs.impl.profile
Interface ProfileCollectorHandle

All Known Implementing Classes:
ProfileCollectorHandleImpl

public interface ProfileCollectorHandle

The object which manages how ProfileCollectors keep track of which tasks are generating which data.


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.
 

Method Detail

notifyThreadAdded

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


notifyThreadRemoved

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


notifyNodeIdAssigned

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

Parameters:
nodeId - the identifier for the node

startTask

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.

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

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.

Parameters:
transactionId - the identifier for the transaction
Throws:
IllegalStateException - if no task is bound to this thread

addParticipant

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.

Parameters:
participantDetail - the detail associated with the participant
Throws:
IllegalStateException - if no transactional task is bound to this thread

addListener

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.

Parameters:
listenerDetail - the detail associated with the listener
Throws:
IllegalStateException - if no transactional task is bound to this thread

setAccessedObjectsDetail

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

Parameters:
detail - all detail of the accessed objects
Throws:
IllegalStateException - if no transactional task is bound to this thread

finishTask

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.

Parameters:
tryCount - the number of times that the task has tried to run
Throws:
IllegalStateException - if no task is bound to this thread

finishTask

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.

Parameters:
tryCount - the number of times that the task has tried to run
t - the Throwable thrown during task execution
Throws:
IllegalStateException - if no task is bound to this thread

getCollector

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

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