Package org.apache.cloudstack.managed.context

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


            try {
                final ClusterServicePdu pdu = popIncomingClusterPdu(1000);
                if (pdu == null)
                    continue;

                _executor.execute(new ManagedContextRunnable() {
                    @Override
                    protected void runInContext() {
                        if (pdu.getPduType() == ClusterServicePdu.PDU_TYPE_RESPONSE) {
                            ClusterServiceRequestPdu requestPdu = popRequestPdu(pdu.getAckSequenceId());
                            if (requestPdu != null) {
View Full Code Here


            }
        }
    }

    private Runnable getHeartbeatTask() {
        return new ManagedContextRunnable() {
            @Override
            protected void runInContext() {
                TransactionLegacy txn = TransactionLegacy.open("ClusterHeartbeat");
                try {
                    Profiler profiler = new Profiler();
View Full Code Here

            // As a matter of fact, it will be assigned to the connection instance variable in the ConnectionConcierge class.
        }
    }

    private Runnable getNotificationTask() {
        return new ManagedContextRunnable() {
            @Override
            protected void runInContext() {
                while (true) {
                    synchronized (_notificationMsgs) {
                        try {
View Full Code Here

        _serverPort = serverPort;

        _executor = Executors.newFixedThreadPool(_poolSize, new NamedThreadFactory("Transport-Worker"));
        _connection = new ClientTransportConnection(this);

        _executor.execute(new ManagedContextRunnable() {
            @Override
            protected void runInContext() {
                try {
                    _connection.connect(_serverAddress, _serverPort);
                } catch (Throwable e) {
View Full Code Here

    }

    private void launchConsoleProxy(final byte[] ksBits, final String ksPassword, final String encryptorPassword) {
        final Object resource = this;
        if (_consoleProxyMain == null) {
            _consoleProxyMain = new Thread(new ManagedContextRunnable() {
                @Override
                protected void runInContext() {
                    try {
                        Class<?> consoleProxyClazz = Class.forName("com.cloud.consoleproxy.ConsoleProxy");
                        try {
View Full Code Here

                    // Set up HTTP connection
                    Socket socket = _serverSocket.accept();
                    final DefaultHttpServerConnection conn = new DefaultHttpServerConnection();
                    conn.bind(socket, _params);

                    _executor.execute(new ManagedContextRunnable() {
                        @Override
                        protected void runInContext() {
                            HttpContext context = new BasicHttpContext(null);
                            try {
                                while (!Thread.interrupted() && conn.isOpen()) {
View Full Code Here

                }
            }

            _executor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("ConnectionConcierge"));

            _executor.scheduleAtFixedRate(new ManagedContextRunnable() {
                @Override
                protected void runInContext() {
                    s_logger.trace("connection concierge keep alive task");
                    for (Map.Entry<String, ConnectionConcierge> entry : _conns.entrySet()) {
                        ConnectionConcierge concierge = entry.getValue();
View Full Code Here

    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 false;
    }

    @Override
    public void requestSiteOutput(final TransportEndpointSite site) {
        _executor.execute(new ManagedContextRunnable() {
            @Override
            protected void runInContext() {
                try {
                    site.processOutput();
                    site.ackOutputProcessSignal();
View Full Code Here

        return true;
    }

    @Override
    public void run() {
        (new ManagedContextRunnable() {
            @Override
            protected void runInContext() {
                runInContextInternal();
            }
        }).run();
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.