/[de-setf-amqp]/AMQP-1-1-0-9-1/device-level.lisp
ViewVC logotype

Contents of /AMQP-1-1-0-9-1/device-level.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (show annotations)
Tue Feb 23 09:05:39 2010 UTC (4 years, 1 month ago) by janderson
File size: 1905 byte(s)
Merge commit 'remotes/github/master' into remotes/git-svn
1 ;;; -*- Package: de.setf.amqp.implementation; -*-
2
3 (in-package :de.setf.amqp.implementation)
4
5 (document :file
6 (description "This file defines version-specific connecttion and channel operators for AMPQ version 0.9r1
7 of the `de.setf.amqp` library.")
8 (copyright
9 "Copyright 2010 [james anderson](mailto:james.anderson@setf.de) All Rights Reserved"
10 "'de.setf.amqp' is free software: you can redistribute it and/or modify it under the terms of version 3
11 of the GNU Affero General Public License as published by the Free Software Foundation.
12
13 'setf.amqp' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
14 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 See the Affero General Public License for more details.
16
17 A copy of the GNU Affero General Public License should be included with 'de.setf.amqp' as `AMQP:agpl.txt`.
18 If not, see the GNU [site](http://www.gnu.org/licenses/)."))
19
20
21 (defmethod shared-initialize ((instance amqp-1-1-0-9-1:connection) (slots t) &key)
22 ;; after slot-initialization, but before device-open, set frame classes
23 ;; set iff unbound to permit reinitialization from change-class
24 (call-next-method)
25 (flet ((conditionally-set (name value)
26 (unless (slot-boundp instance name)
27 (setf (slot-value instance name) value))))
28 (conditionally-set 'input-frame-class '7-byte-header-input-frame)
29 (conditionally-set 'output-frame-class '7-byte-header-output-frame)))
30
31
32 (defmethod connection-frame-type-class-name ((connection amqp-1-1-0-9-1:connection) code)
33 (ecase code
34 (0 nil)
35 (1 'amqp:method)
36 (2 'amqp:header)
37 (3 'amqp:body)
38 (4 'amqp:heartbeat)))
39
40 (defmethod connection-class-name-frame-type ((connection amqp-1-1-0-9-1::connection) name)
41 (ecase name
42 ((nil) 0)
43 (amqp:method 1)
44 (amqp:header 2)
45 (amqp:body 3)
46 (amqp:heartbeat 4)))
47

  ViewVC Help
Powered by ViewVC 1.1.5