WebObjects 5.2

com.webobjects.eoaccess
Class EOAccessGenericFaultHandler

java.lang.Object
  |
  +--com.webobjects.eocontrol.EOFaultHandler
        |
        +--com.webobjects.eoaccess.EOAccessGenericFaultHandler
Direct Known Subclasses:
EOAccessArrayFaultHandler, EOAccessFaultHandler

public abstract class EOAccessGenericFaultHandler
extends EOFaultHandler

EOAccessGenericFaultHandler is an abstract class that helps an EOAccessFault to fire by fetching data using an EODatabaseContext. You shouldn't use EOAccessGenericFaultHandler directly; instead, use its subclasses, EOAccessFaultHandler and EOAccessArrayFaultHandler. EOAccessGenericFaultHandler lets you chain together all the fault handlers in the access layer, so that the batch faulting mechanism can find other faults related to the one that triggered the batch. Use linkAfterHandler to link one fault after another. Use next and previous to traverse the chain.

See Also:
linkAfterHandler(EOAccessGenericFaultHandler faultHandler, int generation), next(), previous(), EOAccessFaultHandler, EOAccessArrayFaultHandler

Constructor Summary
EOAccessGenericFaultHandler()
          Default constructor.
 
Method Summary
abstract  void completeInitializationOfObject(Object eo)
          An abstract method that should be implemented by subclasses to fetch the rest of the object eo from the database when the fault fires.
 EODatabaseContext databaseContext()
          Returns the current database context associated with this fault handler.
 EOEditingContext editingContext()
          Returns the current EOEditingContext associated with this fault handler.
 void faultWillFire(Object object)
          Removes object from the chain of fault handlers.
 int generation()
          Returns the number that represents when the fault handler was built.
 void linkAfterHandler(EOAccessGenericFaultHandler faultHandler, int gen)
          Adds this handler to a chain of fault handlers.
 EOAccessGenericFaultHandler next()
          Returns the next fault handler in the chain.
 EOAccessGenericFaultHandler previous()
          Returns the previous fault handler in the chain.
static void processQueue(ReferenceQueue refQueue)
          Removes fault handlers that are not associated with any editing context from the chain of fault handlers.
protected  void setContext(EODatabaseContext dbcontext, EOEditingContext ec)
           
 
Methods inherited from class com.webobjects.eocontrol.EOFaultHandler
clearFault, createFaultForDeferredFault, descriptionForObject, eoShallowDescription, handlerForFault, isFault, makeObjectIntoFault, targetClass, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EOAccessGenericFaultHandler

public EOAccessGenericFaultHandler()
Default constructor.
Method Detail

completeInitializationOfObject

public abstract void completeInitializationOfObject(Object eo)
An abstract method that should be implemented by subclasses to fetch the rest of the object eo from the database when the fault fires. This can be perceived as the completion of the initialization of an object in memory.
Overrides:
completeInitializationOfObject in class EOFaultHandler
Parameters:
eo - The object that is currently represented as a fault; this is usually an EOEnterpriseObject.
See Also:
EOEnterpriseObject

databaseContext

public EODatabaseContext databaseContext()
Returns the current database context associated with this fault handler.
Returns:
The database context associated with this fault handler.
See Also:
EODatabaseContext

editingContext

public EOEditingContext editingContext()
Returns the current EOEditingContext associated with this fault handler.
Returns:
The editing context associated with this fault handler.
See Also:
EOEditingContext

faultWillFire

public void faultWillFire(Object object)
Removes object from the chain of fault handlers.
Overrides:
faultWillFire in class EOFaultHandler
Parameters:
object - The EOFaulting object related to this handler.
See Also:
EOFaulting

generation

public int generation()
Returns the number that represents when the fault handler was built.
Returns:
The number that represents when the receiver was built.

linkAfterHandler

public void linkAfterHandler(EOAccessGenericFaultHandler faultHandler,
                             int gen)
Adds this handler to a chain of fault handlers. All faults in an access layer can be chained together, so the batch faulting mechanism can find other faults related to the one that triggered the batch.
Parameters:
faultHandler - The fault handler after which to place the receiver in the chain.
generation - A number that represents when the receiver was built.
See Also:
next(), previous()

next

public EOAccessGenericFaultHandler next()
Returns the next fault handler in the chain.
Returns:
The next fault handler in the chain
See Also:
linkAfterHandler(EOAccessGenericFaultHandler faultHandler, int gen)

previous

public EOAccessGenericFaultHandler previous()
Returns the previous fault handler in the chain.
Returns:
The previous fault handler in the chain.
See Also:
linkAfterHandler(EOAccessGenericFaultHandler faultHandler, int gen)

processQueue

public static void processQueue(ReferenceQueue refQueue)
Removes fault handlers that are not associated with any editing context from the chain of fault handlers. Each fault handler has a WeakReference to the EOEditingContext associated with it; hence, it does not prevent the editing context from being garbage collected. From time to time, this static method is called to perform housekeeping on the WeakReferences.
Parameters:
refQueue - The ReferenceQueue associated with the WeakReferences of this handler.

setContext

protected void setContext(EODatabaseContext dbcontext,
                          EOEditingContext ec)

Last updated Fri Feb 21 13:15:00 PST 2003.

Copyright © 2003 Apple Computer, Inc.