Package java.util.concurrent.locks

Examples of java.util.concurrent.locks.Lock.lock()


     * Container (if any); otherwise return <code>null</code>.
     */
    @Override
    public Cluster getCluster() {
        Lock readLock = clusterLock.readLock();
        readLock.lock();
        try {
            if (cluster != null)
                return cluster;

            if (parent != null)
View Full Code Here


    /*
     * Provide access to just the cluster component attached to this container.
     */
    protected Cluster getClusterInternal() {
        Lock readLock = clusterLock.readLock();
        readLock.lock();
        try {
            return cluster;
        } finally {
            readLock.unlock();
        }
View Full Code Here

    @Override
    public void setCluster(Cluster cluster) {

        Cluster oldCluster = null;
        Lock writeLock = clusterLock.writeLock();
        writeLock.lock();
        try {
            // Change components if necessary
            oldCluster = this.cluster;
            if (oldCluster == cluster)
                return;
View Full Code Here

    @Override
    public Realm getRealm() {

        Lock l = realmLock.readLock();
        try {
            l.lock();
            if (realm != null)
                return (realm);
            if (parent != null)
                return (parent.getRealm());
            return null;
View Full Code Here


    protected Realm getRealmInternal() {
        Lock l = realmLock.readLock();
        try {
            l.lock();
            return realm;
        } finally {
            l.unlock();
        }
    }
View Full Code Here

    public void setRealm(Realm realm) {

        Lock l = realmLock.writeLock();

        try {
            l.lock();

            // Change components if necessary
            Realm oldRealm = this.realm;
            if (oldRealm == realm)
                return;
View Full Code Here


    @Override
    public Loader getLoader() {
        Lock readLock = loaderLock.readLock();
        readLock.lock();
        try {
            return loader;
        } finally {
            readLock.unlock();
        }
View Full Code Here

    @Override
    public void setLoader(Loader loader) {

        Lock writeLock = loaderLock.writeLock();
        writeLock.lock();
        Loader oldLoader = null;
        try {
            // Change components if necessary
            oldLoader = this.loader;
            if (oldLoader == loader)
View Full Code Here


    @Override
    public Manager getManager() {
        Lock readLock = managerLock.readLock();
        readLock.lock();
        try {
            return manager;
        } finally {
            readLock.unlock();
        }
View Full Code Here

    @Override
    public void setManager(Manager manager) {

        Lock writeLock = managerLock.writeLock();
        writeLock.lock();
        Manager oldManager = null;
        try {
            // Change components if necessary
            oldManager = this.manager;
            if (oldManager == manager)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.