|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.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
|
static int |
PERSIST_ACTION_UPDATE_STRING
|
Constructor Summary | |
---|---|
AblePersistenceSupport(java.lang.String persistenceDatabaseName,
java.lang.String persistenceTableName,
java.lang.String[] persistenceTableColumnNames,
java.lang.String[] persistenceTableColumnTypes,
long PPSIntervalCheckTime,
AblePersistenceSupportProcessor processor,
AbleSecuritySupport securitySupport)
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. |
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.lang.Object[] row)
Handles inserting a record into the table this support Object is dealing with. |
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. |
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. |
boolean |
update(java.lang.Object[] row,
java.lang.String whereString)
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_STRING
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 persistenceDatabaseName, java.lang.String persistenceTableName, java.lang.String[] persistenceTableColumnNames, java.lang.String[] persistenceTableColumnTypes, long PPSIntervalCheckTime, AblePersistenceSupportProcessor processor, AbleSecuritySupport securitySupport)
An AblePersistenceSupport is a support Object that others will use to persist information.
persistenceDatabaseName
- The database that this persistence support will be using.
persistenceTableName
- The table that this persistence support will be using.
persistenceTableColumnNames
- The column names of the table that is being persisted to.
persistenceTableColumnTypes
- The column types of the table that is being persisted to.
PPSIntervalCheckTime
- The interval between checks to the PlatformPersistenceService
to see if the PlatformPersistenceService is up and ready.
processor
- The AblePersistenceSupportProcessor that will be called back to with the
persisted information this AblePersistenceSupport grabs from persistence.
securitySupport
- The AbleSecuritySupport Object that will assist in security issues.Method Detail |
public void processAbleEvent(AbleEvent theAbleEvent) throws AbleException
AbleEventQueueProcessor
This 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 AbleEventQueueProcessor
com.ibm.able.AbleEventQueueProcessor
theAbleEvent
- The event to process.AbleException
- If an error occurs.public void processTimerEvent() throws AbleException
processTimerEvent
in interface AbleEventQueueProcessor
AbleException
- public void processNoEventProcessingEnabledSituation() throws AbleException
AbleEventQueueProcessor
This 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 AbleEventQueueProcessor
com.ibm.able.AbleEventQueueProcessor
AbleException
- If an error occurs.public void setState(int theState) throws AbleException
AbleEventQueueProcessor
This method is called by an AbleEventQueue when the queue's run time loop changes state; for example, from Waiting to Active.
setState
in interface AbleEventQueueProcessor
com.ibm.able.AbleEventQueueProcessor
theState
- An AbleState
value.
AbleException
- If an error occurs.public int getState() throws AbleException
AbleEventQueueProcessor
This method is called by an AbleEventQueue when the queue needs to interrogate the state of its container.
getState
in interface AbleEventQueueProcessor
com.ibm.able.AbleEventQueueProcessor
AbleState
value.AbleException
- If an error occurs.public AbleLogger getLogger() throws AbleException
AbleEventQueueProcessor
getLogger
in interface AbleEventQueueProcessor
com.ibm.able.AbleEventQueueProcessor
AbleException
- 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.lang.Object[] row)
row
- An Object[] representing the row that is to be inserted.
public boolean update(java.lang.Object[] row, java.lang.String whereString)
row
- An Object[] representing the row that is the new updated info.
whereString
- The where string for the update statement that will specify
which records are to be updated.
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()
|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |