/// <summary>
        /// Implementation of the refresh method on RBroker interface
        /// /// </summary>
        /// <param name="config">Pooled Broker Configuration object</param>
        /// <remarks></remarks>
        public new void refresh(RBrokerConfig config)
        {
            if (!status().isIdle)
            {
                throw new Exception("RBroker is not idle, refresh not permitted.");
            }

            if (!(config is PooledBrokerConfig))
            {
                throw new Exception("PooledTaskBroker refresh requires PooledBrokerConfig.");
            }

            PooledBrokerConfig pooledConfig = (PooledBrokerConfig)config;

            try
            {
                /*
                 * Temporarily disable RBroker to permit
                 * configuration refresh.
                 */
                Interlocked.Exchange(ref m_refreshingConfig, 1);

                ProjectExecutionOptions options = ROptionsTranslator.migrate(pooledConfig.poolCreationOptions);

                foreach (Object resourceToken in m_resourceTokenPool)
                {
                    RProject rProject = (RProject)resourceToken;

                    /*
                     * Recycle project to remove all existing
                     * workspace objects and directory files.
                     */
                    rProject.recycle();

                    /*
                     * Execute code to cause workspace and directory
                     * preloads and adoptions to take place.
                     */
                    rProject.executeCode("# Refresh project on PooledTaskBroker.", options);
                }
            }
            catch (Exception rex)
            {
                throw new Exception("RBroker refresh failed with unexpected error=" + rex.ToString());
            }
            finally
            {
                /*
                 * Re-enabled RBroker following
                 * configuration refresh.
                 */
                Interlocked.Exchange(ref m_refreshingConfig, 0);
            }
        }
 /// <summary>
 /// Implementation of RBroker Interface 'refresh' method
 /// </summary>
 /// <param name="config">RBrokerConfig reference</param>
 /// <remarks></remarks>
 public void refresh(RBrokerConfig config)
 {
     throw new Exception("RBrokerEngine refresh not supported.");
 }
 /// <summary>
 /// RBrokerEngine constructor.
 /// </summary>
 /// <param name="brokerConfig">RBrokerConfig reference</param>
 /// <remarks></remarks>
 public RBrokerEngine(RBrokerConfig brokerConfig)
 {
     m_brokerConfig = brokerConfig;
 }
 /// <summary>
 /// Implementation of the refresh method on RBroker interface
 /// </summary>
 /// <param name="config">Background Broker Configuration object</param>
 /// <remarks></remarks>
 public new void refresh(RBrokerConfig config)
 {
     throw new Exception("BackgroundTaskBroker configuration refresh not supported.");
 }
 /// <summary>
 /// RBrokerEngine constructor.
 /// </summary>
 /// <param name="brokerConfig">RBrokerConfig reference</param>
 /// <remarks></remarks>
 public RBrokerEngine(RBrokerConfig brokerConfig)
 {
     m_brokerConfig = brokerConfig;
 }
 /// <summary>
 /// Implementation of RBroker Interface 'refresh' method
 /// </summary>
 /// <param name="config">RBrokerConfig reference</param>
 /// <remarks></remarks>
 public void refresh(RBrokerConfig config)
 {
     throw new Exception("RBrokerEngine refresh not supported.");
 }
Example #7
0
 /// <summary>
 /// Implementation of the refresh method on RBroker interface
 /// </summary>
 /// <param name="config">Background Broker Configuration object</param>
 /// <remarks></remarks>
 public new void refresh(RBrokerConfig config)
 {
     throw new Exception("BackgroundTaskBroker configuration refresh not supported.");
 }
 /// <summary>
 /// Implementation of the refresh method on RBroker interface
 /// /// </summary>
 /// <param name="config">Discrete Broker Configuration object</param>
 /// <remarks></remarks>
 public new void refresh(RBrokerConfig config)
 {
     throw new Exception("DiscreteTaskBroker configuration refresh not supported.");
 }
 /// <summary>
 /// Implementation of the refresh method on RBroker interface
 /// /// </summary>
 /// <param name="config">Discrete Broker Configuration object</param>
 /// <remarks></remarks>
 public new void refresh(RBrokerConfig config)
 {
     throw new Exception("DiscreteTaskBroker configuration refresh not supported.");
 }
        /// <summary>
        /// Implementation of the refresh method on RBroker interface
        /// /// </summary>
        /// <param name="config">Pooled Broker Configuration object</param>
        /// <remarks></remarks>
        public new void refresh(RBrokerConfig config)
        {
            if(!status().isIdle)
            {
                throw new Exception("RBroker is not idle, refresh not permitted.");
            }

            if(!(config is PooledBrokerConfig))
            {
                throw new Exception("PooledTaskBroker refresh requires PooledBrokerConfig.");
            }

            PooledBrokerConfig pooledConfig = (PooledBrokerConfig) config;

            try
            {
                /*
                 * Temporarily disable RBroker to permit
                 * configuration refresh.
                 */
                Interlocked.Exchange(ref m_refreshingConfig, 1);

                ProjectExecutionOptions options =  ROptionsTranslator.migrate(pooledConfig.poolCreationOptions);

                foreach(Object resourceToken in m_resourceTokenPool)
                {
                    RProject rProject = (RProject) resourceToken;
                    /*
                     * Recycle project to remove all existing
                     * workspace objects and directory files.
                     */
                    rProject.recycle();
                    /*
                     * Execute code to cause workspace and directory
                     * preloads and adoptions to take place.
                     */
                    rProject.executeCode("# Refresh project on PooledTaskBroker.", options);
                }

            }
            catch(Exception rex)
            {
                throw new Exception("RBroker refresh failed with unexpected error=" + rex.ToString());
            }
            finally
            {
                /*
                 * Re-enabled RBroker following
                 * configuration refresh.
                 */
                Interlocked.Exchange(ref m_refreshingConfig, 0);
            }
        }