org.apache.openjpa.kernel
Class DetachManager

java.lang.Object
  extended by org.apache.openjpa.kernel.DetachManager
All Implemented Interfaces:
DetachState

public class DetachManager
extends Object
implements DetachState

Handles detaching instances.

Author:
Marc Prud'hommeaux

Field Summary
 
Fields inherited from interface org.apache.openjpa.kernel.DetachState
DETACH_ALL, DETACH_FETCH_GROUPS, DETACH_FGS, DETACH_LOADED
 
Constructor Summary
DetachManager(BrokerImpl broker, boolean full, OpCallbacks call)
          Constructor.
 
Method Summary
 Object detach(Object toDetach)
          Return a detached version of the given instance.
 Object[] detachAll(Collection instances)
          Return detached versions of all the given instances.
(package private) static boolean preSerialize(StateManagerImpl sm)
          Used to prepare a detachable instance that does not externalize detached state.
(package private) static boolean writeDetachedState(StateManagerImpl sm, ObjectOutput out, BitSet idxs)
          Used by classes that externalize detached state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DetachManager

public DetachManager(BrokerImpl broker,
                     boolean full,
                     OpCallbacks call)
Constructor.

Parameters:
broker - owning broker
full - whether the entire broker cache is being detached; if this is the case, we assume the broker has already flushed if needed, and that we're detaching in-place
Method Detail

preSerialize

static boolean preSerialize(StateManagerImpl sm)
Used to prepare a detachable instance that does not externalize detached state.


writeDetachedState

static boolean writeDetachedState(StateManagerImpl sm,
                                  ObjectOutput out,
                                  BitSet idxs)
                           throws IOException
Used by classes that externalize detached state.

Returns:
whether to use a detached state manager
Throws:
IOException

detach

public Object detach(Object toDetach)
Return a detached version of the given instance.


detachAll

public Object[] detachAll(Collection instances)
Return detached versions of all the given instances. If not copying, null will be returned.



Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.