version 1.44, 2005/03/23 03:00:42
|
version 1.45, 2005/05/04 19:47:03
|
|
|
// | // |
// Author: Mike Day (mdday@us.ibm.com) | // Author: Mike Day (mdday@us.ibm.com) |
// | // |
// Modified By: |
// Modified By: David Dillard, VERITAS Software Corp. |
|
// (david.dillard@veritas.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
message_mask::ha_reply | | message_mask::ha_reply | |
message_mask::ha_async ) ; | message_mask::ha_async ) ; |
| |
virtual ~MessageQueueService(void); |
virtual ~MessageQueueService(); |
| |
virtual Boolean isAsync(void) { return true; } |
virtual Boolean isAsync() const { return true; } |
| |
// enqueue may throw an IPCException | // enqueue may throw an IPCException |
virtual void enqueue(Message *); | virtual void enqueue(Message *); |
|
|
void *handle, | void *handle, |
void *parameter); | void *parameter); |
| |
Uint32 get_pending_callback_count(void); |
Uint32 get_pending_callback_count(); |
| |
Boolean SendForget(Message *msg); | Boolean SendForget(Message *msg); |
Boolean ForwardOp(AsyncOpNode *, Uint32 destination); | Boolean ForwardOp(AsyncOpNode *, Uint32 destination); |
|
|
| |
Boolean register_service(String name, Uint32 capabilities, Uint32 mask); | 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(void); |
Boolean deregister_service(); |
virtual void _shutdown_incoming_queue(void); |
virtual void _shutdown_incoming_queue(); |
| |
void find_services(String name, | void find_services(String name, |
Uint32 capabilities, | Uint32 capabilities, |
Uint32 mask, | Uint32 mask, |
Array<Uint32> *results); | Array<Uint32> *results); |
void enumerate_service(Uint32 queue, message_module *result); | void enumerate_service(Uint32 queue, message_module *result); |
Uint32 get_next_xid(void); |
Uint32 get_next_xid(); |
static AsyncOpNode *get_op(void); |
static AsyncOpNode *get_op(); |
void return_op(AsyncOpNode *op); | void return_op(AsyncOpNode *op); |
| |
Boolean operator ==(const MessageQueueService & svce) |
Boolean operator ==(const MessageQueueService & svce) const |
{ | { |
return operator==((const void *)&svce); | return operator==((const void *)&svce); |
} | } |
Boolean operator ==(const void *svce) |
|
|
Boolean operator ==(const void *svce) const |
{ | { |
if((void *)this == svce) |
if((const void *)this == svce) |
return true; | return true; |
return false; | return false; |
} | } |
| |
static PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL polling_routine(void *); | static PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL polling_routine(void *); |
static PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL kill_idle_threads(void *); | static PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL kill_idle_threads(void *); |
static ThreadPool *get_thread_pool(void); |
static ThreadPool *get_thread_pool(); |
| |
Uint32 _mask; | Uint32 _mask; |
AtomicInt _die; | AtomicInt _die; |
|
|
protected: | protected: |
virtual Boolean accept_async(AsyncOpNode *op); | virtual Boolean accept_async(AsyncOpNode *op); |
virtual Boolean messageOK(const Message *msg) ; | virtual Boolean messageOK(const Message *msg) ; |
virtual void handleEnqueue(void) = 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 *operation, Thread *thread, MessageQueue *queue); |
|
|
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_request(AsyncRequest *req); |
virtual void handle_heartbeat_reply(AsyncReply *rep); | virtual void handle_heartbeat_reply(AsyncReply *rep); |
| |
|
|
Uint32 flag); | Uint32 flag); |
void _complete_op_node(AsyncOpNode *, Uint32, Uint32, Uint32); | 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; |
| |
private: | private: |
|
|
AsyncDQueue<AsyncOpNode> _incoming; | AsyncDQueue<AsyncOpNode> _incoming; |
DQueue<AsyncOpNode> _callback; | DQueue<AsyncOpNode> _callback; |
static Thread* _polling_thread; | static Thread* _polling_thread; |
|
|
| |
Thread _req_thread; | Thread _req_thread; |
Thread _callback_thread; | Thread _callback_thread; |
|
|
protected: | protected: |
static ThreadPool *_thread_pool; | static ThreadPool *_thread_pool; |
|
|
private: | private: |
struct timeval _default_op_timeout; | struct timeval _default_op_timeout; |
static AtomicInt _xid; | static AtomicInt _xid; |
friend class cimom; | friend class cimom; |
friend class CIMServer; | friend class CIMServer; |
friend class monitor_2; | friend class monitor_2; |
|
|
}; | }; |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
| |
#endif /* Pegasus_MessageQueue_Service_h */ | #endif /* Pegasus_MessageQueue_Service_h */ |
|
|
|
|