示例#1
0
void
Outgoing::completed(const Ice::Exception& ex)
{
    Monitor<Mutex>::Lock sync(_monitor);
    //assert(_state <= StateInProgress);
    if(_state > StateInProgress)
    {
        //
        // Response was already received but message
        // didn't get removed first from the connection
        // send message queue so it's possible we can be
        // notified of failures. In this case, ignore the
        // failure and assume the outgoing has been sent.
        //
        assert(_state != StateFailed);
        _sent = true;
        _monitor.notify();
        return;
    }

    _childObserver.failed(ex.ice_name());
    _childObserver.detach();

    _state = StateFailed;
    _exception.reset(ex.ice_clone());
    _monitor.notify();
}
示例#2
0
    void
    synchronized(const Ice::Exception& ex)
    {
        SynchronizationCallbackPtr callback;
        {
            Lock sync(*this);
            if(!_exception.get())
            {
                _exception.reset(ex.ice_clone());
            }
            
            --_synchronizeCount;
            if(!_responseCalled)
            {
                return;
            }

            if(_synchronizeCount > 0)
            {
                return;
            }

            callback = _callback;
            _callback = 0;
        }

        if(callback)
        {
            callback->synchronized(ex);
        }
    }
示例#3
0
void
FlushBatch::completed(const Ice::Exception& ex)
{
    Monitor<Mutex>::Lock sync(_monitor);
    _childObserver.failed(ex.ice_name());
    _childObserver.detach();
    _exception.reset(ex.ice_clone());
    _monitor.notify();
}
示例#4
0
void
ConnectionFlushBatch::completed(const Ice::Exception& ex)
{
    Monitor<Mutex>::Lock sync(_monitor);
    _childObserver.failed(ex.ice_id());
    _childObserver.detach();
    ICE_RESET_EXCEPTION(_exception, ex.ice_clone());
    _monitor.notify();
}
示例#5
0
void
ServerEntry::exception(const Ice::Exception& ex)
{
    ServerInfo load;
    SessionIPtr session;
    bool noRestart = false;
    bool remove = false;
    int timeout = -1;

    {
        Lock sync(*this);
        if((_destroy.get() && !_load.get()) || (!_destroy.get() && !_updated))
        {
            remove = _destroy.get();
            _destroy.reset(0);
            _exception.reset(ex.ice_clone());
            _proxy = 0;
            _adapters.clear();
            _activationTimeout = -1;
            _deactivationTimeout = -1;
            _synchronizing = false;
            notifyAll();
        }
        else
        {
            _destroy.reset(0);
            _updated = false;
            load = *_load.get();
            noRestart = _noRestart;
            session = _session;
            timeout = _deactivationTimeout; // loadServer might block to deactivate the previous server.
        }
    }

    if(load.descriptor)
    {
        try
        {
            _cache.getNodeCache().get(load.node)->loadServer(this, load, session, timeout, noRestart);
        }
        catch(const NodeNotExistException&)
        {
            exception(NodeUnreachableException(load.node, "node is not active"));
        }
    }
    else
    {
        synchronized(ex);
        if(remove)
        {
            _cache.clear(_id);
        }
    }
}
示例#6
0
void 
IceInternal::LocatorInfo::Request::exception(const Ice::Exception& ex)
{
    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_monitor);
    _locatorInfo->finishRequest(_ref, _wellKnownRefs, 0, dynamic_cast<const Ice::UserException*>(&ex));
    _exception.reset(ex.ice_clone());
    for(vector<RequestCallbackPtr>::const_iterator p = _callbacks.begin(); p != _callbacks.end(); ++p)
    {
        (*p)->exception(_locatorInfo, ex);
    }
    _monitor.notifyAll();
}
示例#7
0
bool
AsyncResult::finished(const Ice::Exception& ex)
{
    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_monitor);
    _state |= Done;
    _exception.reset(ex.ice_clone());
    _cancellationHandler = 0;
    _observer.failed(ex.ice_name());
    if(!_callback)
    {
        _observer.detach();
    }
    _monitor.notifyAll();
    return _callback;
}