com.sun.sgs.impl.profile.listener
Class AccessedObjectsListener

java.lang.Object
  extended by com.sun.sgs.impl.profile.listener.AccessedObjectsListener
All Implemented Interfaces:
ProfileListener

public class AccessedObjectsListener
extends Object
implements ProfileListener

An implementation of ProfileListener that prints access detail. For any transaction that fails due to conflict this will display the accesses for that transaction and the accesses, if known, for the transaction that caused the conflict.

Note that in the current default implementation, conflict detail will only be provided if the AccessCoordinator is using a backlog to track finished transactions. See TrackingAccessCoordinator for more detail.

By default, the set of accesses displayed for a given transaction will be limited to the first 20. This can be changed by setting the com.sun.sgs.impl.profile.listener.AccessedObjectsListener.access.count property with a positive integer value.


Field Summary
static String ACCESS_COUNT_PROPERTY
          Property that defines the maximum number of accesses to display.
 
Fields inherited from interface com.sun.sgs.profile.ProfileListener
WINDOW_SIZE_PROPERTY
 
Constructor Summary
AccessedObjectsListener(Properties properties, Identity owner, ComponentRegistry registry)
          Creates an instance of AccessedObjectsListener.
 
Method Summary
 void propertyChange(PropertyChangeEvent event)
          Notifies this listener of a new change in the system properties.
 void report(ProfileReport profileReport)
          Reports a completed task that has been run through the scheduler.
 void shutdown()
          Tells this listener that the system is shutting down.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACCESS_COUNT_PROPERTY

public static final String ACCESS_COUNT_PROPERTY
Property that defines the maximum number of accesses to display.

Constructor Detail

AccessedObjectsListener

public AccessedObjectsListener(Properties properties,
                               Identity owner,
                               ComponentRegistry registry)
Creates an instance of AccessedObjectsListener.

Parameters:
properties - the Properties for this listener
owner - the Identity to use for all tasks run by this listener
registry - the ComponentRegistry containing the available system components
Throws:
IllegalArgumentException - if either of the backlog or count properties is provided but invalid
Method Detail

propertyChange

public void propertyChange(PropertyChangeEvent event)
Notifies this listener of a new change in the system properties. This method is called for any property that changes.

The current list of supported property names is as follows:

name description new value old value
com.sun.sgs.profile.newop a new operation is registered with the system. the new operation : ProfileOperation null
com.sun.sgs.profile.threadcount the number of threads in the system has changed. the current number of threads : Integer the previous number of threads : Integer
com.sun.sgs.profile.nodeid the local node has been assigned a unique identifier the identifier for the local node: Long null

Specified by:
propertyChange in interface ProfileListener
Parameters:
event - A PropertyChangeEvent object describing the name of the property, its old and new values and the source of the change.

report

public void report(ProfileReport profileReport)
Reports a completed task that has been run through the scheduler. The task may have completed successfully or may have failed. If a task is re-tried, then this method will be called multiple times for each re-try of the same task. Note that in this case the scheduledStartTime will remain constant but the actualStartTime will change for each re-try of the same task.

Specified by:
report in interface ProfileListener
Parameters:
profileReport - the ProfileReport for the task

shutdown

public void shutdown()
Tells this listener that the system is shutting down.

Specified by:
shutdown in interface ProfileListener

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