/// <summary>
        /// Implementation of the submit method on RBroker interface.
        /// Allows applications to submit a new Task for execution.
        /// </summary>
        /// <param name="task">RTask to be submitted for execution as a discrete task</param>
        /// <param name="priority">priority of task.  If TRUE, then task has a high priority</param>
        /// <returns>RTaskToken for this RTask</returns>
        /// <remarks></remarks>
        public new RTaskToken submit(RTask task, Boolean priority)
        {
            DiscreteTask discreteTask = (DiscreteTask)task;

            if (m_rUser == null && discreteTask.external != "")
            {
                throw new Exception("External script task execution not permitted on anonymous broker.");
            }

            return(submit(task, priority));
        }
Example #2
0
 /// <summary>
 /// Constructor for specifying a Discrete Instance of RBrokerWorker
 /// </summary>
 /// <param name="task">DiscreteTask reference</param>
 /// <param name="executorTaskRef">Reserved for future use</param>
 /// <param name="isPriorityTask">Boolean indicating if this ia high priority task</param>
 /// <param name="rClient">RClient reference</param>
 /// <param name="resourceToken">integer referencing the token from the reosurce pool</param>
 /// <param name="rBroker">RBroker reference</param>
 /// <remarks></remarks>
 public DiscreteTaskWorker(DiscreteTask task,
                           long executorTaskRef,
                           Boolean isPriorityTask,
                           RClient rClient,
                           int resourceToken,
                           RBroker rBroker)
 {
     m_task            = task;
     m_executorTaskRef = executorTaskRef;
     m_isPriorityTask  = isPriorityTask;
     m_rClient         = rClient;
     m_resourceToken   = resourceToken;
     m_rBroker         = (DiscreteTaskBroker)rBroker;
 }
 /// <summary>
 /// Constructor for specifying a Discrete Instance of RBrokerWorker
 /// </summary>
 /// <param name="task">DiscreteTask reference</param>
 /// <param name="executorTaskRef">Reserved for future use</param>
 /// <param name="isPriorityTask">Boolean indicating if this ia high priority task</param>
 /// <param name="rClient">RClient reference</param>
 /// <param name="resourceToken">integer referencing the token from the reosurce pool</param>
 /// <param name="rBroker">RBroker reference</param>
 /// <remarks></remarks>
 public DiscreteTaskWorker(DiscreteTask task,
                           long executorTaskRef,
                           Boolean isPriorityTask,
                           RClient rClient,
                           int resourceToken,
                           RBroker rBroker)
 {
     m_task = task;
     m_executorTaskRef = executorTaskRef;
     m_isPriorityTask = isPriorityTask;
     m_rClient = rClient;
     m_resourceToken = resourceToken;
     m_rBroker = (DiscreteTaskBroker) rBroker;
 }
        /// <summary>
        /// cloneTask override method for DiscreteTaskBroker.
        /// </summary>
        /// <remarks></remarks>
        protected override RTask cloneTask(RTask genesis)
        {
            DiscreteTask source = (DiscreteTask)genesis;
            DiscreteTask clone  = null;

            if (source.external != "")
            {
                String externalURL = source.external;

                clone = new DiscreteTask(externalURL,
                                         source.options);
            }
            else
            {
                clone = new DiscreteTask(source.filename,
                                         source.directory,
                                         source.author,
                                         source.version,
                                         source.options);
            }
            clone.setToken(source.getToken());

            return(clone);
        }
        /// <summary>
        /// cloneTask override method for DiscreteTaskBroker.
        /// </summary>
        /// <remarks></remarks>
        protected override RTask cloneTask(RTask genesis)
        {
            DiscreteTask source  = (DiscreteTask) genesis;
            DiscreteTask clone = null;
            if(source.external != "")
            {
                String externalURL = source.external;

                clone = new DiscreteTask(externalURL,
                                       source.options);
            }
            else
            {
                clone = new DiscreteTask(source.filename,
                                       source.directory,
                                       source.author,
                                       source.version,
                                       source.options);
            }
            clone.setToken(source.getToken());

            return clone;
        }