public void refresh()

in src/main/java/com/revo/deployr/client/broker/engine/PooledTaskBroker.java [91:140]


    public void refresh(RBrokerConfig config) throws RBrokerException {

        if (!status().isIdle) {
            throw new RBrokerException("RBroker is not idle, " +
                    "refresh not permitted.");
        }

        if (!(config instanceof PooledBrokerConfig)) {
            throw new RBrokerException("PooledTaskBroker refresh " +
                    "requires PooledBrokerConfig.");
        }

        PooledBrokerConfig pooledConfig =
                (PooledBrokerConfig) config;

        try {
            /*
             * Temporarily disable RBroker to permit
             * configuration refresh.
             */
            refreshingConfig.set(true);

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

            for (Object resourceToken : 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 RBrokerException("RBroker refresh failed " +
                    " with unexpected error=${rex}");
        } finally {
            /*
             * Re-enabled RBroker following
             * configuration refresh.
             */
            refreshingConfig.set(false);
        }
    }