feature servlet-data added

This commit is contained in:
interp 2002-10-03 00:15:44 +00:00
parent f9f854ef85
commit 30aca350b9
2 changed files with 24 additions and 3 deletions

View File

@ -72,6 +72,8 @@
(export send/suspend ;send and suspend (export send/suspend ;send and suspend
send/finish ;send and finish send/finish ;send and finish
send ;just send (no finish, no suspend) send ;just send (no finish, no suspend)
set-servlet-data!
get-servlet-data
)) ))
(define-interface servlet-handler/admin-interface (define-interface servlet-handler/admin-interface
@ -162,7 +164,10 @@
make-address make-address
returned-via? returned-via?
make-callback)) make-callback
set-servlet-data!
get-servlet-data))
(define-structure servlets servlets-interface (define-structure servlets servlets-interface
(open servlet-handler/servlet (open servlet-handler/servlet
@ -172,6 +177,7 @@
parse-html-forms parse-html-forms
sxml-to-html ; SXML->HTML sxml-to-html ; SXML->HTML
srfi-1 ; FILTER srfi-1 ; FILTER
(subset srfi-13 (string-index))
sxml-tree-trans sxml-tree-trans
url url
httpd-request httpd-request

View File

@ -8,13 +8,15 @@
(define-record-type instance :instance (define-record-type instance :instance
(make-instance servlet-name memo (make-instance servlet-name memo
continuation-table continuation-table-lock continuation-table continuation-table-lock
continuation-counter) continuation-counter
servlet-data)
instance? instance?
(servlet-name instance-servlet-name) (servlet-name instance-servlet-name)
(memo instance-memo set-instance-memo!) (memo instance-memo set-instance-memo!)
(continuation-table instance-continuation-table) (continuation-table instance-continuation-table)
(continuation-table-lock instance-continuation-table-lock) (continuation-table-lock instance-continuation-table-lock)
(continuation-counter instance-continuation-counter)) (continuation-counter instance-continuation-counter)
(servlet-data instance-servlet-data set-instance-servlet-data!))
(define-record memo (define-record memo
(message 'kill) ;kill, killed, adjust-timeout (message 'kill) ;kill, killed, adjust-timeout
@ -350,7 +352,20 @@
(table-set! continuation-table continuation-id #f)) (table-set! continuation-table continuation-id #f))
(release-lock continuation-table-lock))))) (release-lock continuation-table-lock)))))
(define (set-servlet-data! new-data)
(let ((instance (instance-lookup (session-instance-id))))
(if instance
(begin
(set-instance-servlet-data! instance new-data)
#t)
#f)))
(define (get-servlet-data)
(let ((instance (instance-lookup (session-instance-id))))
(if instance
(instance-servlet-data instance)
(error "Instance no longer alive."))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ID generation ;; ID generation
;; locking must be done by caller ;; locking must be done by caller