Examples of Lock


Examples of br.org.scadabr.dnp34j.master.common.utils.Lock

    appRcv.start();
    appSnd.start();
    lnkRcv.start();
    lnkSnd.start();

    userRcvLock = new Lock();
    Thread.sleep(1000);
    boolean ok = resetLink(500);
    if (!ok)
      throw new Exception("Reset Link Failed!");
  }
View Full Code Here

Examples of com.arjuna.ats.txoj.Lock

     */
    public float balance()
    {
        float result = 0;
        // Set a read lock
        if (setlock(new Lock(LockMode.READ), 0) == LockResult.GRANTED)
        {
            result = _balance;
        }
        else
        {
View Full Code Here

Examples of com.caucho.db.lock.Lock

  private void releaseLocks()
  {
    // need to unlock write before upgrade to block other threads
    if (_writeLocks != null) {
      for (int i = 0; i < _writeLocks.size(); i++) {
        Lock lock = _writeLocks.get(i);

        if (_readLocks != null)
          _readLocks.remove(lock);

        try {
          lock.unlockReadAndWrite();
        } catch (Throwable e) {
          log.log(Level.WARNING, e.toString(), e);
        }
      }

      _writeLocks.clear();
    }
   
    if (_readLocks != null) {
      for (int i = 0; i < _readLocks.size(); i++) {
        Lock lock = _readLocks.get(i);

        try {
          lock.unlockRead();
        } catch (Throwable e) {
          log.log(Level.WARNING, e.toString(), e);
        }
      }
View Full Code Here

Examples of com.hp.hpl.jena.shared.Lock

   
        @Override
        public Object call()
        {
            DatasetGraph dsg = null ;
            Lock lock = null ;
            try
            {
                dsg = tts.getDatasetGraph() ;
                lock = dsg.getLock() ;
                int id = gen.incrementAndGet() ;
                for (int i = 0; i < repeats; i++)
                {
                    try {
                        lock.enterCriticalSection(Lock.READ) ;
                        log.debug("reader start " + id + "/" + i) ;

                        int x1 = count("SELECT * { ?s ?p ?o }", dsg) ;
                        pause(maxpause) ;
                        int x2 = count("SELECT * { ?s ?p ?o }", dsg) ;
                        if (x1 != x2) log.warn(format("READER: %s Change seen: %d/%d : id=%d: i=%d",
                                                      "read-" + i, x1, x2, id, i)) ;
                        log.debug("reader finish " + id + "/" + i) ;
                    } catch (RuntimeException ex)
                    {
                        log.debug("reader error " + id + "/" + i) ;
                        ex.printStackTrace() ;
                    } finally {
                        lock.leaveCriticalSection() ;                       
                    }
                }
                return null ;
            } catch (RuntimeException ex)
            {
View Full Code Here

Examples of com.volantis.mcs.repository.lock.Lock

            while (resultSet.next()) {
                String resourceIdentifier = resultSet.getString(1);
                String principalName = resultSet.getString(2);
                Timestamp acquisitionTime = resultSet.getTimestamp(3);
                Principal principal = new JDBCPrincipal(principalName);
                Lock lock = updateLock(resourceIdentifier, principal,
                        acquisitionTime.getTime());
                locks.add(lock);
            }
        } catch (SQLException e) {
            throw new LockException(e);
View Full Code Here

Examples of com.woorea.openstack.nova.model.ServerAction.Lock

    private Lock action;

    private String id;

    public LockServer(String id) {
      super(CLIENT, HttpMethod.POST, new StringBuilder("/servers/").append(id).append("/action"), Entity.json(new Lock()), Void.class);
    }
View Full Code Here

Examples of de.dermoba.srcp.devices.LOCK

        if (addressToControlObject.get(deviceGroup).get(address) != null) {
            // got it already
            return;
        }
        addressToControlObject.get(deviceGroup).put(address, object);
        SRCPLock lock = new SRCPLock(new LOCK(session, address.getBus1()),
                false, -1);
        locks.put(object, lock);
    }
View Full Code Here

Examples of edu.emory.mathcs.backport.java.util.concurrent.locks.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)
            {
                Integer _key = new Integer(ids[_x]);

                if (constraints_.containsKey(_key))
                {
                    _constraintInfo[_x] = ((ConstraintEntry) constraints_.get(_key))
                            .getConstraintInfo();
                }
                else
                {
                    throw new ConstraintNotFound(ids[_x]);
                }
            }

            return _constraintInfo;
        } finally
        {
            _lock.unlock();
        }
    }
View Full Code Here

Examples of fi.foyt.hibernate.gae.search.persistence.domainmodel.Lock

  public LockDAO() {
    super("LOCK", true);
  }

  public Lock create(Directory directory, String name) {
    Lock lock = new Lock(directory);
    lock.setName(name);
    return persist(lock);
  }
View Full Code Here

Examples of info.aduna.concurrent.locks.Lock

  }

  public boolean addInferredStatement(Resource subj, URI pred, Value obj, Resource... contexts)
    throws StoreException
  {
    Lock conLock = getSharedConnectionLock();
    try {
      Lock txnLock = getTransactionLock();
      try {
        return getDelegate().addInferredStatement(subj, pred, obj, contexts);
      }
      finally {
        txnLock.release();
      }
    }
    finally {
      conLock.release();
    }
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.