summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/SessionState.h
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-02-25 16:56:29 +0000
committerGordon Sim <gsim@apache.org>2008-02-25 16:56:29 +0000
commit773cc35a38cd34095f8800259ee7a2165a817053 (patch)
tree24c6b26d43ae2f95a7ad7be695bbe57ddbc4b641 /cpp/src/qpid/broker/SessionState.h
parentf4e2d3de5df7bbaae41053191638734a991fd21c (diff)
downloadqpid-python-773cc35a38cd34095f8800259ee7a2165a817053.tar.gz
Some refactoring of the 0-10 codepath (being migrated to final spec) that primarily colocates the current session and execution layers to facilitate implementing the new session layer that will now encompass this behaviour.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@630934 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SessionState.h')
-rw-r--r--cpp/src/qpid/broker/SessionState.h48
1 files changed, 38 insertions, 10 deletions
diff --git a/cpp/src/qpid/broker/SessionState.h b/cpp/src/qpid/broker/SessionState.h
index 8a12e580b7..98c21a8ab5 100644
--- a/cpp/src/qpid/broker/SessionState.h
+++ b/cpp/src/qpid/broker/SessionState.h
@@ -27,10 +27,15 @@
#include "qpid/framing/SessionState.h"
#include "qpid/framing/ProtocolVersion.h"
#include "qpid/sys/Mutex.h"
-#include "qpid/sys/OutputControl.h"
#include "qpid/sys/Time.h"
#include "qpid/management/Manageable.h"
#include "qpid/management/Session.h"
+#include "BrokerAdapter.h"
+#include "DeliveryAdapter.h"
+#include "MessageBuilder.h"
+#include "SessionContext.h"
+#include "SemanticState.h"
+#include "IncomingExecutionContext.h"
#include <boost/noncopyable.hpp>
#include <boost/scoped_ptr.hpp>
@@ -47,8 +52,7 @@ class AMQP_ClientProxy;
namespace broker {
-class SemanticHandler;
-class SessionContext;
+class SessionHandler;
class SessionManager;
class Broker;
class ConnectionState;
@@ -58,8 +62,8 @@ class ConnectionState;
* themselves have state.
*/
class SessionState : public framing::SessionState,
- public framing::FrameHandler::Chains,
- public sys::OutputControl,
+ public SessionContext,
+ public DeliveryAdapter,
public management::Manageable
{
public:
@@ -67,10 +71,10 @@ class SessionState : public framing::SessionState,
bool isAttached() { return handler; }
void detach();
- void attach(SessionContext& handler);
+ void attach(SessionHandler& handler);
- SessionContext* getHandler();
+ SessionHandler* getHandler();
/** @pre isAttached() */
framing::AMQP_ClientProxy& getProxy();
@@ -85,6 +89,19 @@ class SessionState : public framing::SessionState,
/** OutputControl **/
void activateOutput();
+ void handle(framing::AMQFrame& frame);
+ void handleCommand(framing::AMQMethodBody* method);
+ void handleContent(framing::AMQFrame& frame);
+
+ void complete(uint32_t cumulativeExecutionMark, const framing::SequenceNumberSet& range);
+ void flush();
+ void noop();
+ void sync();
+ void sendCompletion();
+
+ //delivery adapter methods:
+ DeliveryId deliver(QueuedMessage& msg, DeliveryToken::shared_ptr token);
+
// Manageable entry points
management::ManagementObject::shared_ptr GetManagementObject (void) const;
management::Manageable::status_t
@@ -92,21 +109,32 @@ class SessionState : public framing::SessionState,
// Normally SessionManager creates sessions.
SessionState(SessionManager*,
- SessionContext* out,
+ SessionHandler* out,
uint32_t timeout,
uint32_t ackInterval);
private:
+ typedef boost::function<void(DeliveryId, DeliveryId)> RangedOperation;
+
SessionManager* factory;
- SessionContext* handler;
+ SessionHandler* handler;
framing::Uuid id;
uint32_t timeout;
sys::AbsTime expiry; // Used by SessionManager.
Broker& broker;
framing::ProtocolVersion version;
sys::Mutex lock;
- boost::scoped_ptr<SemanticHandler> semanticHandler;
+
+ SemanticState semanticState;
+ BrokerAdapter adapter;
+ MessageBuilder msgBuilder;
+
+ //execution state
+ IncomingExecutionContext incoming;
+ framing::Window outgoing;
+ RangedOperation ackOp;
+
management::Session::shared_ptr mgmtObject;
friend class SessionManager;