Package org.apache.cloudstack.managed.context

Examples of org.apache.cloudstack.managed.context.ManagedContextRunnable


    public void prepareTemplateInAllStoragePools(final VMTemplateVO template, long zoneId) {
        List<StoragePoolVO> pools = _poolDao.listByStatus(StoragePoolStatus.Up);
        for (final StoragePoolVO pool : pools) {
            if (pool.getDataCenterId() == zoneId) {
                s_logger.info("Schedule to preload template " + template.getId() + " into primary storage " + pool.getId());
                _preloadExecutor.execute(new ManagedContextRunnable() {
                    @Override
                    protected void runInContext() {
                        try {
                            reallyRun();
                        } catch (Throwable e) {
View Full Code Here


        return true;
    }

    @Override
    public void run() {
        (new ManagedContextRunnable() {
            @Override
            protected void runInContext() {
                runInContextInternal();
            }
        }).run();
View Full Code Here

        return answers[0].getResult();
    }

    private Runnable getTransferScanTask() {
        return new ManagedContextRunnable() {
            @Override
            protected void runInContext() {
                try {
                    if (s_logger.isTraceEnabled()) {
                        s_logger.trace("Clustered agent transfer scan check, management server id:" + _nodeId);
View Full Code Here

    public boolean isAgentRebalanceEnabled() {
        return EnableLB.value();
    }

    private Runnable getAgentRebalanceScanTask() {
        return new ManagedContextRunnable() {
            @Override
            protected void runInContext() {
                try {
                    if (s_logger.isTraceEnabled()) {
                        s_logger.trace("Agent rebalance task check, management server id:" + _nodeId);
View Full Code Here

    }

    @Override
    public final Answer executeRequest(final Command cmd) {
        final AtomicReference<Answer> result = new AtomicReference<Answer>();
        new ManagedContextRunnable() {
            @Override
            protected void runInContext() {
                result.set(executeRequestInContext(cmd));
            }
        }.run();
View Full Code Here

            return _executionRunNumber++;
        }
    }

    private Runnable getExecutorRunnable(final AsyncJob job) {
        return new ManagedContextRunnable() {

            @Override
            public void run() {
                // register place-holder context to avoid installing system account call context
                if (CallContext.current() == null)
View Full Code Here

            }
        }
    }

    private Runnable getHeartbeatTask() {
        return new ManagedContextRunnable() {

            @Override
            protected void runInContext() {
                GlobalLock scanLock = GlobalLock.getInternLock("AsyncJobManagerHeartbeat");
                try {
View Full Code Here

        };
    }

    @DB
    private Runnable getGCTask() {
        return new ManagedContextRunnable() {
            @Override
            protected void runInContext() {
                GlobalLock scanLock = GlobalLock.getInternLock("AsyncJobManagerGC");
                try {
                    if (scanLock.lock(ACQUIRE_GLOBAL_LOCK_TIMEOUT_FOR_COOPERATION)) {
View Full Code Here

        }
        return null;
    }

    private Runnable getClusterPduSendingTask() {
        return new ManagedContextRunnable() {
            @Override
            protected void runInContext() {
                onSendingClusterPdu();
            }
        };
View Full Code Here

            }
        };
    }

    private Runnable getClusterPduNotificationTask() {
        return new ManagedContextRunnable() {
            @Override
            protected void runInContext() {
                onNotifyingClusterPdu();
            }
        };
View Full Code Here

TOP

Related Classes of org.apache.cloudstack.managed.context.ManagedContextRunnable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.