org.apache.openjpa.kernel
Class ManagedCache

java.lang.Object
  extended by org.apache.openjpa.kernel.ManagedCache
All Implemented Interfaces:
Serializable

 class ManagedCache
extends Object
implements Serializable

Cache of managed objects. Must be static for serialization reasons.


Constructor Summary
ManagedCache(BrokerImpl broker)
          Constructor; supply primary cache map.
 
Method Summary
 void add(StateManagerImpl sm)
          Call this method when a new state manager initializes itself.
 void assignObjectId(Object id, StateManagerImpl sm)
          A new instance has just been assigned a permanent oid.
 void clear()
          Clear the cache.
 void clearNew()
          Clear new instances without permanent oids.
 void commitNew(Object id, StateManagerImpl sm)
          A new instance has committed; recache under permanent oid.
 Collection<StateManagerImpl> copy()
          Return a copy of all cached persistent objects.
(package private)  void dirtyCheck()
           
 StateManagerImpl getById(Object oid, boolean allowNew)
          Return the instance for the given oid, optionally allowing new instances.
 void persist(StateManagerImpl sm)
          An embedded or nonpersistent managed instance has been persisted.
 void remove(Object id, StateManagerImpl sm)
          Remove the given state manager from the cache when it transitions to transient.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagedCache

ManagedCache(BrokerImpl broker)
Constructor; supply primary cache map.

Method Detail

getById

public StateManagerImpl getById(Object oid,
                                boolean allowNew)
Return the instance for the given oid, optionally allowing new instances.


add

public void add(StateManagerImpl sm)
Call this method when a new state manager initializes itself.


remove

public void remove(Object id,
                   StateManagerImpl sm)
Remove the given state manager from the cache when it transitions to transient.


persist

public void persist(StateManagerImpl sm)
An embedded or nonpersistent managed instance has been persisted.


assignObjectId

public void assignObjectId(Object id,
                           StateManagerImpl sm)
A new instance has just been assigned a permanent oid.


commitNew

public void commitNew(Object id,
                      StateManagerImpl sm)
A new instance has committed; recache under permanent oid.


copy

public Collection<StateManagerImpl> copy()
Return a copy of all cached persistent objects.


clear

public void clear()
Clear the cache.


clearNew

public void clearNew()
Clear new instances without permanent oids.


dirtyCheck

void dirtyCheck()


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