summaryrefslogtreecommitdiff
path: root/cpp/lib/client/ResponseHandler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Thread safety fixes for race conditions on incoming messages.Alan Conway2007-02-211-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cpp/lib/client/MessageListener.h: const correctness. * cpp/tests/*: MessageListener const change. * cpp/lib/broker/Content.h: Removed out-of-date FIXME comments. * cpp/lib/client/ClientChannel.h/ .cpp(): - added locking for consumers map and other member access. - refactored implementations of Basic get, deliver, return: most logic now encapsulted in IncomingMessage class. - fix channel close problems. * cpp/lib/client/ClientMessage.h/.cpp: - const correctness & API convenience fixes. - getMethod/setMethod/getHeader: for new IncomingMessage * cpp/lib/client/Connection.h/.cpp: - Fixes to channel closure. * cpp/lib/client/IncomingMessage.h/.cpp: - Encapsulate *all* incoming message handling for client. - Moved handling of BasicGetOk to IncomingMessage to fix race. - Thread safety fixes. * cpp/lib/client/ResponseHandler.h/.cpp: - added getResponse for ClientChannel. * cpp/lib/common/Exception.h: - added missing throwSelf implementations. - added ShutdownException as general purpose shut-down indicator. - added EmptyException as general purpose "empty" indicator. * cpp/lib/common/sys/Condition|Monitor|Mutex.h|.cpp: - Condition variable abstraction extracted from Monitor for situations where a single lock is associated with multiple conditions. * cpp/tests/ClientChannelTest.cpp: - Test incoming message transfer, get, consume etc. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@510161 13f79535-47bb-0310-9956-ffa450edef68
* * cpp/lib/common/framing/MethodContext.h: Reduced MethodContext toAlan Conway2007-02-021-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ChannelAdapter and Method Body. Request ID comes from body, ChannelAdapter is used to send frames, not OutputHandler. * cpp/lib/common/framing/ChannelAdapter.h,.cpp: Removed context member. Context is per-method not per-channel. * cpp/lib/broker/*: Replace direct use of OutputHandler and ChannelId with MethodContext (for responses) or ChannelAdapter (for requests.) Use context request-ID to construct responses, send all bodies via ChannelAdapter. * cpp/lib/broker/BrokerAdapter.cpp: Link broker::Channel to BrokerAdapter. * cpp/lib/broker/*: Remove unnecessary ProtocolVersion parameters. Fix bogus signatures: ProtocolVersion* -> const ProtocolVersion& * Cosmetic changes, many files: - fixed indentation, broke long lines. - removed unnecessary qpid:: prefixes. * broker/BrokerAdapter,BrokerChannel: Merged BrokerAdapter into broker::channel. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@502767 13f79535-47bb-0310-9956-ffa450edef68
* * framing/ChannelAdapter.cpp: Enable channel state assertions.Alan Conway2007-01-311-4/+2
| | | | | | | | | | | | | | | * common/Exception & others: Exception template constructors that accept any object that supports ostream operator<< as messages. E.g. can pass a boost::format object directly, no need to call str(). * Fixed up various exception messges to use boost::format. * framing/Requester.cpp: Exception on invalid response id. * client/Connection.h: Remove extra getVersion() function. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@501948 13f79535-47bb-0310-9956-ffa450edef68
* * Added ClientAdapter - client side ChannelAdapter. Updated client side.Alan Conway2007-01-291-10/+29
| | | | | | | | | | | | | | | | * Moved ChannelAdapter initialization from ctor to init(), updated broker side. * Improved various exception messages with boost::format messages. * Removed unnecssary virtual inheritance. * Widespread: fixed incorrect non-const ProtocolVersion& parameters. * Client API: pass channels by reference, not pointer. * codegen: - MethodBodyClass.h.templ: Added CLASS_ID, METHOD_ID and isA() template. - Various: fixed non-const ProtocolVersion& parameters. * cpp/bootstrap: Allow config arguments with -build. * cpp/gen/Makefile.am: Merged codegen fixes from trunk. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@501087 13f79535-47bb-0310-9956-ffa450edef68
* There are a ton of FIXMES and request/response IDs are not yet working fullyAlan Conway2007-01-181-7/+7
| | | | | | | | | | | | | | | | | | | | | but all tests are passing. * broker::Broker: Removed requester/responder from broker. * framing::BodyHandler: added Requester/Responder to BodyHandler, becomes the base class for channel adapters in broker and client. * broker::BrokerAdapter: Inherit BodyHandler, wraps a broker::Channel. Hide private *HandlerImpl detail classes in BodyHandler.cpp. * broker::Connection: Requester/Responder/Adapter now per-channel. Connection channel map replaced with adapter map of BrokerAdapters. handle* functions moved to BrokerAdapter. All methods now handled by a BrokerAdapter for the relevant channel. ChannelHandlerImpl is repsonsible for checking that - No method on a non-0 channel is processed before open() - Channel 0 methods only happen on channel 0 and similar for non-zero methods Checks are not yet complete (see FIXMES) * client::ResponseHandler: fix for client hang if broker crashs. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@497319 13f79535-47bb-0310-9956-ffa450edef68
* 2006-12-01 Jim Meyering <meyering@redhat.com>Alan Conway2006-12-011-0/+61
This delta imposes two major changes on the C++ hierarchy: - adds autoconf, automake, libtool support - makes the hierarchy flatter and renames a few files (e.g., Queue.h, Queue.cpp) that appeared twice, once under client/ and again under broker/. In the process, I've changed many #include directives, mostly to remove a qpid/ or qpid/framing/ prefix from the file name argument. Although most changes were to .cpp and .h files under qpid/cpp/, there were also several to template files under qpid/gentools, and even one to CppGenerator.java. Nearly all files are moved to a new position in the hierarchy. The new hierarchy looks like this: src # this is the new home of qpidd.cpp tests # all tests are here. See Makefile.am. gen # As before, all generated files go here. lib # This is just a container for the 3 lib dirs: lib/client lib/broker lib/common lib/common/framing lib/common/sys lib/common/sys/posix lib/common/sys/apr build-aux m4 git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@481159 13f79535-47bb-0310-9956-ffa450edef68