def callMethod()

in qpid/managementdata.py [0:0]


  def callMethod (self, userOid, methodName, args):
    self.lock.acquire ()
    methodOk = True
    try:
      classKey = self.getClassForId (self.rawObjId (userOid))
      if classKey == None:
        raise ValueError ()

      if methodName not in self.schema[classKey][2]:
        print("Method '%s' not valid for class '%s'" % (methodName, self.displayClassName(classKey)))
        raise ValueError ()

      schemaMethod = self.schema[classKey][2][methodName]
      count = 0
      for arg in range(len(schemaMethod[1])):
        if schemaMethod[1][arg][2].find("I") != -1:
          count += 1
      if len (args) != count:
        print("Wrong number of method args: Need %d, Got %d" % (count, len (args)))
        raise ValueError ()

      namedArgs = {}
      idx = 0
      for arg in range(len(schemaMethod[1])):
        if schemaMethod[1][arg][2].find("I") != -1:
          namedArgs[schemaMethod[1][arg][0]] = args[idx]
          idx += 1

      self.methodSeq = self.methodSeq + 1
      self.methodsPending[self.methodSeq] = methodName
    except Exception as e:
      methodOk = False
    self.lock.release ()
    if methodOk:
#      try:
        self.mclient.callMethod (self.mch, self.methodSeq, self.rawObjId (userOid), classKey,
                                 methodName, namedArgs)