Package ariba.util.core

Examples of ariba.util.core.GlobalLock


        if (!canAutoRecycle(doWindowCheck)) {
            return;
        }
        // get Global lock and check if safeToRecycle
        GlobalLockingService service = GlobalLocking.getService();
        GlobalLock lock = null;
        try {
            lock = service.acquireLock(globalLockName);
            if (lock == null) {
                // do nothing. We will try to recycle later.
                Log.shutdown.debug("Could not acquire global lock");
                return;
            }
            // Iterate through all the agents
            // If any of them says not safe to recycle, just return aborting
            // the recycle
            for (int i = 0; i < agents.size(); i++) {
                RecycleIfc agent = (RecycleIfc)agents.get(i);
                if (agent.isSafeToRecycle() == false) {
                    Log.shutdown.debug("Auto recycle pending: waiting for agent: %s",
                                       agent);
                    return;
                }
            }
            // Since some agents can be long running, check again if we can auto recycle.
            if (!canAutoRecycle(doWindowCheck)) {
                return;
            }
            // Starting auto recycle shutdown.
            Log.shutdown.info(9831);
            ShutdownManager.setNodeStatus(ShutdownManager.StatusNodeAutoRecycle);
        }
        finally {
            if ( lock != null && lock.isValid()) {
                releaseLock(lock);
            }
        }

        for (int i = 0; i < agents.size(); i++) {
View Full Code Here

TOP

Related Classes of ariba.util.core.GlobalLock

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.