ObjectInstance oi = null;
// ClassData for resolved object instance, or if object instance cannot
// resolve, class data for
// class instance (static method) we are resolving to
ClassData cd = null;
HashMap methodMap = null;
Method method = null;
Object itsThis = null;
if (objectID == 0)
{
// Handle "system.listMethods"
// this is called by the browser side javascript
// when a new JSONRpcClient object is initialized.
if (encodedMethod.equals("system.listMethods"))
{
HashSet m = new HashSet();
globalBridge.allInstanceMethods(m);
if (globalBridge != this)
{
globalBridge.allStaticMethods(m);
globalBridge.allInstanceMethods(m);
}
allStaticMethods(m);
allInstanceMethods(m);
JSONArray methods = new JSONArray();
Iterator i = m.iterator();
while (i.hasNext())
{
methods.put(i.next());
}
return new JSONRPCResult(JSONRPCResult.CODE_SUCCESS, requestId, methods);
}
// Look up the class, object instance and method objects
if (className == null
|| methodName == null
|| ((oi = resolveObject(className)) == null && (cd = resolveClass(className)) == null))
{
return new JSONRPCResult(JSONRPCResult.CODE_ERR_NOMETHOD, requestId,
JSONRPCResult.MSG_ERR_NOMETHOD);
}
if (oi != null)
{
itsThis = oi.o;
cd = ClassAnalyzer.getClassData(oi.clazz);
methodMap = cd.getMethodMap();
}
else
{
if (cd != null)
{
methodMap = cd.getStaticMethodMap();
}
}
}
else
{
if ((oi = resolveObject(Integer.valueOf(objectID))) == null)
{
return new JSONRPCResult(JSONRPCResult.CODE_ERR_NOMETHOD, requestId,
JSONRPCResult.MSG_ERR_NOMETHOD);
}
itsThis = oi.o;
cd = ClassAnalyzer.getClassData(oi.clazz);
methodMap = cd.getMethodMap();
// Handle "system.listMethods"
// this is called by the browser side javascript
// when a new JSONRpcClient object with an objectID is initialized.
if (methodName != null && methodName.equals("listMethods"))
{
HashSet m = new HashSet();
uniqueMethods(m, "", cd.getStaticMethodMap());
uniqueMethods(m, "", cd.getMethodMap());
JSONArray methods = new JSONArray();
Iterator i = m.iterator();
while (i.hasNext())
{
methods.put(i.next());