Exemple #1
0
ZEND_METHOD(Ice_Communicator, proxyToString)
{
    CommunicatorInfoIPtr _this = Wrapper<CommunicatorInfoIPtr>::value(getThis() TSRMLS_CC);
    assert(_this);

    zval* zv;
    if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, const_cast<char*>("O!"), &zv, proxyClassEntry) != SUCCESS)
    {
        RETURN_NULL();
    }

    try
    {
        string str;
        if(zv)
        {
            Ice::ObjectPrx prx;
            ClassInfoPtr info;
            if(!fetchProxy(zv, prx, info TSRMLS_CC))
            {
                RETURN_NULL();
            }
            assert(prx);
            str = prx->ice_toString();
        }
        RETURN_STRINGL(STRCAST(str.c_str()), static_cast<int>(str.length()), 1);
    }
    catch(const IceUtil::Exception& ex)
    {
        throwException(ex TSRMLS_CC);
        RETURN_NULL();
    }
}
void
IceGrid::AdminRouter::invokeOnTarget(const Ice::ObjectPrx& target,
                                     const AMD_Object_ice_invokePtr& cb,
                                     const pair<const Byte*, const Byte*>& inParams,
                                     const Current& current)
{
    assert(target != 0);

    //
    // Call with AMI
    //
    Callback_Object_ice_invokePtr amiCb = newCallback_Object_ice_invoke(
        new CallbackI(cb, target, current.operation, _traceLevels), &CallbackI::response, &CallbackI::exception);

    if(_traceLevels->admin > 0)
    {
        Ice::Trace out(_traceLevels->logger, _traceLevels->adminCat);
        out << "routing operation `" << current.operation << "' to `" << target->ice_toString() << "'";
    }
    target->begin_ice_invoke(current.operation, current.mode, inParams, current.ctx, amiCb);
}