/** * Listen for messages. * @param message The message to send back to the client. */ public int handleMessage(BaseMessage message) { Utility.getLogger().info("RemoteQueue handling message " + message); if (message.getProcessedByClientSession() == this.getParentSession()) return DBConstants.NORMAL_RETURN; // Do not process this message (the client has already taken care of it). if (message.getProcessedByClientSession() instanceof RemoteObject) // if (this.getParentSession() instanceof RemoteObject) // Always // if (((RemoteObject)this.getParentSession()).getRef().remoteEquals(((RemoteObject)message.getProcessedByClientSession()).getRef())) return DBConstants.NORMAL_RETURN; // Same client. if (message == m_messageLastMessage) return DBConstants.NORMAL_RETURN; // Don't send a message to the same client twice. m_messageLastMessage = message; this.getMessageStack().sendMessage(message); return DBConstants.NORMAL_RETURN; } /**
/** * Handle this message. * Get the name of this process and run it. */ public int handleMessage(BaseMessage message) { String strClassName = this.getMessageProcessorClassName(message); if ((strClassName == null) || (strClassName.length() == 0)) return this.handleOtherMessage(message); message.consume(); // I'll be handling this one. String strParams = Utility.addURLParam(null, DBParams.PROCESS, strClassName); App application = m_application; if (message.getProcessedByClientSession() instanceof RemoteTask) if (message.getProcessedByClientSession() instanceof Task) // Always application = ((Task)message.getProcessedByClientSession()).getApplication(); // If I have the task session, run this task under the same app MessageProcessRunnerTask task = new MessageProcessRunnerTask(application, strParams, null); task.setMessage(message); m_application.getTaskScheduler().addTask(task); return DBConstants.NORMAL_RETURN; // No need to call super. } /**
/** * Handle this message. * Get the name of this process and run it. */ public int handleMessage(BaseMessage message) { String strClassName = this.getMessageProcessorClassName(message); if ((strClassName == null) || (strClassName.length() == 0)) return this.handleOtherMessage(message); message.consume(); // I'll be handling this one. String strParams = Utility.addURLParam(null, DBParams.PROCESS, strClassName); Application application = m_application; if (message.getProcessedByClientSession() instanceof TaskSession) application = ((TaskSession)message.getProcessedByClientSession()).getApplication(); // If I have the task session, run this task under the same app MessageProcessRunnerTask task = new MessageProcessRunnerTask(application, strParams, null); task.setMessage(message); m_application.getTaskScheduler().addTask(task); return DBConstants.NORMAL_RETURN; // No need to call super. } /**