void CIMOperationResponseEncoder::enqueue(Message* message)
{
    try
    {
        handleEnqueue(message);
    }
    catch(PEGASUS_STD(bad_alloc)&)
    {
        MessageLoaderParms parms(
            "Server.CIMOperationResponseEncoder.OUT_OF_MEMORY",
            "A System error has occurred. Please retry the CIM Operation "
                "at a later time.");

        Logger::put_l(
            Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE, parms);

        CIMResponseMessage* response =
            dynamic_cast<CIMResponseMessage*>(message);
        Uint32 queueId = response->queueIds.top();
        MessageQueue* queue = MessageQueue::lookup(queueId);
        HTTPConnection* httpQueue = dynamic_cast<HTTPConnection*>(queue);
        PEGASUS_ASSERT(httpQueue);

        // Handle internal error on this connection.
        httpQueue->handleInternalServerError(
            response->getIndex(), response->isComplete());

        delete message;
    }
}
void CIMOperationRequestAuthorizer::handleEnqueue()
{
   PEG_METHOD_ENTER(TRC_SERVER, "CIMOperationRequestAuthorizer::handleEnqueue");

   Message* request = dequeue();
   if( request )
      handleEnqueue(request);

   PEG_METHOD_EXIT();
}
void CIMListenerIndicationDispatcher::handleEnqueue()
{
    PEG_METHOD_ENTER(TRC_SERVER,
        "CIMListenerIndicationDispatcher::handleEnqueue");

    Message *message = dequeue();
    if(message)
        handleEnqueue(message);

    PEG_METHOD_EXIT();
}
void IndicationHandlerService::handleEnqueue()
{
   AutoPtr<Message> message(dequeue());

   PEGASUS_ASSERT(message.get() != 0);
   if (message.get())
   {
       handleEnqueue(message.get());
       message.release();
   }
}
Ejemplo n.º 5
0
void HTTPAuthenticatorDelegator::handleEnqueue()
{
    PEG_METHOD_ENTER(TRC_HTTP,
        "HTTPAuthenticatorDelegator::handleEnqueue");

    Message* message = dequeue();
    if(message)
       handleEnqueue(message);

    PEG_METHOD_EXIT();
}
void DynamicListenerIndicationDispatcher::handleEnqueue()
{
    PEG_METHOD_ENTER(
        TRC_LISTENER,
        "DynamicListenerIndicationDispatcher::handleEnqueue");

    Message *message = dequeue();
    if (message)
        handleEnqueue(message);

    PEG_METHOD_EXIT();
}
Ejemplo n.º 7
0
void MessageQueue::enqueue(Message* message)
{
    PEG_METHOD_ENTER(TRC_MESSAGEQUEUESERVICE,"MessageQueue::enqueue()");

    PEGASUS_ASSERT(message != 0);

    PEG_TRACE((TRC_MESSAGEQUEUESERVICE, Tracer::LEVEL3,
        "Queue name: [%s], Message: [%s]",
        getQueueName(),
        MessageTypeToString(message->getType())));

    _messageList.insert_back(message);

    handleEnqueue();
    PEG_METHOD_EXIT();
}
Ejemplo n.º 8
0
void MessageQueue::enqueue(Message* message)
{
    PEG_METHOD_ENTER(TRC_MESSAGEQUEUESERVICE,"MessageQueue::enqueue()");

    if (!message)
    {
        Tracer::trace(TRC_MESSAGEQUEUESERVICE, Tracer::LEVEL3,
                    "MessageQueue::enqueue failure");
        PEG_METHOD_EXIT();
        throw NullPointer();
    }

    PEG_TRACE_STRING( TRC_MESSAGEQUEUESERVICE, Tracer::LEVEL3,
                      String("Queue name: ") + getQueueName() ) ;
    Tracer::trace   ( TRC_MESSAGEQUEUESERVICE,
                      Tracer::LEVEL3,
                      "Message: [%s, %d]",
                      MessageTypeToString(message->getType()),
                      message->getKey() );

    {
    AutoMutex autoMut(_mut);
    if (_back)
    {
        _back->_next = message;
        message->_prev = _back;
        message->_next = 0;
        _back = message;
    }
    else
    {
        _front = message;
        _back = message;
        message->_prev = 0;
        message->_next = 0;
    }
    message->_owner = this;

    _count++;
    Tracer::trace(TRC_MESSAGEQUEUESERVICE, Tracer::LEVEL4,
                  "MessageQueue::enqueue _queueId = %d, _count = %d", _queueId, _count);

    } // mutex unlocks here

    handleEnqueue();
    PEG_METHOD_EXIT();
}
Ejemplo n.º 9
0
void MessageQueueService::_handle_incoming_operation(AsyncOpNode *operation)
{
   if (operation != 0)
   {

// ATTN: optimization
// << Tue Feb 19 14:10:38 2002 mdd >>
      operation->lock();

      Message *rq = operation->_request.next(0);

// optimization <<< Thu Mar  7 21:04:05 2002 mdd >>>
// move this to the bottom of the loop when the majority of
// messages become async messages.

      // divert legacy messages to handleEnqueue
      if ((rq != 0) && (!(rq->getMask() & message_mask::ha_async)))
      {
         rq = operation->_request.remove_first() ;
         operation->unlock();
         // delete the op node
         operation->release();
         return_op(operation);

         handleEnqueue(rq);
         return;
      }

      if ((operation->_flags & ASYNC_OPFLAGS_CALLBACK ||
           operation->_flags & ASYNC_OPFLAGS_SAFE_CALLBACK) &&
          (operation->_state & ASYNC_OPSTATE_COMPLETE))
      {
         operation->unlock();
         _handle_async_callback(operation);
      }
      else
      {
         PEGASUS_ASSERT(rq != 0);
         operation->unlock();
         _handle_async_request(static_cast<AsyncRequest *>(rq));
      }
   }
   return;
}
Ejemplo n.º 10
0
void HTTPAcceptor::handleEnqueue()
{
    Message* message = dequeue();
    handleEnqueue(message);
}
Ejemplo n.º 11
0
void WsmProcessor::handleEnqueue()
{
    Message* message = dequeue();
    handleEnqueue(message);
}
Ejemplo n.º 12
0
void HTTPAuthenticatorDelegator::enqueue(Message* message)
{
    handleEnqueue(message);
}
void CIMExportRequestDecoder::handleEnqueue()
{
    Message* message = dequeue();
    if (message)
        handleEnqueue(message);
}