diff options
| author | Gordon Sim <gsim@apache.org> | 2007-07-23 12:29:17 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2007-07-23 12:29:17 +0000 |
| commit | 0db1af31320aa010c8e97da80000f7548d889068 (patch) | |
| tree | ce2cd8dba8cf46b685dcb626b31e25c17702c1a0 /cpp/src/qpid/broker/SemanticHandler.cpp | |
| parent | 747ac26509e78ac9aa9120be02cd446ac99d21cd (diff) | |
| download | qpid-python-0db1af31320aa010c8e97da80000f7548d889068.tar.gz | |
Added initial 'execution-layer' to try out methods form the 0-10 execution class.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@558700 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SemanticHandler.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/SemanticHandler.cpp | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/cpp/src/qpid/broker/SemanticHandler.cpp b/cpp/src/qpid/broker/SemanticHandler.cpp index a96a8c5cde..f616ec2db8 100644 --- a/cpp/src/qpid/broker/SemanticHandler.cpp +++ b/cpp/src/qpid/broker/SemanticHandler.cpp @@ -36,7 +36,7 @@ SemanticHandler::SemanticHandler(ChannelId id, Connection& c) : void SemanticHandler::handle(framing::AMQFrame& frame) -{ +{ //TODO: assembly etc when move to 0-10 framing // //have potentially three separate tracks at this point: @@ -56,16 +56,41 @@ void SemanticHandler::handle(framing::AMQFrame& frame) //if ready to execute (i.e. if segment is complete or frame is //message content): handleBody(frame.getBody()); - //if the frameset is complete, we can move the execution-mark - //forward (not for execution controls) - //note: need to be more sophisticated than this if we execute - //commands that arrive within an active message frameset } //ChannelAdapter virtual methods: void SemanticHandler::handleMethodInContext(boost::shared_ptr<qpid::framing::AMQMethodBody> method, const qpid::framing::MethodContext& context) { + if (!method->invoke(this)) { + //else do the usual: + handleL4(method, context); + //(if the frameset is complete) we can move the execution-mark + //forward + ++(incoming.hwm); + + //note: need to be more sophisticated than this if we execute + //commands that arrive within an active message frameset (that + //can't happen until 0-10 framing is implemented) + } +} + +void SemanticHandler::complete(u_int32_t mark) +{ + //just record it for now (will eventually need to use it to ack messages): + outgoing.lwm = SequenceNumber(mark); +} + +void SemanticHandler::flush() +{ + //flush doubles as a sync to begin with - send an execution.complete + incoming.lwm = incoming.hwm; + send(make_shared_ptr(new ExecutionCompleteBody(getVersion(), incoming.hwm.getValue()))); +} + +void SemanticHandler::handleL4(boost::shared_ptr<qpid::framing::AMQMethodBody> method, + const qpid::framing::MethodContext& context) +{ try{ if(getId() != 0 && !method->isA<ChannelOpenBody>() && !isOpen()) { if (!method->isA<ChannelCloseOkBody>()) { |
