|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectcom.ibm.able.platform.AblePersistenceSupport
AblePersistenceSupport is a support Object that others can use to persist information.
Services and Agents and any other part of the platform may wish to persist information, and to do so, they can instantiate one of these Objects. In AblePersistenceSupport's ctor, the database and table to write to, the format of this table, and some addtional processing information will be passed in.
The use of this support object is dependant on the AblePlatformPersistenceService being up and running in the platform. If this object attempts to persist some information while the AblePlatformPersistenceService is not ready to be used, this support object will queue up these missed persist actions and attempt them when the service becomes available.
The class that creates one of these support objects should also implement the AblePersistenceSupportProcessor interface. This is necessary so this support object can call back to the AblePersistenceSupportProcessor that created it and pass back all previously persisted information.
| Field Summary | |
|---|---|
static int |
PERSIST_ACTION_ADD
Different types of persist actions that can occur |
static int |
PERSIST_ACTION_REMOVE_MAP
|
static int |
PERSIST_ACTION_REMOVE_STRING
|
static int |
PERSIST_ACTION_UPDATE_MAP
|
| Constructor Summary | |
|---|---|
AblePersistenceSupport(java.lang.String thePersistenceDatabaseName,
java.lang.String thePersistenceTableName,
java.lang.String thePersistenceSchema,
java.lang.String[] thePersistenceTableColumnNames,
java.lang.String[] thePersistenceTableColumnTypes,
long thePPSIntervalCheckTime,
AblePersistenceSupportProcessor theProcessor,
AbleSecuritySupport theSecuritySupport)
Creates a new AblePersistenceSupport with the supplied properties. |
|
AblePersistenceSupport(java.lang.String thePersistenceDatabaseName,
java.lang.String thePersistenceTableName,
java.lang.String thePersistenceSchema,
java.lang.String[] thePersistenceTableColumnNames,
java.lang.String[] thePersistenceTableColumnTypes,
long thePPSIntervalCheckTime,
AblePersistenceSupportProcessor theProcessor,
AbleSecuritySupport theSecuritySupport,
boolean theWriteOnlyFlag)
Creates a new AblePersistenceSupport with the supplied properties. |
|
| Method Summary | |
|---|---|
boolean |
delete(java.util.Map whereMap)
Handles deleting a record from the table this support Object is dealing with. |
boolean |
delete(java.lang.String whereString)
Handles deleting a record from the table this support Object is dealing with. |
static java.io.Serializable |
Deserialize(byte[] objInBytes)
Deserializes the given byte array into a Serializable object with the state of the object restored to when it was serialized. |
java.lang.String |
getDatabaseName()
Gets the name of the database used by this persistence support object. |
AbleLogger |
getLogger()
Returns a message logger object from the event queue's container. |
int |
getState()
Returns the state of the event queue's container. |
java.lang.String[] |
getTableColumnNames()
Gets a collection of the names of the columns in the table used by this persistence support object. |
java.lang.String[] |
getTableColumnTypes()
Gets a collection of the data types of the columns in the table used by this persistence support object. |
java.lang.String |
getTableName()
Gets the name of the database table used by this persistence support object. |
boolean |
insert(java.io.Serializable[] row)
Handles inserting a record into the table this support Object is dealing with. |
static boolean |
isBaseSQLObject(java.lang.Object obj)
Determines if the passed in Object is one of the SQL base Object types. |
java.io.Serializable |
nextId(java.lang.String columnName)
Return the row id number for the next record to write to the log. |
void |
processAbleEvent(AbleEvent theAbleEvent)
Processes an Able event synchronously; that is, on the same thread as the caller. |
void |
processNoEventProcessingEnabledSituation()
Processes the situation where neither timer nor Able event processing is enabled in the event queue, but the event queue's asynchronous thread of control has been started. |
void |
processTimerEvent()
This will be called if we are waiting for the PlatformPersistenceService to get back up. |
void |
quitAll()
This method will nicely shut down this AblePersistenceSupport Object. |
static byte[] |
Serialize(java.io.Serializable obj)
Serializes the given Object into a byte array. |
void |
setState(int theState)
Sets the state of the event queue's container. |
boolean |
update(java.util.Map updateMap,
java.util.Map whereMap)
Handles updating a record in the table this support Object is dealing with. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int PERSIST_ACTION_ADD
public static final int PERSIST_ACTION_UPDATE_MAP
public static final int PERSIST_ACTION_REMOVE_STRING
public static final int PERSIST_ACTION_REMOVE_MAP
| Constructor Detail |
public AblePersistenceSupport(java.lang.String thePersistenceDatabaseName,
java.lang.String thePersistenceTableName,
java.lang.String thePersistenceSchema,
java.lang.String[] thePersistenceTableColumnNames,
java.lang.String[] thePersistenceTableColumnTypes,
long thePPSIntervalCheckTime,
AblePersistenceSupportProcessor theProcessor,
AbleSecuritySupport theSecuritySupport)
An AblePersistenceSupport is a support Object that others will use to persist information.
thePersistenceDatabaseName - The database that this persistence support will be using.
thePersistenceTableName - The table that this persistence support will be using.
thePersistenceSchema - The schema of the table that this persistence support will be using.
thePersistenceTableColumnNames - The column names of the table that is being persisted to.
thePersistenceTableColumnTypes - The column types of the table that is being persisted to.
thePPSIntervalCheckTime - The interval between checks to the PlatformPersistenceService
to see if the PlatformPersistenceService is up and ready.
theProcessor - The AblePersistenceSupportProcessor that will be called back to with the
persisted information this AblePersistenceSupport grabs from persistence.
theSecuritySupport - The AbleSecuritySupport Object that will assist in security issues.
public AblePersistenceSupport(java.lang.String thePersistenceDatabaseName,
java.lang.String thePersistenceTableName,
java.lang.String thePersistenceSchema,
java.lang.String[] thePersistenceTableColumnNames,
java.lang.String[] thePersistenceTableColumnTypes,
long thePPSIntervalCheckTime,
AblePersistenceSupportProcessor theProcessor,
AbleSecuritySupport theSecuritySupport,
boolean theWriteOnlyFlag)
An AblePersistenceSupport is a support Object that others will use to persist information.
thePersistenceDatabaseName - The database that this persistence support will be using.
thePersistenceTableName - The table that this persistence support will be using.
thePersistenceSchema - The schema of the table that this persistence support will be using.
thePersistenceTableColumnNames - The column names of the table that is being persisted to.
thePersistenceTableColumnTypes - The column types of the table that is being persisted to.
thePPSIntervalCheckTime - The interval between checks to the PlatformPersistenceService
to see if the PlatformPersistenceService is up and ready.
theProcessor - The AblePersistenceSupportProcessor that will be called back to with the
persisted information this AblePersistenceSupport grabs from persistence.
theSecuritySupport - The AbleSecuritySupport Object that will assist in security issues.theWriteOnlyFlag - If true, only the export object is created. The table will be used for output only.| Method Detail |
public void processAbleEvent(AbleEvent theAbleEvent)
throws AbleException
AbleEventQueueProcessorThis method is called by the AbleEventQueue when an event is removed from the queue for asynchronous processing. Note that this method also can be called directly from the handleAbleEvent() method described in the AbleEventListener interface when that method is given a synchronous event to handle.
processAbleEvent in interface AbleEventQueueProcessortheAbleEvent - The event to process.
AbleException - If an error occurs.
public void processTimerEvent()
throws AbleException
processTimerEvent in interface AbleEventQueueProcessorAbleException
public void processNoEventProcessingEnabledSituation()
throws AbleException
AbleEventQueueProcessorThis method is called by an AbleEventQueue when the queue is neither enabled for timer processing nor Able event processing. When neither type of processing is enabled, the queue is in a tight processing loop, consuming CPU cycles. This method is called so that the event queue's container can do something about the situation or perform some other type of asynchronous processing.
processNoEventProcessingEnabledSituation in interface AbleEventQueueProcessorAbleException - If an error occurs.
public void setState(int theState)
throws AbleException
AbleEventQueueProcessorThis method is called by an AbleEventQueue when the queue's run time loop changes state; for example, from Waiting to Active.
setState in interface AbleEventQueueProcessortheState - An AbleState value.
AbleException - If an error occurs.
public int getState()
throws AbleException
AbleEventQueueProcessorThis method is called by an AbleEventQueue when the queue needs to interrogate the state of its container.
getState in interface AbleEventQueueProcessorAbleState value.
AbleException - If an error occurs.
public AbleLogger getLogger()
throws AbleException
AbleEventQueueProcessor
getLogger in interface AbleEventQueueProcessorAbleException - If an error occurs.public final java.lang.String getDatabaseName()
public final java.lang.String getTableName()
public final java.lang.String[] getTableColumnNames()
public final java.lang.String[] getTableColumnTypes()
["java.lang.Object"] is returned.public boolean insert(java.io.Serializable[] row)
row - An Serializable[] representing the row that is to be inserted.
public boolean update(java.util.Map updateMap,
java.util.Map whereMap)
updateMap - This is the new data for the record that is to be updated. This is
a Map where the keys are the column names and the values are the
column values. When using a Map the columns that are not changing
do not have to be presents.
whereMap - This is a Map that will be used to build the where clause. The keys
will be the column names, and the values will be the Object to match
to for their respective column. If left null, or empty, everything
will be deleted.
public boolean delete(java.lang.String whereString)
whereString - The where string for the update statement that will specify
which records are to be updated.
public boolean delete(java.util.Map whereMap)
whereMap - This is a Map that will be used to build the where clause. The keys
will be the column names, and the values will be the Object to match
to for their respective column. If left null, or empty, everything
will be deleted.
public void quitAll()
public static boolean isBaseSQLObject(java.lang.Object obj)
A byte[] cannot be considered a base type because we will assume that all byte[]s returned from persistence will need to be deserialized back into a Serializable, not a byte[].
The following are considered base SQL Object tyeps:
obj - Object to be check if it is one of the base SQL Object types.
obj is a base SQL Object type,
otherwise false.
public static byte[] Serialize(java.io.Serializable obj)
throws AbleException
obj - Serializable object to be serialized.
AbleException - If the serialization was not successful.
public static java.io.Serializable Deserialize(byte[] objInBytes)
throws AbleException
objInBytes - byte [] that is the byte array of a Serialized object
to be restored.
AbleException - If the deserialization was not successful.public java.io.Serializable nextId(java.lang.String columnName)
columnName - The name of the column in the ABLEPLATFORMLOG table used as a row identifier.
|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||