Esempio n. 1
0
void
BatchRequestQueue::destroy(const Ice::LocalException& ex)
{
    Lock sync(*this);
#ifdef ICE_CPP11_MAPPING
    _exception = ex.ice_clone();
#else
    _exception.reset(ex.ice_clone());
#endif
}
Esempio n. 2
0
void
IceInternal::BatchOutgoing::finished(const Ice::LocalException& ex, bool)
{
    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_monitor);
    _remoteObserver.failed(ex.ice_name());
    _remoteObserver.detach();
    _exception.reset(ex.ice_clone());
    _monitor.notify();
}
Esempio n. 3
0
void
IceBT::TransceiverI::connectFailed(const Ice::LocalException& ex)
{
    IceUtil::Monitor<IceUtil::Mutex>::Lock lock(_lock);
    //
    // Save the exception - it will be raised in initialize().
    //
    ICE_SET_EXCEPTION_FROM_CLONE(_exception, ex.ice_clone());
    //
    // Triggers a call to write() from a different thread.
    //
    _stream->ready(IceInternal::SocketOperationConnect, true);
}
Esempio n. 4
0
void
OutgoingAsyncBase::cancel(const Ice::LocalException& ex)
{
    CancellationHandlerPtr handler;
    {
        Lock sync(_m);
        ICE_SET_EXCEPTION_FROM_CLONE(_cancellationException, ex.ice_clone());
        if(!_cancellationHandler)
        {
            return;
        }
        handler = _cancellationHandler;
    }
    handler->asyncRequestCanceled(ICE_SHARED_FROM_THIS, ex);
}
Esempio n. 5
0
void
AsyncResult::cancel(const Ice::LocalException& ex)
{
    CancellationHandlerPtr handler;
    {
        IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_monitor);
        _cancellationException.reset(ex.ice_clone());
        if(!_cancellationHandler)
        {
            return;
        }
        handler = _cancellationHandler;
    }
    handler->asyncRequestCanceled(OutgoingAsyncBasePtr::dynamicCast(this), ex);
}
Esempio n. 6
0
void
ConnectRequestHandler::setException(const Ice::LocalException& ex)
{
    Lock sync(*this);
    assert(!_initialized && !_exception);
    ICE_SET_EXCEPTION_FROM_CLONE(_exception, ex.ice_clone());

    _proxies.clear();
    _proxy = 0; // Break cyclic reference count.

    //
    // NOTE: remove the request handler *before* notifying the
    // requests that the connection failed. It's important to ensure
    // that future invocations will obtain a new connect request
    // handler once invocations are notified.
    //
    try
    {
        _reference->getInstance()->requestHandlerFactory()->removeRequestHandler(_reference, ICE_SHARED_FROM_THIS);
    }
    catch(const Ice::CommunicatorDestroyedException&)
    {
        // Ignore
    }


    for(deque<ProxyOutgoingAsyncBasePtr>::const_iterator p = _requests.begin(); p != _requests.end(); ++p)
    {
        if((*p)->exception(ex))
        {
            (*p)->invokeExceptionAsync();
        }
    }

    _requests.clear();
    notifyAll();
}
void
ConnectRequestHandler::setException(const Ice::LocalException& ex)
{
    Lock sync(*this);
    assert(!_initialized && !_exception.get());
    assert(_updateRequestHandler || _requests.empty());

    _exception.reset(ex.ice_clone());
    _proxy = 0; // Break cyclic reference count.
    _delegate = 0; // Break cyclic reference count.

    //
    // If some requests were queued, we notify them of the failure. This is done from a thread
    // from the client thread pool since this will result in ice_exception callbacks to be 
    // called.
    //
    if(!_requests.empty())
    {
        const InstancePtr instance = _reference->getInstance();
        instance->clientThreadPool()->execute(new FlushRequestsWithException(instance, this, ex));
    }

    notifyAll();
}
Esempio n. 8
0
void
ConnectRequestHandler::setException(const Ice::LocalException& ex)
{
    Lock sync(*this);
    assert(!_initialized && !ICE_EXCEPTION_GET(_exception));
    ICE_RESET_EXCEPTION(_exception, ex.ice_clone());

    _proxies.clear();
    _proxy = 0; // Break cyclic reference count.

    //
    // NOTE: remove the request handler *before* notifying the
    // requests that the connection failed. It's important to ensure
    // that future invocations will obtain a new connect request
    // handler once invocations are notified.
    //
    try
    {
        _reference->getInstance()->requestHandlerFactory()->removeRequestHandler(_reference, ICE_SHARED_FROM_THIS);
    }
    catch(const Ice::CommunicatorDestroyedException&)
    {
        // Ignore
    }

#ifdef ICE_CPP11_MAPPING
    try
    {
        rethrow_exception(_exception);
    }
    catch(const Ice::LocalException& ex)
    {
        for(deque<Request>::const_iterator p = _requests.begin(); p != _requests.end(); ++p)
        {
            if(p->out)
            {
                p->out->completed(ex);
            }
            else
            {
                if(p->outAsync->completed(ex))
                {
                    p->outAsync->invokeCompletedAsync();
                }
            }
        }
    }
#else
    for(deque<Request>::const_iterator p = _requests.begin(); p != _requests.end(); ++p)
    {
        if(p->out)
        {
            p->out->completed(*_exception.get());
        }
        else
        {
            if(p->outAsync->completed(*_exception.get()))
            {
                p->outAsync->invokeCompletedAsync();
            }
        }
    }
#endif
    _requests.clear();
    notifyAll();
}
Esempio n. 9
0
RetryException::RetryException(const Ice::LocalException& ex)
{
    _ex.reset(ex.ice_clone());
}
Esempio n. 10
0
void
BatchRequestQueue::destroy(const Ice::LocalException& ex)
{
    Lock sync(*this);
    _exception.reset(ex.ice_clone());
}