From scaekenberghe at common-lisp.net Fri Mar 16 15:37:18 2007 From: scaekenberghe at common-lisp.net (scaekenberghe) Date: Fri, 16 Mar 2007 10:37:18 -0500 (EST) Subject: [cl-prevalence-cvs] CVS cl-prevalence/src Message-ID: <20070316153718.252C94D05F@common-lisp.net> Update of /project/cl-prevalence/cvsroot/cl-prevalence/src In directory clnet:/tmp/cvs-serv14547/src Modified Files: serialization.lisp Log Message: fixed a bug serializing empty hashtables in s-expr format (thx to Sacha De Vos for reporting this) --- /project/cl-prevalence/cvsroot/cl-prevalence/src/serialization.lisp 2006/01/31 12:41:48 1.10 +++ /project/cl-prevalence/cvsroot/cl-prevalence/src/serialization.lisp 2007/03/16 15:37:18 1.11 @@ -1,6 +1,6 @@ ;;;; -*- mode: Lisp -*- ;;;; -;;;; $Id: serialization.lisp,v 1.10 2006/01/31 12:41:48 scaekenberghe Exp $ +;;;; $Id: serialization.lisp,v 1.11 2007/03/16 15:37:18 scaekenberghe Exp $ ;;;; ;;;; XML and S-Expression based Serialization for Common Lisp and CLOS ;;;; @@ -379,8 +379,9 @@ (write-string " . " stream) (serialize-sexp-internal value stream serialization-state) (princ ")" stream)) - object)) - (write-string " ) )" stream))))) + object) + (write-string " )" stream)) + (write-string " )" stream))))) (defmethod serialize-xml-internal ((object structure-object) stream serialization-state) (let ((id (known-object-id serialization-state object))) From scaekenberghe at common-lisp.net Fri Mar 16 15:37:18 2007 From: scaekenberghe at common-lisp.net (scaekenberghe) Date: Fri, 16 Mar 2007 10:37:18 -0500 (EST) Subject: [cl-prevalence-cvs] CVS cl-prevalence/test Message-ID: <20070316153718.5B92A4E008@common-lisp.net> Update of /project/cl-prevalence/cvsroot/cl-prevalence/test In directory clnet:/tmp/cvs-serv14547/test Modified Files: test-serialization.lisp Log Message: fixed a bug serializing empty hashtables in s-expr format (thx to Sacha De Vos for reporting this) --- /project/cl-prevalence/cvsroot/cl-prevalence/test/test-serialization.lisp 2006/01/31 12:41:48 1.5 +++ /project/cl-prevalence/cvsroot/cl-prevalence/test/test-serialization.lisp 2007/03/16 15:37:18 1.6 @@ -1,6 +1,6 @@ ;;;; -*- mode: Lisp -*- ;;;; -;;;; $Id: test-serialization.lisp,v 1.5 2006/01/31 12:41:48 scaekenberghe Exp $ +;;;; $Id: test-serialization.lisp,v 1.6 2007/03/16 15:37:18 scaekenberghe Exp $ ;;;; ;;;; Testing XML and S-Expression based Serialization for Common Lisp and CLOS ;;;; @@ -277,4 +277,16 @@ (maphash #'(lambda (k v) (assert (equal v (gethash k h2)))) *hashtable*) (maphash #'(lambda (k v) (assert (equal v (gethash k *hashtable*)))) h2)) +(defparameter *empty-hashtable* (make-hash-table)) + +(let (h2) + (setf h2 (serialize-and-deserialize-xml *empty-hashtable*)) + (maphash #'(lambda (k v) (assert (equal v (gethash k h2)))) *empty-hashtable*) + (maphash #'(lambda (k v) (assert (equal v (gethash k *hashtable*)))) h2)) + +(let (h2) + (setf h2 (serialize-and-deserialize-sexp *empty-hashtable*)) + (maphash #'(lambda (k v) (assert (equal v (gethash k h2)))) *empty-hashtable*) + (maphash #'(lambda (k v) (assert (equal v (gethash k *hashtable*)))) h2)) + ;;; eof From scaekenberghe at common-lisp.net Thu Mar 29 11:51:17 2007 From: scaekenberghe at common-lisp.net (scaekenberghe) Date: Thu, 29 Mar 2007 06:51:17 -0500 (EST) Subject: [cl-prevalence-cvs] CVS public_html Message-ID: <20070329115117.C89AC3F011@common-lisp.net> Update of /project/cl-prevalence/cvsroot/public_html In directory clnet:/tmp/cvs-serv17512 Modified Files: CL-PREVALENCE.html Log Message: documentation update --- /project/cl-prevalence/cvsroot/public_html/CL-PREVALENCE.html 2004/06/21 14:34:01 1.1 +++ /project/cl-prevalence/cvsroot/public_html/CL-PREVALENCE.html 2007/03/29 11:51:17 1.2 @@ -15,6 +15,8 @@
Copy the bytes from blob to binary-output-stream
(destroy blob) generic-function
Completely destroy blob (removing its byte data file as well)+
(drop-index-on system class &optional slots) function
+Drop indexes on each of the slots provided
(execute system object) generic-function
Ask for a transaction object to be executed on system with ACID properties
(execute-transaction transaction-call) function
@@ -27,6 +29,8 @@Return an unordered collection of all objects in system that are instances of class
(find-object-with-id system class id) generic-function
Find and return the object in system of class with id, null if not found+
(find-object-with-slot system class slot value &optional test) generic-function
+Find and return the object in system of class with slot equal to value, null if not found
(get-file blob) generic-function
Return the pathname to the bytes of blob
(get-guard guarded-prevalence-system) generic-function
@@ -62,10 +66,12 @@guarded-prevalence-system class
A Prevalence system with a guard thunk
Class precedence list: guarded-prevalence-system prevalence-system standard-object t-
Class init args: :directory+
Class init args: :directory :serializer :deserializer :file-extension :transaction-hook+
(index-on system class &optional slots (test (quote equalp))) function
+Create indexes on each of the slots provided.
(initiates-rollback condition) generic-function
Return true when a condition initiates a rollback when thrown from a transaction-
(make-prevalence-system directory &key (prevalence-system-class (quote prevalence-system))) function
+(make-prevalence-system directory &key (prevalence-system-class (quote prevalence-system)) init-args) function
Create and return a new prevalence system on directory. When the directory contains a valid snapshot and/or transaction log file, the system will be restored. Optionally specify the prevalence system's @@ -85,37 +91,35 @@prevalence-system class
Base Prevalence system implementation objectClass precedence list: prevalence-system standard-object t-Class init args: :directory-(print-snapshot system) function
-Echo the XML making up the snapshot of system to t-(print-transaction-log system) function
-Echo the XML making up the transaction log of system to t+Class init args: :transaction-hook :file-extension :deserializer :serializer :directory(query system function &rest args) generic-function
Ask for a query function to be executed on system with args(remove-root-object system name) generic-function
Remove the root object by symbol name from system(restore system) generic-function
Restore a system from permanent storage-(set-slot-values instance slots-and-values) function
-Set slots and values of instance-(show-transaction-log system) function
-Print the transaction objects making up the transaction log of system to t(snapshot system) generic-function
Take a snapshot of a system+(start-master-client prevalence-system &key (host localhost) (port 7651)) function
+Start a connection to host:port to deliver transactions from prevalence-system+(start-slave-server prevalence-system &key (port 7651)) function
+Start a server on port accepting transactions to be executed on prevalence-system+(stop-master-client prevalence-sytem) function
+Stop a connection from prevalence-system+(totally-destroy system &key abort) generic-function
+Totally destroy system from permanent storage by deleting any files that we findtransaction class
A simple Transaction object joining a function and its argumentsClass precedence list: transaction standard-object tClass init args: :function :args-(transaction-log-tail system &optional (count 8)) function
-Return a list of the count last transaction objects of system(tx-change-object-slots system class id slots-and-values) function
Change some slots of the object of class with id in system using slots and values(tx-create-id-counter system) function
Initialize the id counter to 0-(tx-create-object system &optional class slots-and-values) function
+(tx-create-object system class &optional slots-and-values) function
Create a new object of class in system, assigning it a unique id, optionally setting some slots and values(tx-delete-object system class id) function
-Delete the object of class with if from the system+Delete the object of class with id from the system(tx-set-preference system key value) function
Set the value of the persistent preference key in system-Documentation generated by lispdoc running on LispWorks