org.jpox.store
Interface AutoStartMechanism

All Known Implementing Classes:
ClassesAutoStarter, SchemaAutoStarter, XMLAutoStarter

public interface AutoStartMechanism

Interface defining an Auto-Start Mechanism. An Auto-Start Mechanism is a means of auto-populating the classes supported by a StoreManager.

If the user changes their persistence definition a problem can occur when starting up JPOX. JPOX loads up its existing data from a repository (e.g the table "JPOX_TABLES" for SchemaTableAutoStarter) and finds that a table/class required by the repository data no longer exists. There are 3 options for what JPOX will do in this situation.

Version:
$Revision: 1.5 $

Field Summary
static java.lang.String MODE_CHECKED
          mechanism is in Checked mode
static java.lang.String MODE_IGNORED
          mechanism is in Ignored mode
static java.lang.String MODE_QUIET
          mechanism is in Quiet mode
static java.lang.String NONE
          mechanism is disabled if None
 
Method Summary
 void addClass(StoreData data)
          Method to add a class/field (with its data) to the currently-supported list.
 void close()
          Closes a transaction for writing (add/delete) classes to the auto start mechanism.
 void deleteAllClasses()
          Method to delete all classes that are currently listed as supported in the internal storage.
 void deleteClass(java.lang.String name)
          Method to delete a class/field that is currently listed as supported in the internal storage.
 java.util.Collection getAllClassData()
          Accessor for the data for the classes that are supported.
 java.lang.String getMode()
          Accessor for the mode of operation.
 java.lang.String getStorageDescription()
          Utility to return a description of the storage for this mechanism.
 boolean isOpen()
          Whether it's open for writing (add/delete) classes to the auto start mechanism.
 void open()
          Starts a transaction for writing (add/delete) classes to the auto start mechanism.
 void setMode(java.lang.String mode)
          Mutator for the mode of operation.
 

Field Detail

NONE

public static final java.lang.String NONE
mechanism is disabled if None

See Also:
Constant Field Values

MODE_QUIET

public static final java.lang.String MODE_QUIET
mechanism is in Quiet mode

See Also:
Constant Field Values

MODE_CHECKED

public static final java.lang.String MODE_CHECKED
mechanism is in Checked mode

See Also:
Constant Field Values

MODE_IGNORED

public static final java.lang.String MODE_IGNORED
mechanism is in Ignored mode

See Also:
Constant Field Values
Method Detail

getMode

public java.lang.String getMode()
Accessor for the mode of operation.

Returns:
The mode of operation

setMode

public void setMode(java.lang.String mode)
Mutator for the mode of operation.

Parameters:
mode - The mode of operation

getAllClassData

public java.util.Collection getAllClassData()
                                     throws DatastoreInitialisationException
Accessor for the data for the classes that are supported.

Returns:
Collection of class data (AutoStartData).
Throws:
DatastoreInitialisationException

open

public void open()
Starts a transaction for writing (add/delete) classes to the auto start mechanism.


close

public void close()
Closes a transaction for writing (add/delete) classes to the auto start mechanism.


isOpen

public boolean isOpen()
Whether it's open for writing (add/delete) classes to the auto start mechanism.

Returns:
whether this is open for writing

addClass

public void addClass(StoreData data)
Method to add a class/field (with its data) to the currently-supported list.

Parameters:
data - The data for the class.

deleteClass

public void deleteClass(java.lang.String name)
Method to delete a class/field that is currently listed as supported in the internal storage. TODO Rename this method to allow for deleting fields

Parameters:
name - The name of the class/field

deleteAllClasses

public void deleteAllClasses()
Method to delete all classes that are currently listed as supported in the internal storage.


getStorageDescription

public java.lang.String getStorageDescription()
Utility to return a description of the storage for this mechanism.

Returns:
The storage description.


Copyright © -2007 . All Rights Reserved.