org.jpox.store.rdbms
Class SchemaAutoStarter

java.lang.Object
  extended byorg.jpox.store.rdbms.SchemaAutoStarter
All Implemented Interfaces:
AutoStartMechanism

public class SchemaAutoStarter
extends java.lang.Object
implements AutoStartMechanism

Implementation of an Auto-Start Mechanism for JPOX. This implementation stores the classes supported in a table in the datastore. It is initialised and read at startup of JPOX, and is continually updated during the lifetime of the calling application.

Version:
$Revision: 1.13 $

Field Summary
protected  java.sql.Connection conn
           
protected  java.lang.String mode
           
static java.lang.String SCHEMA_TABLE
          Name of value for the autoStartMechanism property for this starter.
protected  SchemaTable schemaTable
           
protected  RDBMSManager storeMgr
           
 
Fields inherited from interface org.jpox.store.AutoStartMechanism
MODE_CHECKED, MODE_IGNORED, MODE_QUIET, NONE
 
Constructor Summary
SchemaAutoStarter(RDBMSManager store_mgr, ClassLoaderResolver clr)
          Constructor.
 
Method Summary
 void addClass(StoreData data)
          Method to add a class to the supported list.
 void close()
          Closes a transaction for writting (add/delete) classes to the auto start mechanism
 void deleteAllClasses()
          Method to drop support for all current classes.
 void deleteClass(java.lang.String class_name)
          Method to drop support for a class.
 java.util.Collection getAllClassData()
          Accessor for the data for the classes supported.
 java.lang.String getMode()
          Accessor for the mode of operation.
 java.lang.String getStorageDescription()
          Utility to output the storage description for this mechanism.
 boolean isOpen()
          Whether it's open for writting (add/delete) classes to the auto start mechanism
 void open()
          Starts a transaction for writting (add/delete) classes to the auto start mechanism
 void setMode(java.lang.String mode)
          Mutator for the mode of operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCHEMA_TABLE

public static final java.lang.String SCHEMA_TABLE
Name of value for the autoStartMechanism property for this starter.

See Also:
Constant Field Values

mode

protected java.lang.String mode

schemaTable

protected SchemaTable schemaTable

storeMgr

protected RDBMSManager storeMgr

conn

protected java.sql.Connection conn
Constructor Detail

SchemaAutoStarter

public SchemaAutoStarter(RDBMSManager store_mgr,
                         ClassLoaderResolver clr)
Constructor.

Parameters:
store_mgr - The RDBMSManager managing the store that we are auto-starting.
clr - The ClassLoaderResolver
Method Detail

getMode

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

Specified by:
getMode in interface AutoStartMechanism
Returns:
Mode of operation

setMode

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

Specified by:
setMode in interface AutoStartMechanism
Parameters:
mode - Mode of operation

getAllClassData

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

Specified by:
getAllClassData in interface AutoStartMechanism
Returns:
Collection of classes supported.
Throws:
DatastoreInitialisationException

open

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

Specified by:
open in interface AutoStartMechanism

close

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

Specified by:
close in interface AutoStartMechanism

isOpen

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

Specified by:
isOpen in interface AutoStartMechanism
Returns:
whether this is open for writting

addClass

public void addClass(StoreData data)
Method to add a class to the supported list.

Specified by:
addClass in interface AutoStartMechanism
Parameters:
data - Data for the class to add.

deleteClass

public void deleteClass(java.lang.String class_name)
Method to drop support for a class.

Specified by:
deleteClass in interface AutoStartMechanism
Parameters:
class_name - The class

deleteAllClasses

public void deleteAllClasses()
Method to drop support for all current classes.

Specified by:
deleteAllClasses in interface AutoStartMechanism

getStorageDescription

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

Specified by:
getStorageDescription in interface AutoStartMechanism
Returns:
The storage description


Copyright © -2007 . All Rights Reserved.