|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.hammurapi.config.ComponentBase
biz.hammurapi.persistence.ChunkingStringStorage
public class ChunkingStringStorage
This class manages storage and retrieval of strings to and from relational database. Strings can be of arbitrary size, long strings are cut into chunks. Strings are keyed by integers. Often used strings are cached in memory using soft references.
Field Summary |
---|
Fields inherited from class biz.hammurapi.config.ComponentBase |
---|
owner |
Constructor Summary | |
---|---|
ChunkingStringStorage()
|
Method Summary | |
---|---|
java.lang.Integer |
addText(java.lang.String text)
Returns key for given text. |
protected java.lang.Object |
getChild(java.lang.String name)
Alternative way to access text entries. |
java.lang.String |
getText(java.lang.Integer key)
Returns string by key. |
void |
setChunkSize(int chunkSize)
Size of individual text chunk. |
void |
setDatasource(javax.sql.DataSource datasource)
Data source |
void |
setIdentityManager(biz.hammurapi.sql.IdentityManager identityManager)
Identity manager is used to generate/retrieve identity of newely inserted entries. |
void |
setTimer(java.util.Timer timer)
Timer for cleaning up memory entries, can be null. |
void |
start()
Starts timer and cache. |
void |
stop()
Stops memory cache and times. |
Methods inherited from class biz.hammurapi.config.ComponentBase |
---|
addMeasurement, get, getMeasurementConsumer, getOwner, getOwner, setMeasurementConsumer, setOwner |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChunkingStringStorage()
Method Detail |
---|
public void setTimer(java.util.Timer timer)
timer
- public void setDatasource(javax.sql.DataSource datasource)
datasource
- public java.lang.String getText(java.lang.Integer key)
StringStorage
getText
in interface StringStorage
public java.lang.Integer addText(java.lang.String text)
StringStorage
addText
in interface StringStorage
public void stop()
stop
in interface biz.hammurapi.config.Component
public void setIdentityManager(biz.hammurapi.sql.IdentityManager identityManager)
identityManager
- public void setChunkSize(int chunkSize)
chunkSize
- public void start() throws biz.hammurapi.config.ConfigurationException
start
in interface biz.hammurapi.config.Component
biz.hammurapi.config.ConfigurationException
protected java.lang.Object getChild(java.lang.String name)
getChild
in class biz.hammurapi.config.ComponentBase
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |