Examples of lock()


Examples of com.twitter.common.zookeeper.DistributedLockImpl.lock()

    public void lock(String lockPath) {
        assert mLocks.get(lockPath) == null: "mLocks.get(" + lockPath + ") == null";
        DistributedLock distributedLock = new DistributedLockImpl(mZookeeperClient, lockPath);
        mLocks.put(lockPath, distributedLock);
        distributedLock.lock();
    }

    public void unlock(String lockPath) {
        DistributedLock distributedLock = mLocks.get(lockPath);
        assert distributedLock != null: "mLocks.get(" + lockPath + ") != null";
View Full Code Here

Examples of com.uic.ase.proj.xbn.array.AOSLCreator.lock()

    for(int i = 0; i < primitive_array.getLength(); i++)  {
      aoslc.addString(primitive_array.getString(i));
    }

    aoslc.lock();

    return aoslc.getAOSLookup();
  }

  /**
 
View Full Code Here

Examples of com.vaadin.server.VaadinSession.lock()

        }

        @Override
        public BeanStore getBeanStore() {
            VaadinSession session = getVaadinSession();
            session.lock();
            try {
                BeanStore beanStore = session.getAttribute(BeanStore.class);
                if (beanStore == null) {
                    beanStore = new BeanStore("session " + session.getSession().getId());
                    session.setAttribute(BeanStore.class, beanStore);
View Full Code Here

Examples of com.webobjects.eoaccess.EODatabaseContext.lock()

        EOGlobalID aGlobalID = anEditingContext.globalIDForObject(this);
        String aModelName = anEntity.model().name();
        EODatabaseContext aDatabaseContext = EOUtilities
            .databaseContextForModelNamed(anEditingContext,
                aModelName);
        aDatabaseContext.lock();
        NSDictionary aRow = aDatabaseContext
            .snapshotForGlobalID(aGlobalID);
        aDatabaseContext.unlock();
        EOQualifier aQualifier = aRelationship
            .qualifierWithSourceRow(aRow);
View Full Code Here

Examples of com.webobjects.eocontrol.EOEditingContext.lock()

      }
      if(ec == null) {
        ec = _editingContextFactory.newEditingContext();
        registerEditingContext(ec);
      }
      ec.lock();
      try {
        String type = null;
        String pk = null;
        if (parts.length > 2) {
          type = parts[2];
View Full Code Here

Examples of com.webobjects.eocontrol.EOObjectStore.lock()

     *          The variable bindings, wrapped in {@link ERXSQLBinding} objects
     */
    public static void runSqlQueryWithBindings( EOEditingContext ec, String modelName, String query, ERXSQLBinding... bindings ) {
        EOObjectStore osc = ec.rootObjectStore();
        EODatabaseChannel databaseChannel = databaseContextForModelName(ec,modelName).availableChannel();
        osc.lock();

        try {
            EOAdaptorChannel adaptorChannel = databaseChannel.adaptorChannel();
           
            if (!adaptorChannel.isOpen()) {
View Full Code Here

Examples of com.webobjects.eocontrol.EOObjectStoreCoordinator.lock()

     * @param database database object
     */
    public static void clearSnapshotForRelationshipNamedInDatabase(EOEnterpriseObject eo, String relationshipName, EODatabase database) {
        EOEditingContext ec = eo.editingContext();
        EOObjectStoreCoordinator osc = (EOObjectStoreCoordinator) ec.rootObjectStore();
        osc.lock();
        try {
          EOGlobalID gid = ec.globalIDForObject(eo);
          database.recordSnapshotForSourceGlobalID(null, gid, relationshipName);
          Object o = eo.storedValueForKey(relationshipName);
          boolean needRefresh = false;
View Full Code Here

Examples of com.webobjects.eocontrol.EOSharedEditingContext.lock()

    public static void refreshSharedObjectsWithName(String entityName) {
        if (entityName == null) {
            throw new IllegalArgumentException("Entity name argument is null for method: refreshSharedObjectsWithName");
        }
        EOSharedEditingContext sharedEC = EOSharedEditingContext.defaultSharedEditingContext();
        sharedEC.lock();
        try {
            EOEntity entity = ERXEOAccessUtilities.entityNamed(sharedEC, entityName);
            if (entity == null) {
                _log.warn("Attempting to refresh a non-existent (or not accessible) EO: " + entityName);
                return;
View Full Code Here

Examples of edu.emory.mathcs.backport.java.util.concurrent.locks.Lock.lock()

    public ConstraintInfo[] get_constraints(int[] ids) throws ConstraintNotFound
    {
        final Lock _lock = constraintsLock_.readLock();

        _lock.lock();
        try
        {
            final ConstraintInfo[] _constraintInfo = new ConstraintInfo[ids.length];

            for (int _x = 0; _x < ids.length; ++_x)
View Full Code Here

Examples of edu.emory.mathcs.backport.java.util.concurrent.locks.ReentrantLock.lock()

        }

        public boolean remove(Object x) {
            boolean removed;
            final ReentrantLock lock = this.lock;
            lock.lock();
            try {
                int i;
                if (x instanceof ScheduledFutureTask)
                    i = ((ScheduledFutureTask)x).heapIndex;
                else
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.