コード例 #1
0
ファイル: BatchRequestQueue.cpp プロジェクト: chenbk85/ice
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
}
コード例 #2
0
ファイル: Outgoing.cpp プロジェクト: 2008hatake/zeroc-ice
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();
}
コード例 #3
0
ファイル: TransceiverI.cpp プロジェクト: ming-hai/ice
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);
}
コード例 #4
0
ファイル: OutgoingAsync.cpp プロジェクト: lmtoo/ice
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);
}
コード例 #5
0
ファイル: AsyncResult.cpp プロジェクト: Jonavin/ice
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);
}
コード例 #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();
}
コード例 #7
0
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();
}
コード例 #8
0
ファイル: ConnectRequestHandler.cpp プロジェクト: iokays/ice
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();
}
コード例 #9
0
RetryException::RetryException(const Ice::LocalException& ex)
{
    _ex.reset(ex.ice_clone());
}
コード例 #10
0
ファイル: BatchRequestQueue.cpp プロジェクト: Jonavin/ice
void
BatchRequestQueue::destroy(const Ice::LocalException& ex)
{
    Lock sync(*this);
    _exception.reset(ex.ice_clone());
}