org.jpox.store.rdbms
Class SchemaAutoStarter

java.lang.Object
  extended by org.jpox.store.AbstractAutoStartMechanism
      extended by org.jpox.store.rdbms.SchemaAutoStarter
All Implemented Interfaces:
AutoStartMechanism

public class SchemaAutoStarter
extends AbstractAutoStartMechanism

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.16 $

Field Summary
protected  java.sql.Connection conn
           
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 class org.jpox.store.AbstractAutoStartMechanism
LOCALISER, mode, open
 
Fields inherited from interface org.jpox.store.AutoStartMechanism
MODE_CHECKED, MODE_IGNORED, MODE_QUIET, NONE
 
Constructor Summary
SchemaAutoStarter(StoreManager 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 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
 
Methods inherited from class org.jpox.store.AbstractAutoStartMechanism
getMode, setMode
 
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

schemaTable

protected SchemaTable schemaTable

storeMgr

protected RDBMSManager storeMgr

conn

protected java.sql.Connection conn
Constructor Detail

SchemaAutoStarter

public SchemaAutoStarter(StoreManager store_mgr,
                         ClassLoaderResolver clr)
Constructor.

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

getAllClassData

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

Returns:
Collection of classes supported (StoreData). Collection of StoreData elements
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
Overrides:
open in class AbstractAutoStartMechanism

close

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

Specified by:
close in interface AutoStartMechanism
Overrides:
close in class AbstractAutoStartMechanism

isOpen

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

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

addClass

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

Parameters:
data - Data for the class to add.

deleteClass

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

Parameters:
class_name - The class

deleteAllClasses

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


getStorageDescription

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

Returns:
The storage description


Copyright © -2008 . All Rights Reserved.