org.acegisecurity.domain.dao
Class DetachmentContextHolder

java.lang.Object
  extended by org.acegisecurity.domain.dao.DetachmentContextHolder

public class DetachmentContextHolder
extends Object

InheritableThreadLocal which indicates whether a Dao implementation should be forced to return a detached instance.

A detached instance is one which is no longer associated with the ORM mapper and changes will therefore not be transparently persisted to the database.

Not all Dao implementations support the concept of detached instances.

Version:
$Id: DetachmentContextHolder.java,v 1.4 2005/11/17 00:55:47 benalex Exp $
Author:
Ben Alex
See Also:
InheritableThreadLocal

Constructor Summary
DetachmentContextHolder()
           
 
Method Summary
static boolean isForceReturnOfDetachedInstances()
          Returns the boolean value detachment policy which has been set for the current thread (defaults to false).
static void setForceReturnOfDetachedInstances(boolean alwaysReturnDetached)
          Sets whether or not detached domain object instances should be returned within the current thread of execution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DetachmentContextHolder

public DetachmentContextHolder()
Method Detail

setForceReturnOfDetachedInstances

public static void setForceReturnOfDetachedInstances(boolean alwaysReturnDetached)
Sets whether or not detached domain object instances should be returned within the current thread of execution.

Parameters:
alwaysReturnDetached - if true then detached instances should be returned.

isForceReturnOfDetachedInstances

public static boolean isForceReturnOfDetachedInstances()
Returns the boolean value detachment policy which has been set for the current thread (defaults to false).



Copyright © 2004-2005 Acegi Technology Pty Limited. All Rights Reserved.