Examples of acquireWriteLock()


Examples of com.espertech.esper.core.service.StatementAgentInstanceLock.acquireWriteLock()

    public EventBean[] execute(NamedWindowProcessorInstance instance) {
        EventBean event = insertHelper.process(new EventBean[0], true, true, exprEvaluatorContext);
        EventBean[] inserted = new EventBean[] {event};
        AgentInstanceContext ctx = instance.getTailViewInstance().getAgentInstanceContext();
        StatementAgentInstanceLock ailock = ctx.getAgentInstanceLock();
        ailock.acquireWriteLock(null);
        try {
            instance.getRootViewInstance().update(inserted, null);
        }
        catch (EPException ex) {
            instance.getRootViewInstance().update(null, inserted);
View Full Code Here

Examples of com.espertech.esper.core.service.StatementAgentInstanceLock.acquireWriteLock()

    public AgentInstanceArraySafeIterator(AgentInstance[] instances) {
        super(instances);
        for (int i = 0; i < instances.length; i++) {
            StatementAgentInstanceLock instanceLock = instances[i].getAgentInstanceContext().getEpStatementAgentInstanceHandle().getStatementAgentInstanceLock();
            instanceLock.acquireWriteLock(null);
        }
    }

    public void close() {
        for (int i = 0; i < instances.length; i++) {
View Full Code Here

Examples of com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.acquireWriteLock()

      final ONetworkProtocolBinary p = (ONetworkProtocolBinary) c.protocol;
      final OChannelBinary channel = (OChannelBinary) p.getChannel();

      try {
        channel.acquireWriteLock();
        try {
          channel.writeByte(OChannelBinaryProtocol.PUSH_DATA);
          channel.writeInt(Integer.MIN_VALUE);
          channel.writeByte(OChannelBinaryProtocol.REQUEST_PUSH_DISTRIB_CONFIG);
          channel.writeBytes(content);
View Full Code Here

Examples of org.apache.jackrabbit.core.state.DefaultISMLocking.acquireWriteLock()

*/
public class DefaultISMLockingDeadlockTest extends JUnitTest {

    public void test() throws InterruptedException {
        final ISMLocking lock = new DefaultISMLocking();
        WriteLock w1 = lock.acquireWriteLock(null);
        ReadLock r1 = w1.downgrade();
        final InterruptedException[] ex = new InterruptedException[1];
        Thread thread = new Thread() {
            public void run() {
                try {
View Full Code Here

Examples of org.apache.jackrabbit.core.state.DefaultISMLocking.acquireWriteLock()

        ReadLock r1 = w1.downgrade();
        final InterruptedException[] ex = new InterruptedException[1];
        Thread thread = new Thread() {
            public void run() {
                try {
                    lock.acquireWriteLock(null).release();
                } catch (InterruptedException e) {
                    ex[0] = e;
                }
            }
        };
View Full Code Here

Examples of org.apache.jackrabbit.core.state.ISMLocking.acquireWriteLock()

*/
public class DefaultISMLockingDeadlockTest extends JUnitTest {

    public void test() throws InterruptedException {
        final ISMLocking lock = new DefaultISMLocking();
        WriteLock w1 = lock.acquireWriteLock(null);
        ReadLock r1 = w1.downgrade();
        final InterruptedException[] ex = new InterruptedException[1];
        Thread thread = new Thread() {
            public void run() {
                try {
View Full Code Here

Examples of org.apache.jackrabbit.core.state.ISMLocking.acquireWriteLock()

        ReadLock r1 = w1.downgrade();
        final InterruptedException[] ex = new InterruptedException[1];
        Thread thread = new Thread() {
            public void run() {
                try {
                    lock.acquireWriteLock(null).release();
                } catch (InterruptedException e) {
                    ex[0] = e;
                }
            }
        };
View Full Code Here

Examples of org.neo4j.graphdb.Transaction.acquireWriteLock()

          addTableSequence( idSourceKey.getMetadata(), (String) idSourceKey.getColumnValues()[0], initialValue );
          sequence = getSequence( idSourceKey );
        }
      }

      lock = tx.acquireWriteLock( sequence );
      int nextValue = updateSequenceValue( idSourceKey, sequence, increment );
      tx.success();
      lock.release();
      return nextValue;
    }
View Full Code Here

Examples of org.neo4j.graphdb.Transaction.acquireWriteLock()

  private int sequence(RowKey rowKey, int increment, final int initialValue) {
    Transaction tx = neo4jDb.beginTx();
    Lock lock = null;
    try {
      Node sequence = getOrCreateSequence( rowKey, initialValue );
      lock = tx.acquireWriteLock( sequence );
      int nextValue = updateSequenceValue( sequenceName( rowKey ), sequence, increment );
      tx.success();
      lock.release();
      return nextValue;
    }
View Full Code Here

Examples of org.neo4j.graphdb.Transaction.acquireWriteLock()

  private int sequence(RowKey rowKey, int increment) {
    Transaction tx = neo4jDb.beginTx();
    Lock lock = null;
    try {
      Node sequence = getSequence( rowKey );
      lock = tx.acquireWriteLock( sequence );
      int nextValue = updateSequenceValue( sequence, increment );
      tx.success();
      lock.release();
      return nextValue;
    }
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.