summaryrefslogtreecommitdiffstats
path: root/queue.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-11 14:34:53 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-11 14:34:53 +0000
commitdd575394dba4f1943a5185a5f40750a4293b7203 (patch)
tree360bdc8e0588c1330b80a4cab8c7ce61b1fd742b /queue.c
parent8dad3997505f71e6e9962892f79d7b7dad0a89ce (diff)
downloadrsyslog-dd575394dba4f1943a5185a5f40750a4293b7203.tar.gz
rsyslog-dd575394dba4f1943a5185a5f40750a4293b7203.tar.xz
rsyslog-dd575394dba4f1943a5185a5f40750a4293b7203.zip
support for object property bags added
Diffstat (limited to 'queue.c')
-rw-r--r--queue.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/queue.c b/queue.c
index 0d59a068..91d89b06 100644
--- a/queue.c
+++ b/queue.c
@@ -46,6 +46,7 @@
#include "obj.h"
/* static data */
+DEFobjStaticHelpers
/* methods */
@@ -498,6 +499,7 @@ rsRetVal queueConstruct(queue_t **ppThis, queueType_t qType, int iWorkerThreads,
}
/* we have an object, so let's fill the properties */
+ objConstructSetObjInfo(pThis);
if((pThis->pszSpoolDir = (uchar*) strdup((char*)glblGetWorkDir())) == NULL)
ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
@@ -633,6 +635,10 @@ static rsRetVal queuePersist(queue_t *pThis)
CHKiRet(strmSetFName(psQIF, pszQIFNam, lenQIFNam));
CHKiRet(strmConstructFinalize(psQIF));
+ /* first, write the property bag for ourselfs */
+ CHKiRet(objBeginSerializePropBag(psQIF, (obj_t*) pThis));
+ CHKiRet(objEndSerialize(psQIF));
+
/* this is disk specific and must be moved to a function */
CHKiRet(strmSerialize(pThis->tVars.disk.pWrite, psQIF));
CHKiRet(strmSerialize(pThis->tVars.disk.pRead, psQIF));
@@ -799,6 +805,17 @@ finalize_it:
/* some simple object access methods */
DEFpropSetMeth(queue, bImmediateShutdown, int);
+
+/* Initialize the stream class. Must be called as the very first method
+ * before anything else is called inside this class.
+ * rgerhards, 2008-01-09
+ */
+BEGINObjClassInit(queue, 1)
+ //OBJSetMethodHandler(objMethod_SERIALIZE, strmSerialize);
+ //OBJSetMethodHandler(objMethod_SETPROPERTY, strmSetProperty);
+ //OBJSetMethodHandler(objMethod_CONSTRUCTION_FINALIZER, strmConstructFinalize);
+ENDObjClassInit(strm)
+
/*
* vi:set ai:
*/