Examples of lock()


Examples of org.jbpm.examples.doorjava.Door.lock()

  }

  public void testOpenedLock() {
    Door door = new Door();
    door.state = Door.OPEN;
    door.lock();
    assertSame(Door.OPEN_LOCKED, door.state);
  }

  public void testOpenedClose() {
    Door door = new Door();
View Full Code Here

Examples of org.jbpm.graph.exe.Token.lock()

      // execute the action
      log.debug("executing " + action);
      String lockOwnerId = "token[" + token.getId() + "]";
      try {
        if (actionMustBeLocked) {
          token.lock(lockOwnerId);
        }

        if (UserCodeInterceptorConfig.userCodeInterceptor != null) {
          UserCodeInterceptorConfig.userCodeInterceptor.executeAction(action, executionContext);
        } else {
View Full Code Here

Examples of org.jitterbit.integration.client.runtime.lock.ApplicationInstanceLock.lock()

        LOGGER.info(log.toString());
    }

    private static boolean testApplicationLock(String[] args) {
        ApplicationInstanceLock lock = ApplicationInstanceLockFactory.getLock(appContext, appDirLocation);
        return lock.lock(args);
    }

    /**
     * Method that can be used to make sure that the necessary background preparations, started when
     * the ClientPlatform was initialized, has completed. If the background preparation has
View Full Code Here

Examples of org.jpox.ManagedConnection.lock()

            cf = getOMFContext().getConnectionFactoryRegistry().lookupConnectionFactory(nontxConnectionFactoryName);
        }
        mc = cf.getConnection(enlisted?om:null, null); // Will throw exception if already locked

        // Lock the connection now that it is in use by the user
        mc.lock();

        return new JDOConnectionImpl(mc.getConnection(), new Runnable()
        {
            public void run()
            {
View Full Code Here

Examples of org.jruby.util.io.OpenFile.lock()

        Ruby runtime = context.runtime;
        OpenFile fptr;

        fptr = getOpenFileChecked();

        boolean locked = fptr.lock();
        try {
            fptr.checkCharReadable(context);

            if (fptr.READ_CHAR_PENDING()) return runtime.getFalse();
            if (fptr.READ_DATA_PENDING()) return runtime.getFalse();
View Full Code Here

Examples of org.kiji.schema.util.Lock.lock()

   */
  public void update() throws IOException, KeeperException {
    final KijiMetaTable metaTable = mKiji.getMetaTable();

    final Lock lock = ZooKeeperUtils.newTableLayoutLock(mZKClient, mTableURI);
    lock.lock();
    try {
      final NavigableMap<Long, KijiTableLayout> layoutMap =
          metaTable.getTimedTableLayoutVersions(mTableURI.getTable(), Integer.MAX_VALUE);

      final KijiTableLayout currentLayout = layoutMap.lastEntry().getValue();
View Full Code Here

Examples of org.lealone.dbobject.table.Table.lock()

        }
    }

    private boolean existsRow(Session session, Index searchIndex, SearchRow check, Row excluding) {
        Table searchTable = searchIndex.getTable();
        searchTable.lock(session, false, false);
        Cursor cursor = searchIndex.find(session, check, check);
        while (cursor.next()) {
            SearchRow found;
            found = cursor.getSearchRow();
            if (excluding != null && found.getKey() == excluding.getKey()) {
View Full Code Here

Examples of org.locationtech.udig.project.internal.impl.SynchronizedEList.lock()

                if (parent instanceof Map) {
                    Map map = (Map) parent;
                    boolean found = false;
                    SynchronizedEList adapters = (SynchronizedEList) map.getContextModel()
                            .eAdapters();
                    adapters.lock();
                    try {
                        for( Iterator<Adapter> iter = adapters.iterator(); iter.hasNext(); ) {
                            Adapter next = iter.next();
                            if (next instanceof ContextModelItemProvider
                                    && ((ContextModelItemProvider) next).getAdapterFactory() == getAdapterFactory())
View Full Code Here

Examples of org.locationtech.udig.tools.edit.support.TestHandler.lock()

        ran[2] = false;

        assertFalse(handler.isLockOwner(locker));
        assertFalse(handler.isLockOwner(object));

        handler.lock(locker);
       
        locked[0]=true;
        assertTrue(handler.isLocked());
        assertTrue(handler.isLockOwner(locker));
        assertFalse(handler.isLockOwner(object));
View Full Code Here

Examples of org.menagerie.locks.ReentrantZkLock.lock()

        segmentMask = ssize - 1;
        this.segments = ZkSegment.newArray(ssize);

        //need to build the map in a single, synchronized activity across all members
        Lock mapLock = new ReentrantZkLock(mapNode,zkSessionManager,privileges);
        mapLock.lock();
        try{
            //need to read the data out of zookeeper
            ZooKeeper zk = zkSessionManager.getZooKeeper();
            for(int i=0;i< segments.length;i++){
                try {
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.