class ToStringMessage : public JavaMessage { jsobject mObject; jstring* mStringResult; public: ToStringMessage(jsobject js_obj, jstring* stringResult) :	mObject(js_obj), mStringResult(stringResult) { }
class ToStringMessage : public JavaMessage { MRJPluginInstance* mPluginInstance; jsobject mObject; jstring* mStringResult; public: ToStringMessage(MRJPluginInstance* pluginInstance, jsobject js_obj, jstring* stringResult) :   mPluginInstance(pluginInstance), mObject(js_obj), mStringResult(stringResult) { }
Java_netscape_javascript_JSObject_toString(JNIEnv* env, jobject java_wrapper_obj){	/* unwrap the JS object from the Java object. */	jstring jresult = NULL;	jsobject js_obj = Unwrap_JSObject(env, java_wrapper_obj);	class ToStringMessage : public JavaMessage {		jsobject mObject;		jstring* mStringResult;	public:		ToStringMessage(jsobject js_obj, jstring* stringResult)			:	mObject(js_obj), mStringResult(stringResult)		{		}		virtual void execute(JNIEnv* env)		{			jstring jresult = NULL;			nsresult status = theLiveConnectManager->ToString(env, mObject, &jresult);			if (status == NS_OK && jresult != NULL)				*mStringResult = (jstring) ToGlobalRef(env, jresult);		}	} msg(js_obj, &jresult);		sendMessage(env, &msg);		if (jresult != NULL)		jresult = (jstring) ToLocalRef(env, jresult);		return jresult;}