|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
stella.parameter.AbstractParameter
stella.parameter.AbstractDatabaseParameter
public abstract class AbstractDatabaseParameter
An abstract implementation of a parameter that connects to a database.
It composes with a GenericSql object, which connects on init.
Each query to the parameter via the get() and set(java.lang.Object) method
first checks if the connections is open, if it was closed unexpectedely
and the KEY_ALLOWREOPEN property points to true, its is opened
again. If successful, the abstract methods getFromOpenDatabase()
or setIntoOpenDatabase(java.lang.Object) methods are called.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.PropertyContainer |
|---|
PropertyContainer.URLResource |
| Field Summary | |
|---|---|
private GenericSql |
db
My SQL instance. |
private static boolean |
DEFALLOWREOPEN
The key to the unique trigger name. |
static String |
KEY_ALLOWREOPEN
The key to the unique trigger name. |
| Fields inherited from class stella.parameter.AbstractParameter |
|---|
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWN |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR, KEY_NOINITONCREATE, KEY_RESOURCEBUNDLES |
| Fields inherited from interface util.PropertyBearing |
|---|
CONFIG, KEY_CLASS, KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Constructor Summary | |
|---|---|
protected |
AbstractDatabaseParameter(Map prop)
Constructs a new database parameter. |
| Method Summary | |
|---|---|
void |
exit()
On exit, we close the database, if we are open. |
Object |
get()
Gets the parameter from the database. |
protected abstract Object |
getFromOpenDatabase()
This method is called if the database is ready for data retrieval. |
void |
init()
Initializes the database and tries to open it. |
Object |
set(Object to)
Sets the parameter from the database. |
protected abstract Object |
setIntoOpenDatabase(Object to)
This method is calles if the database is ready to insert a new value. |
| Methods inherited from class stella.parameter.AbstractParameter |
|---|
createParameter, delivers, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, register, rescanned, setName, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface util.PropertyBearing |
|---|
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getLocalized, getProperties, getProperty, getResource, getResourceAsStream, getResources, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
| Field Detail |
|---|
public static final String KEY_ALLOWREOPEN
private static final boolean DEFALLOWREOPEN
private GenericSql db
| Constructor Detail |
|---|
protected AbstractDatabaseParameter(Map prop)
init().
| Method Detail |
|---|
public void init()
init in interface Initializableinit in class AbstractParameterpublic void exit()
exit in interface ExitCleaningexit in class AbstractParameterpublic Object get()
KEY_ALLOWREOPEN property
points to true, we reopen.
public Object set(Object to)
KEY_ALLOWREOPEN property
points to true, we reopen.
protected abstract Object getFromOpenDatabase()
protected abstract Object setIntoOpenDatabase(Object to)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||