Examples of obtain()


Examples of brooklyn.location.docker.DockerHostLocation.obtain()

        dockerInfrastructure.start(ImmutableList.of(machinePool));

        DockerHost dockerHost = (DockerHost) Iterables.getOnlyElement(dockerInfrastructure.getDockerHostList());
        DockerHostLocation hostLoc = dockerHost.getDynamicLocation();

        DockerContainerLocation containerLoc = hostLoc.obtain();
        DockerContainer container = (DockerContainer) Iterables.getOnlyElement(dockerHost.getDockerContainerList());
        assertNotNull(container);
        hostLoc.release(containerLoc);
        assertTrue(dockerHost.getDockerContainerList().isEmpty(), "containers="+dockerHost.getDockerContainerList());
        //assertMembersEqualEventually(dockerInfrastructure.getContainerFabric(), ImmutableSet.<Entity>of());
View Full Code Here

Examples of cat.quickdb.binding.model.BindingObject.obtain()

    @Test
    public void testObtain(){
        BindingObject bind = new BindingObject();

        bind.obtain().If("name").equal("quickdb").find();
        Assert.assertEquals("quickdb", bind.getName());
        Assert.assertEquals(3000.50, bind.getSalary());
    }

    @Test
View Full Code Here

Examples of cat.quickdb.binding.model.BindingObject.obtain()

    @Test
    public void testObtainString(){
        BindingObject bind = new BindingObject();

        bind.obtain("name = 'quickdb'");
        Assert.assertEquals("quickdb", bind.getName());
        Assert.assertEquals(3000.50, bind.getSalary());
    }

    @Test
View Full Code Here

Examples of com.badlogic.gdx.utils.ReflectionPool.obtain()

      if (pool == null) {
        pool = new ReflectionPool(type, initialSize, maxSize);
        pools.put(type, pool);
      }
     
      return (T)pool.obtain();
    }
   
    public void free(Object object) {
      if (object == null) {
        throw new IllegalArgumentException("object cannot be null.");
View Full Code Here

Examples of com.badlogic.gdx.utils.ReflectionPool.obtain()

      if (pool == null) {
        pool = new ReflectionPool(type, initialSize, maxSize);
        pools.put(type, pool);
      }
     
      return (T)pool.obtain();
    }
   
    public void free(Object object) {
      if (object == null) {
        throw new IllegalArgumentException("object cannot be null.");
View Full Code Here

Examples of com.badlogic.gdx.utils.ReflectionPool.obtain()

      if (pool == null) {
        pool = new ReflectionPool(type, initialSize, maxSize);
        pools.put(type, pool);
      }
     
      return (T)pool.obtain();
    }
   
    public void free(Object object) {
      if (object == null) {
        throw new IllegalArgumentException("object cannot be null.");
View Full Code Here

Examples of com.hp.hpl.jena.tdb.base.file.LocationLock.obtain()

                LocationLock lock = location.getLock();
                if (lock.canLock()) {
                    if (!lock.canObtain())
                        throw new TDBException("Can't open database at location " + location.getDirectoryPath() + " as it is already locked by the process with PID " + lock.getOwner() + ".  TDB databases do not permit concurrent usage across JVMs so in order to prevent possible data corruption you cannot open this location from the JVM that does not own the lock for the dataset");

                    lock.obtain();
                    // There's an interesting race condition here that two JVMs might write out the lock file one after another without
                    // colliding and causing an IO error in either.  The best way to check for this is simply to check we now own the lock
                    // and if not error
                    if (!lock.isOwned()) {
                        throw new TDBException("Can't open database at location " + location.getDirectoryPath() + " as it is alread locked by the process with PID " + lock.getOwner() + ".  TDB databases do not permit concurrent usage across JVMs so in order to prevent possible data corruption you cannot open this location from the JVM that does not own the lock for the dataset");
View Full Code Here

Examples of org.apache.lucene.store.Lock.obtain()

              dicHome);
          Lock lock = FileLockFactory.makeLock(LOCK_FILE);

          boolean obtained = false;
          try {
            obtained = lock.obtain(90000);
            if (obtained) {
              // 编译词典-对词典进行可能的处理,以符合分词器的要求
              if (compiler.shouldCompile(p)) {
                Dictionaries dictionaries = readUnCompiledDictionaries(p);
                Paoding tempPaoding = createPaodingWithKnives(p);
View Full Code Here

Examples of org.apache.lucene.store.Lock.obtain()

      if (stale)
        throw new StaleReaderException("IndexReader out of date and no longer valid for delete, undelete, or setNorm operations");

      if (writeLock == null) {
        Lock writeLock = directory.makeLock(IndexWriter.WRITE_LOCK_NAME);
        if (!writeLock.obtain(IndexWriter.WRITE_LOCK_TIMEOUT)) // obtain write lock
          throw new LockObtainFailedException("Index locked for write: " + writeLock);
        this.writeLock = writeLock;

        // we have to check whether index has changed since this reader was opened.
        // if so, this reader is no longer valid for deletion
View Full Code Here

Examples of org.apache.lucene.store.Lock.obtain()

      if (stale)
        throw new StaleReaderException("IndexReader out of date and no longer valid for delete, undelete, or setNorm operations");

      if (writeLock == null) {
        Lock writeLock = directory.makeLock(IndexWriter.WRITE_LOCK_NAME);
        if (!writeLock.obtain(IndexWriterConfig.WRITE_LOCK_TIMEOUT)) // obtain write lock
          throw new LockObtainFailedException("Index locked for write: " + writeLock);
        this.writeLock = writeLock;

        // we have to check whether index has changed since this reader was opened.
        // if so, this reader is no longer valid for
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.