version 1.61, 2007/07/18 19:46:23
|
version 1.68, 2008/11/05 05:24:34
|
|
|
| |
MessageQueueService( | MessageQueueService( |
const char* name, | const char* name, |
Uint32 queueID = MessageQueue::getNextQueueId(), |
Uint32 queueID = MessageQueue::getNextQueueId()); |
Uint32 capabilities = 0, |
|
Uint32 mask = MessageMask::ha_request | |
|
MessageMask::ha_reply | |
|
MessageMask::ha_async); |
|
| |
virtual ~MessageQueueService(); | virtual ~MessageQueueService(); |
| |
virtual Boolean isAsync() const { return true; } | virtual Boolean isAsync() const { return true; } |
| |
// enqueue may throw an IPCException |
|
virtual void enqueue(Message *); | virtual void enqueue(Message *); |
| |
AsyncReply* SendWait(AsyncRequest* request); | AsyncReply* SendWait(AsyncRequest* request); |
|
|
MessageQueue* callback_q, | MessageQueue* callback_q, |
void* callback_ptr); | void* callback_ptr); |
| |
Boolean SendAsync(Message *msg, |
|
Uint32 destination, |
|
void (*callback)(Message* response, void* handle, void* parameter), |
|
void* handle, |
|
void* parameter); |
|
|
|
Boolean SendForget(Message* msg); | Boolean SendForget(Message* msg); |
| |
|
|
Boolean register_service(String name, Uint32 capabilities, Uint32 mask); |
|
Boolean update_service(Uint32 capabilities, Uint32 mask); | Boolean update_service(Uint32 capabilities, Uint32 mask); |
Boolean deregister_service(); | Boolean deregister_service(); |
| |
void find_services( |
Uint32 find_service_qid(const String &name); |
String name, |
|
Uint32 capabilities, |
|
Uint32 mask, |
|
Array<Uint32>* results); |
|
void enumerate_service(Uint32 queue, message_module* result); |
|
static AsyncOpNode* get_op(); | static AsyncOpNode* get_op(); |
void return_op(AsyncOpNode* op); | void return_op(AsyncOpNode* op); |
|
Boolean isRunning() const { return _isRunning; } |
| |
static ThreadPool* get_thread_pool(); | static ThreadPool* get_thread_pool(); |
| |
Uint32 _mask; |
|
AtomicInt _die; | AtomicInt _die; |
AtomicInt _threads; | AtomicInt _threads; |
Uint32 getIncomingCount() {return _incoming.count(); } | Uint32 getIncomingCount() {return _incoming.count(); } |
|
|
protected: | protected: |
virtual void _shutdown_incoming_queue(); | virtual void _shutdown_incoming_queue(); |
virtual Boolean accept_async(AsyncOpNode* op); | virtual Boolean accept_async(AsyncOpNode* op); |
virtual Boolean messageOK(const Message* msg); |
|
virtual void handleEnqueue() = 0; | virtual void handleEnqueue() = 0; |
virtual void handleEnqueue(Message *) = 0; | virtual void handleEnqueue(Message *) = 0; |
Boolean _enqueueResponse(Message *, Message *); | Boolean _enqueueResponse(Message *, Message *); |
// virtual void _handle_incoming_operation( |
|
// AsyncOpNode* operation, |
|
// Thread* thread, |
|
// MessageQueue* queue); |
|
virtual void _handle_incoming_operation(AsyncOpNode *); | virtual void _handle_incoming_operation(AsyncOpNode *); |
| |
virtual void _handle_async_request(AsyncRequest* req); | virtual void _handle_async_request(AsyncRequest* req); |
virtual void _handle_async_callback(AsyncOpNode* operation); | virtual void _handle_async_callback(AsyncOpNode* operation); |
virtual void _make_response(Message* req, Uint32 code); | virtual void _make_response(Message* req, Uint32 code); |
| |
virtual void handle_heartbeat_request(AsyncRequest* req); |
|
virtual void handle_heartbeat_reply(AsyncReply* rep); |
|
|
|
virtual void handle_AsyncIoctl(AsyncIoctl* req); | virtual void handle_AsyncIoctl(AsyncIoctl* req); |
virtual void handle_CimServiceStart(CimServiceStart* req); | virtual void handle_CimServiceStart(CimServiceStart* req); |
virtual void handle_CimServiceStop(CimServiceStop* req); | virtual void handle_CimServiceStop(CimServiceStop* req); |
virtual void handle_CimServicePause(CimServicePause* req); |
|
virtual void handle_CimServiceResume(CimServiceResume* req); |
|
|
|
virtual void handle_AsyncOperationStart(AsyncOperationStart* req); |
|
virtual void handle_AsyncOperationResult(AsyncOperationResult* rep); |
|
virtual void handle_AsyncLegacyOperationStart( |
|
AsyncLegacyOperationStart* req); |
|
virtual void handle_AsyncLegacyOperationResult( |
|
AsyncLegacyOperationResult* rep); |
|
| |
void _completeAsyncResponse( | void _completeAsyncResponse( |
AsyncRequest* request, | AsyncRequest* request, |
AsyncReply* reply, |
AsyncReply* reply); |
Uint32 state, |
void _complete_op_node(AsyncOpNode *); |
Uint32 flag); |
|
void _complete_op_node(AsyncOpNode *, Uint32, Uint32, Uint32); |
|
| |
static cimom* _meta_dispatcher; | static cimom* _meta_dispatcher; |
static AtomicInt _service_count; | static AtomicInt _service_count; |
static Mutex _meta_dispatcher_mutex; | static Mutex _meta_dispatcher_mutex; |
static ThreadPool* _thread_pool; | static ThreadPool* _thread_pool; |
|
Boolean _isRunning; |
private: | private: |
|
Boolean _sendAsync(AsyncOpNode* op, |
|
Uint32 destination, |
|
void (*callback)(AsyncOpNode*, MessageQueue*, void*), |
|
MessageQueue* callback_q, |
|
void* callback_ptr, |
|
Uint32 flags); |
|
|
static ThreadReturnType PEGASUS_THREAD_CDECL polling_routine(void *); | static ThreadReturnType PEGASUS_THREAD_CDECL polling_routine(void *); |
| |
AsyncQueue<AsyncOpNode> _incoming; | AsyncQueue<AsyncOpNode> _incoming; |
|
|
| |
AtomicInt _incoming_queue_shutdown; | AtomicInt _incoming_queue_shutdown; |
| |
struct timeval _default_op_timeout; |
|
|
|
friend class cimom; | friend class cimom; |
}; | }; |
| |