com.sun.sgs.impl.service.transaction
Class TransactionListenerDetailImpl

java.lang.Object
  extended by com.sun.sgs.impl.service.transaction.TransactionListenerDetailImpl
All Implemented Interfaces:
TransactionListenerDetail

 class TransactionListenerDetailImpl
extends Object
implements TransactionListenerDetail

Simple implementation of TransactionListenerDetail that is package-private and used by TransactionImpl to report detail associated with each listener.


Constructor Summary
TransactionListenerDetailImpl(String listenerName)
          Creates an instance of TransactionListenerDetailImpl for the given named listener.
 
Method Summary
 boolean abortedBeforeCompletion()
          Returns whether the listener's beforeCompletion method threw an exception thus aborting the transaction.
 boolean calledBeforeCompletion()
          Returns whether the listener's beforeCompletion method was called.
 long getAfterCompletionTime()
          Returns the length of time the listener spent in its afterCompletion call.
 long getBeforeCompletionTime()
          Returns the length of time the listener spent in its beforeCompletion call.
 String getListenerName()
          Returns the name of the listener.
(package private)  void setCalledAfterCompletion(long time)
          Sets that the listener's afterCompletion method was called and how long the call took.
(package private)  void setCalledBeforeCompletion(boolean failed, long time)
          Sets that the listener's beforeCompletion method was called, whether it failed, and how long the call took
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionListenerDetailImpl

TransactionListenerDetailImpl(String listenerName)
Creates an instance of TransactionListenerDetailImpl for the given named listener.

Parameters:
listenerName - the name of the listener associated with this detail
Method Detail

getListenerName

public String getListenerName()
Returns the name of the listener.

Specified by:
getListenerName in interface TransactionListenerDetail
Returns:
the listener's name

calledBeforeCompletion

public boolean calledBeforeCompletion()
Returns whether the listener's beforeCompletion method was called.

Specified by:
calledBeforeCompletion in interface TransactionListenerDetail
Returns:
true if the listener's beforeCompletion method was called, false otherwise

abortedBeforeCompletion

public boolean abortedBeforeCompletion()
Returns whether the listener's beforeCompletion method threw an exception thus aborting the transaction.

Specified by:
abortedBeforeCompletion in interface TransactionListenerDetail
Returns:
true if the listener's beforeCompletion method aborted the transaction, false otherwise

getBeforeCompletionTime

public long getBeforeCompletionTime()
Returns the length of time the listener spent in its beforeCompletion call.

Specified by:
getBeforeCompletionTime in interface TransactionListenerDetail
Returns:
the time in milliseconds spent before completing

getAfterCompletionTime

public long getAfterCompletionTime()
Returns the length of time the listener spent in its afterCompletion call.

Specified by:
getAfterCompletionTime in interface TransactionListenerDetail
Returns:
the time in milliseconds spent after completing

setCalledBeforeCompletion

void setCalledBeforeCompletion(boolean failed,
                               long time)
Sets that the listener's beforeCompletion method was called, whether it failed, and how long the call took


setCalledAfterCompletion

void setCalledAfterCompletion(long time)
Sets that the listener's afterCompletion method was called and how long the call took.


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