/** * Return the current queue name. * * @return The name of the current queue. */ RexxString *Interpreter::getCurrentQueue() { RexxObject *queue = ActivityManager::getLocalEnvironment(GlobalNames::STDQUE); if (queue == OREF_NULL) // no queue set? Default to session { return GlobalNames::SESSION; // the session queue is the default } ProtectedObject result; // get the current name from the queue object. return(RexxString *)queue->sendMessage(GlobalNames::GET, result); }
RexxObject *RexxSupplierClass::newRexx( RexxObject **init_args, /* subclass init arguments */ size_t argCount) /* count of arguments */ /****************************************************************************/ /* Function: Public REXX supplier new method */ /****************************************************************************/ { RexxObject *newObj = new RexxSupplier(); ProtectedObject p(newObj); newObj->setBehaviour(this->getInstanceBehaviour()); if (this->hasUninitDefined()) { newObj->hasUninit(); } /* Initialize the new instance */ newObj->sendMessage(OREF_INIT, init_args, argCount); return newObj; /* return the new supplier */ }
/** * Execute a Delegate method forward operation. * * @param activity The current activity. * @param method The method we're invoking. * @param receiver The receiver object. * @param messageName * The name of the message used to invoke the method. * @param argPtr The pointer to the arguments. * @param count The argument count. * @param result The returned result. */ void DelegateCode::run(Activity *activity, MethodClass *method, RexxObject *receiver, RexxString *messageName, RexxObject **argPtr, size_t count, ProtectedObject &result) { // get the variable pool and get VariableDictionary *objectVariables = receiver->getObjectVariables(method->getScope()); RexxObject *target; // if this is a guarded method, we grab the guard only long enough to // get the target variable. The message send is sent without holding the lock if (method->isGuarded()) { objectVariables->reserve(activity); target = attribute->getValue(receiver->getObjectVariables(method->getScope())); // and ensure we release this afterwards objectVariables->release(activity); } else { target = attribute->getValue(receiver->getObjectVariables(method->getScope())); } // and finally, send the message to the resolved target target->sendMessage(messageName, argPtr, count, result); }