com.sun.sgs.impl.kernel
Class AbstractAccessCoordinator.AbstractAccessReporter<T>

java.lang.Object
  extended by com.sun.sgs.impl.kernel.AbstractAccessCoordinator.AbstractAccessReporter<T>
All Implemented Interfaces:
AccessReporter<T>
Enclosing class:
AbstractAccessCoordinator

public abstract class AbstractAccessCoordinator.AbstractAccessReporter<T>
extends Object
implements AccessReporter<T>

Provides a skeletal implementation of AccessReporter, supplying the overloadings of reportObjectAccess and setObjectDescription that supply default arguments. Subclasses should at least provide implementations of the four argument overloading of reportObjectAccess and the three argument overloading of setObjectDescription.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.sun.sgs.kernel.AccessReporter
AccessReporter.AccessType
 
Field Summary
protected  String source
          The source for objects managed by this reporter.
 
Constructor Summary
protected AbstractAccessCoordinator.AbstractAccessReporter(String source)
          Creates an instance of this class.
 
Method Summary
 void reportObjectAccess(T objId, AccessReporter.AccessType type)
          Reports to the coordinator that object access has been requested in the context of the current transaction.
 void reportObjectAccess(T objId, AccessReporter.AccessType type, Object description)
          Reports to the coordinator that an object access with the provided description has been requested in the context of the current transaction.
 void reportObjectAccess(Transaction txn, T objId, AccessReporter.AccessType type)
          Reports to the coordinator that object access has been requested in the context of the provided transaction.
 void setObjectDescription(T objId, Object description)
          In the current transaction, associates the given object with some description that should have a meaningful toString method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.sgs.kernel.AccessReporter
reportObjectAccess, setObjectDescription
 

Field Detail

source

protected final String source
The source for objects managed by this reporter.

Constructor Detail

AbstractAccessCoordinator.AbstractAccessReporter

protected AbstractAccessCoordinator.AbstractAccessReporter(String source)
Creates an instance of this class.

Parameters:
source - the source for objects managed by this reporter
Method Detail

reportObjectAccess

public void reportObjectAccess(T objId,
                               AccessReporter.AccessType type)
Reports to the coordinator that object access has been requested in the context of the current transaction. The requested object is shared, and may be the cause of conflict.

Specified by:
reportObjectAccess in interface AccessReporter<T>
Parameters:
objId - an identifier for the object being accessed
type - the AccessType being requested

reportObjectAccess

public void reportObjectAccess(Transaction txn,
                               T objId,
                               AccessReporter.AccessType type)
Reports to the coordinator that object access has been requested in the context of the provided transaction. The requested object is shared, and may be the cause of conflict.

Specified by:
reportObjectAccess in interface AccessReporter<T>
Parameters:
txn - the transaction in which the provided objId was accessed
objId - an identifier for the object being accessed
type - the AccessType being requested

reportObjectAccess

public void reportObjectAccess(T objId,
                               AccessReporter.AccessType type,
                               Object description)
Reports to the coordinator that an object access with the provided description has been requested in the context of the current transaction. The requested object is shared, and may be the cause of conflict. See setObjectDescription for more details about description.

Specified by:
reportObjectAccess in interface AccessReporter<T>
Parameters:
objId - an identifier for the object being accessed
type - the AccessType being requested
description - an arbitrary object that contains a description of the object being accessed

setObjectDescription

public void setObjectDescription(T objId,
                                 Object description)
In the current transaction, associates the given object with some description that should have a meaningful toString method. This description will be available in the profiling data, and is useful when displaying details about a given accessed object. The intent is that an arbitrary description can be included with an object, but that the description is not accessed unless a ProfileListener finds it useful to do so. At that point the description's toString method may be called, or the object itself might be cast to some known type to extract more detail about the accessed object.

Note that this may be called before the associated object is actually accessed, and therefore before reportObjectAccess is called for the given objId. Use of this method is optional, and only used to provide additional detail for profiling and debugging.

If a description has already been set for the identified object, or if the provided description is null, then no change is made to the description of the object.

Specified by:
setObjectDescription in interface AccessReporter<T>
Parameters:
objId - the identifier for the associated object
description - an arbitrary Object that contains a description of the objId being accessed

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