示例#1
0
MethodResponse Dispatcher::dispatchCallLoc(const MethodCall &call) const
{
  ULXR_TRACE("dispatchCallLoc: " << call.getMethodName());

  MethodCallDescriptor desc(call);
  MethodCallMap::const_iterator it;
  if ((it = methodcalls.find(desc)) != methodcalls.end() )
  {
    MethodCall_t mc = (*it).second;
    if (!(*it).first.isEnabled())
    {
      std::string s = "method \"";
      s += desc.getSignature(true, false);
      s += "\": currently unavailable.";
      return MethodResponse (MethodNotFoundError, s);
    }

    else
    {
      if ((*it).first.calltype == CallSystem)
      {
        ULXR_TRACE("Now calling system function: " + (*it).first.getSignature(true, true));
        (*it).first.incInvoked();
        return mc.system_function(call, this);
      }

      else if ((*it).first.calltype == CallStatic)
      {
        ULXR_TRACE("Now calling static function: " + (*it).first.getSignature(true, true));
        (*it).first.incInvoked();
        return mc.static_function(call);
      }

      else if ((*it).first.calltype == CallDynamic)
      {
        ULXR_TRACE("Now calling dynamic function: " + (*it).first.getSignature(true, true));
        (*it).first.incInvoked();
        return mc.dynamic_function->call(call);
      }

      else
      {
        std::string s = "method \"";
        s += desc.getSignature(true, false);
        s += "\": internal problem to find method.";
        return MethodResponse (MethodNotFoundError, s);
      }
    }
  }

  std::string s = "method \"";
  s += desc.getSignature(true, false);
  s += "\" unknown method and/or signature.";
  return MethodResponse (MethodNotFoundError, s);
}
示例#2
0
  Dispatcher::MethodCallDescriptor::MethodCallDescriptor(const MethodCall &call)
{
  method_name = call.getMethodName();
  documentation = "";
  return_signature = "";

  signature = call.getSignature(false);

  calltype = CallNone;
  invoked = 0;
  enabled = true;
}
示例#3
0
void Requester::send_call (const MethodCall &calldata,
                           const CppString &rpc_root)
{
  ULXR_TRACE(ULXR_PCHAR("send_call ") << calldata.getMethodName());
  if (!protocol->isOpen() )
    protocol->open();
  else
    protocol->resetConnection();

#ifdef ULXR_ENFORCE_NON_PERSISTENT
  protocol->setPersistent(false);
#endif

  protocol->sendRpcCall(calldata, rpc_root, wbxml_mode);
}