version 1.2, 2002/01/18 19:27:48
|
version 1.3, 2002/01/21 02:01:22
|
|
|
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
| |
|
class message_module; |
|
|
class PEGASUS_COMMON_LINKAGE MessageQueueService : public MessageQueue | class PEGASUS_COMMON_LINKAGE MessageQueueService : public MessageQueue |
{ | { |
public: | public: |
|
|
virtual void handle_AsyncOperationStart(AsyncOperationStart *req); | virtual void handle_AsyncOperationStart(AsyncOperationStart *req); |
virtual void handle_AsyncOperationResult(AsyncOperationResult *req); | virtual void handle_AsyncOperationResult(AsyncOperationResult *req); |
| |
// virtual Boolean accept_async(Message *message) throw(IPCException); |
virtual Boolean accept_async(AsyncOpNode *op) throw(IPCException); |
// virtual Boolean messageOK(const Message *msg) ; |
virtual Boolean messageOK(const Message *msg) ; |
| |
// virtual Message *openEnvelope(Message *msg); | // virtual Message *openEnvelope(Message *msg); |
| |
AsyncMessage *SendWait(AsyncRequest *request); |
|
|
|
void SendWait(AsyncRequest *request, unlocked_dq<AsyncMessage> *reply_list); |
|
// Boolean SendAsync(AsyncMessage *msg); | // Boolean SendAsync(AsyncMessage *msg); |
void _enqueueAsyncResponse(AsyncRequest *request, |
AsyncReply *SendWait(AsyncRequest *request); |
|
|
|
void _completeAsyncResponse(AsyncRequest *request, |
AsyncReply *reply, | AsyncReply *reply, |
Uint32 state, | Uint32 state, |
Uint32 flag); | Uint32 flag); |
|
|
AtomicInt _die; | AtomicInt _die; |
protected: | protected: |
| |
// handle all your messages. call Base:_handle_async_msg to |
virtual void _handle_async_request(AsyncRequest *req); |
// deal with messages you don't handle |
virtual void _handle_async_reply(AsyncReply *rep); |
virtual void _handle_async_msg(AsyncMessage *msg); |
virtual void _make_response(AsyncRequest *req, Uint32 code); |
|
|
|
|
cimom *_meta_dispatcher; | cimom *_meta_dispatcher; |
|
|
private: | private: |
| |
|
AsyncDQueue<AsyncOpNode> _pending; |
|
AsyncDQueue<AsyncOpNode> _incoming; |
|
|
|
static PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL _req_proc(void *); |
|
static PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL _rpl_proc(void *); |
|
Thread _req_thread; |
|
Thread _rpl_thread; |
| |
struct timeval _default_op_timeout; | struct timeval _default_op_timeout; |
| |
static AtomicInt _xid; | static AtomicInt _xid; |
void _handle_async_request(AsyncRequest *req); |
void _handle_incoming_operation(AsyncOpNode *operation); |
void _handle_async_reply(AsyncReply *rep); |
|
void _make_response(AsyncRequest *req, Uint32 code); |
|
}; | }; |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |