Gets a management lock at the subscription level.

@param lockName The name of the lock to get.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ManagementLockObjectInner object
432451
public Observable<ManagementLockObjectInner> getAtSubscriptionLevelAsync(String lockName) {
        return getAtSubscriptionLevelWithServiceResponseAsync(lockName).map(new Func1<ServiceResponse<ManagementLockObjectInner>, ManagementLockObjectInner>() {
            @Override
            public ManagementLockObjectInner call(ServiceResponse<ManagementLockObjectInner> response) {
                return response.body();
            }
        });
    }
1357878
public String getLockedByName() {

        String lockedBy = "";
        if (!getLock().isNullLock()) {
            // user
            lockedBy = getLock().getUserId().toString();
            try {
                lockedBy = getCurrentOuRelativeName(
                    CmsPrincipal.readPrincipalIncludingHistory(getCms(), getLock().getUserId()).getName());
            } catch (Throwable e) {
                lockedBy = e.getMessage();
            }
        }
        return lockedBy;
    }
646477
public function find($entityName, $identifier, $lockMode = LockMode::NONE, $lockVersion = null)
    {
        return $this->getRepository($entityName)->find($identifier, $lockMode, $lockVersion);
    }
1015360
public CmsLock getLock() {

        if (m_lock == null) {
            try {
                m_lock = getCms().getLock(m_resource);
            } catch (Throwable e) {
                m_lock = CmsLock.getNullLock();
                LOG.error(e.getLocalizedMessage(), e);
            }
        }
        return m_lock;
    }
915538
public static synchronized org.apache.ojb.odmg.locking.LockManager getLockManager()
    {
        if(lockManagerFactory == null)
        {
            lockManagerFactory = new LockManagerFactory();
        }
        return lockManagerFactory.getManager();
    }
645552
private CmsLock getParentLock(String resourcename) {

        CmsLock parentFolderLock = getParentFolderLock(resourcename);
        if (!parentFolderLock.isNullLock()) {
            return new CmsLock(
                resourcename,
                parentFolderLock.getUserId(),
                parentFolderLock.getProject(),
                CmsLockType.INHERITED);
        }
        return CmsLock.getNullLock();
    }
1005357
public final ManagedObject getManagedObject()
                    throws ObjectManagerException {
//    final String methodName = "getManagedObject";
//    if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
//      trace.entry(this,
//                  cclass,
//                  methodName);

        // Get the object if is already in memory.
        ManagedObject managedObject = null;
        if (managedObjectReference != null)
            managedObject = (ManagedObject) managedObjectReference.get();

        if (managedObject == null) { // See if we can avoid synchronizing.
            synchronized (this) {
                if (managedObjectReference != null)
                    managedObject = (ManagedObject) managedObjectReference.get();
                if (managedObject == null) {
                    managedObject = objectStore.get(this);
                    if (managedObject != null) {
                        managedObject.owningToken = this; // PM22584 Set the owning token first
                        managedObjectReference = new java.lang.ref.WeakReference(managedObject);
                    } // if (managedObject != null). 
                } // if (managedObject == null).
            } // synchronize (this).
        } // if (managedObject == null).

//    if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
//      trace.exit(this,
//                 cclass,
//                 methodName,
//                 new Object[] {managedObject}); 
        return managedObject;
    }
1007059
def get_lock (name, debug=False):
    
    lock = threading.Lock()
    # for thread debugging, use the DebugLock wrapper
    if debug:
        lock = DebugLock(lock, name)
    return lock
505735
public Observable<ClusterInner> getByResourceGroupAsync(String resourceGroupName, String clusterName) {
        return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1<ServiceResponse<ClusterInner>, ClusterInner>() {
            @Override
            public ClusterInner call(ServiceResponse<ClusterInner> response) {
                return response.body();
            }
        });
    }
572934
protected String getLockErrorTitle(CmsLockInfo lockInfo) {

        switch (lockInfo.getState()) {
            case changed:
                return Messages.get().key(Messages.ERR_LOCK_TITLE_RESOURCE_CHANGED_0);
            case locked:
                return Messages.get().key(Messages.ERR_LOCK_TITLE_RESOURCE_LOCKED_0);
            case other:
            case success:
            default:
                return Messages.get().key(Messages.GUI_LOCK_FAIL_0);
        }
    }
1029522
public Bucket lockRetentionPolicy(String bucketName) throws StorageException {
    // [START storage_lock_retention_policy]
    // Instantiate a Google Cloud Storage client
    Storage storage = StorageOptions.getDefaultInstance().getService();

    // The name of a bucket, e.g. "my-bucket"
    // String bucketName = "my-bucket";

    Bucket bucket =
        storage.get(bucketName, Storage.BucketGetOption.fields(BucketField.METAGENERATION));
    Bucket lockedBucket =
        bucket.lockRetentionPolicy(Storage.BucketTargetOption.metagenerationMatch());

    System.out.println("Retention period for " + bucketName + " is now locked");
    System.out.println(
        "Retention policy effective as of " + new Date(lockedBucket.getRetentionEffectiveTime()));
    // [END storage_lock_retention_policy]
    return lockedBucket;
  }
408037
public Object getLock(Object key)
    {
        int index = (key.hashCode() & 0x7FFFFFFF) % locks.length;

        // Double-checked locking.  Safe since Object has no state.
        Object lock = locks[index];
        if (lock == null)
        {
            synchronized (this)
            {
                lock = locks[index];
                if (lock == null)
                {
                    lock = new Object();
                    locks[index] = lock;
                }
            }
        }

        return lock;
    }
98104
public Observable<ServiceResponse<UserInner>> getPublishingUserWithServiceResponseAsync() {
        if (this.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null.");
        }
        return service.getPublishingUser(this.apiVersion(), this.acceptLanguage(), this.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<UserInner>>>() {
                @Override
                public Observable<ServiceResponse<UserInner>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<UserInner> clientResponse = getPublishingUserDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
406622
protected final void unLock(ObjectManagerState objectManagerState)
    {
        synchronized (objectManagerState.transactionUnlockSequenceLock) {
            unlockSequence = objectManagerState.getNewGlobalTransactionUnlockSequence();
            lockingTransaction = null;
        } // synchronized.
    }
318668
public static ILockableEntityGroup findLockableGroup(String key, String lockOwner)
            throws GroupsException {
        LOGGER.trace("Invoking findLockableGroup for key='{}', lockOwner='{}'", key, lockOwner);
        return instance().ifindLockableGroup(key, lockOwner);
    }
149560
public Observable<ServiceResponse<Boolean>> checkExistenceWithServiceResponseAsync(String resourceGroupName) {
        if (resourceGroupName == null) {
            throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
        }
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        return service.checkExistence(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<Void>, Observable<ServiceResponse<Boolean>>>() {
                @Override
                public Observable<ServiceResponse<Boolean>> call(Response<Void> response) {
                    try {
                        ServiceResponse<Boolean> clientResponse = checkExistenceDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
1122654
public Observable<PolicyDefinitionInner> getAsync(String policyDefinitionName) {
        return getWithServiceResponseAsync(policyDefinitionName).map(new Func1<ServiceResponse<PolicyDefinitionInner>, PolicyDefinitionInner>() {
            @Override
            public PolicyDefinitionInner call(ServiceResponse<PolicyDefinitionInner> response) {
                return response.body();
            }
        });
    }