Examples of acquire()


Examples of org.jboss.cache.lock.NodeLock.acquire()

   }

   private void acquireNodeLock(InvocationContext ctx, NodeSPI node, Object owner, GlobalTransaction gtx, NodeLock.LockType lockType, long lockTimeout) throws LockingException, TimeoutException, InterruptedException
   {
      NodeLock lock = node.getLock();
      boolean acquired = lock.acquire(owner, lockTimeout, lockType);
      if (acquired)
      {
         // Record the lock for release on method return or tx commit/rollback
         if (gtx != null)
         {
View Full Code Here

Examples of org.jboss.dna.graph.property.Binary.acquire()

                switch (type) {
                    case BINARY:
                        Binary binary = factories.getBinaryFactory().create(value);
                        InputStream stream = null;
                        try {
                            binary.acquire();
                            stream = binary.getStream();
                            if (compressData) stream = new GZIPInputStream(stream);
                            bytes = IoUtil.readBytes(stream);
                        } finally {
                            try {
View Full Code Here

Examples of org.jboss.security.plugins.auth.JaasSecurityManagerBase.DomainInfo.acquire()

         if (allowRefresh == true)
            cacheInfo = (DomainInfo) domainCache.get(principal);
         else
            cacheInfo = (DomainInfo) domainCache.peek(principal);
         if (cacheInfo != null)
            cacheInfo.acquire();
      }
      return cacheInfo;
   }

   private Subject updateCache(LoginContext lc, Subject subject, Principal principal, Object credential)
View Full Code Here

Examples of org.jitterbit.util.LockingFile.acquire()

    @Override
    public boolean lock(String[] args) {
        File file = new File(folder, FILE_NAME);
        LockingFile lock = new LockingFile(file);
        lock.setLogger(logger);
        return lock.acquire();
    }

}
View Full Code Here

Examples of org.jooq.ConnectionProvider.acquire()

    protected void loadForeignKeys(DefaultRelations relations) throws SQLException {
        ConnectionProvider provider = create().configuration().connectionProvider();
        Connection connection = null;

        try {
            connection = provider.acquire();
            DatabaseMetaData meta = connection.getMetaData();

            for (String table : create()
                    .selectDistinct(DB_INDEX.CLASS_NAME)
                    .from(DB_INDEX)
View Full Code Here

Examples of org.jooq.impl.DefaultConnectionProvider.acquire()

      return;
    }

    try {
      logger.debug("Closing JDBC connection");
      conn.acquire().close();
    } catch (SQLException e) {
      throw new RuntimeException(e);
    }
    threadFactory.remove();
    threadConnection.remove();
View Full Code Here

Examples of org.locationtech.udig.catalog.ICatalog.acquire()

            protected IStatus run(IProgressMonitor monitor) {
                ICatalog localCatalog = CatalogPlugin.getDefault().getLocalCatalog();
                URL url = new ID( file, null ).toURL();
                IService service = null;
                try {
                    service = localCatalog.acquire( url, monitor );
                }
                catch( IOException unepected ){
                }
                return service != null ? Status.OK_STATUS : new Status( IStatus.ERROR, ProjectUIPlugin.ID, "Failed to add "+file );
            }
View Full Code Here

Examples of org.locationtech.udig.catalog.IRepository.acquire()

        URL url = file.toURI().toURL();
       
        IProgressMonitor monitor = ProgressManager.instance().get();
       
        IRepository local = CatalogPlugin.getDefault().getLocal();
        IService service = local.acquire( url, monitor );       
    }
   
  /**
   * This is the "long" way to add an entry to the catalog.
   */
 
View Full Code Here

Examples of org.locationtech.udig.catalog.IServiceFactory.acquire()

            if (originalJGrassService == null)
                return;
            final URL ID = originalJGrassService.getIdentifier();
            Map<String, Serializable> connectionParams = originalJGrassService.getConnectionParams();
            IServiceFactory locator = CatalogPlugin.getDefault().getServiceFactory();
            final List<IService> rereadService = locator.acquire(ID, connectionParams);

            /*
             * replace the service
             */
            if (rereadService.size() > 0) {
View Full Code Here

Examples of org.menagerie.latches.spi.ZkSemaphore.acquire()

    @Test(timeout = 1000l)
    public void testAcquireSucceedsOneThread() throws Exception{
        int numPermits = 1;
        DistributedSemaphore semaphore = new ZkSemaphore(numPermits, basePath,zkSessionManager);

        semaphore.acquire();

        //check that the available permits are zero
        assertEquals("semaphore does not report fewer permits!",numPermits-1,semaphore.availablePermits());
        semaphore.release();
        assertEquals("semaphore does not report releasing a permit!",numPermits,semaphore.availablePermits());
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.