org.apache.jdo.impl.state
Class SCOProcessor

java.lang.Object
  extended byorg.apache.jdo.impl.state.SCOProcessor

class SCOProcessor
extends java.lang.Object

This is the helper class to process SCO-related requests from the StateManager.

Version:
1.0
Author:
Marina Vatkina

Nested Class Summary
(package private)  class SCOProcessor.CollectionProcessor
          Processor for trackUpdates request for SCOCollection.
(package private)  class SCOProcessor.DateProcessor
          Processor for trackUpdates request for SCODate.
(package private)  class SCOProcessor.MapProcessor
          Processor for trackUpdates request for SCOMap.
(package private)  class SCOProcessor.Processor
          An abstract class that knows how process SCO-related requests.
 
Field Summary
private static RuntimeJavaModelFactory javaModelFactory
          RuntimeJavaModelFactory.
private static I18NHelper msg
          I18N message handler
private  java.util.HashMap processors
          Map of possible processors.
private  java.util.HashMap scoprocessors
           
private static SCOProcessor singleton
          The singleton ReachabilityHandler instance.
 
Constructor Summary
private SCOProcessor()
          Constructs a new SCOProcessor without specific parameters.
 
Method Summary
(package private)  void assertSCOElementType(java.lang.Object o, JDOField jdoField)
          Assert element type of an SCO Collection or key and value types of an SCO Map.
static SCOProcessor getInstance()
          Get the SCOProcessor singleton instance.
(package private)  SCO getSCOField(java.lang.Object o, JDOField jdoField, PersistenceManagerInternal pm)
          Process requests to create a tracked SCO instance for the corresponding JDK SCO.
(package private)  void trackUpdates(StateManagerImpl sm, int field, SCO sco)
          Process requests to trackUpdates for SCO changes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

singleton

private static final SCOProcessor singleton
The singleton ReachabilityHandler instance.


processors

private final java.util.HashMap processors
Map of possible processors.


scoprocessors

private final java.util.HashMap scoprocessors

msg

private static final I18NHelper msg
I18N message handler


javaModelFactory

private static final RuntimeJavaModelFactory javaModelFactory
RuntimeJavaModelFactory.

Constructor Detail

SCOProcessor

private SCOProcessor()
Constructs a new SCOProcessor without specific parameters. Initializes processors maps.

Method Detail

getInstance

public static SCOProcessor getInstance()
Get the SCOProcessor singleton instance.

Returns:
an instance of SCOProcessor

trackUpdates

void trackUpdates(StateManagerImpl sm,
                  int field,
                  SCO sco)
Process requests to trackUpdates for SCO changes.

Parameters:
sm - - StateManagerImpl instance that requested processing.
field - the field number associated with this SCO.
sco - Object to process.

getSCOField

SCO getSCOField(java.lang.Object o,
                JDOField jdoField,
                PersistenceManagerInternal pm)
Process requests to create a tracked SCO instance for the corresponding JDK SCO.

Parameters:
o - Object to be replaced with tracked SCO instance.
jdoField - the JDOField associated with this number.
pm - the PersistenceManagerInternal instance associated with the caller.

assertSCOElementType

void assertSCOElementType(java.lang.Object o,
                          JDOField jdoField)
Assert element type of an SCO Collection or key and value types of an SCO Map.

Parameters:
o - Object to be tested.
jdoField - the corresponding JDOField element.
Throws:
javax.jdo.JDOUserException - if assertion fails.