Class StateManagerImpl

java.lang.Object
org.apache.openjpa.kernel.StateManagerImpl
All Implemented Interfaces:
Serializable, FieldConsumer, FieldManager, FieldSupplier, StateManager, OpenJPAStateManager

public class StateManagerImpl extends Object implements OpenJPAStateManager, Serializable
Implementation of the OpenJPAStateManager interface for use with this runtime. Each state manager manages the state of a single persistence capable instance. The state manager is also responsible for all communications about the instance to the StoreManager. The state manager uses the State pattern in both its interaction with the governed instance and its interaction with the broker. In its interactions with the persistence capable instance, it uses the FieldManager interface. Similarly, when interacting with the broker, it uses the PCState singleton that represents the current lifecycle state of the instance.
Author:
Abe White
See Also:
  • Field Details

  • Constructor Details

    • StateManagerImpl

      protected StateManagerImpl(Object id, ClassMetaData meta, BrokerImpl broker)
      Constructor; supply id, type metadata, and owning persistence manager.
    • StateManagerImpl

      public StateManagerImpl(StateManagerImpl sm)
      Create a new StateManager instance based on the StateManager provided. A new PersistenceCapable instance will be created and associated with the new StateManager. All fields will be copied into the ne PC instance as well as the dirty, loaded, and flushed bitsets.
      Parameters:
      sm - A statemanager instance which will effectively be cloned.
    • StateManagerImpl

      public StateManagerImpl(StateManagerImpl sm, PCState newState)
      Create a new StateManager instance, optionally overriding the state (FLUSHED, DELETED, etc) of the underlying PersistenceCapable instance).
      Parameters:
      sm - A statemanager instance which will effectively be cloned.
      newState - The new state of the underlying persistence capable object.
  • Method Details