Class List Method List File List

# Class: Vertx::Lock

Inherits:
  Object
  - Object
  - Vertx::Lock
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/lock.rb

## Overview

An asynchronous exclusive lock which can be obtained from any node in the cluster.

When the lock is obtained, no-one else in the cluster can obtain the lock with the same name until the lock is released.

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (void) release
  Release the lock.

## Class Method Details

### + (`Boolean`) accept?(obj)

Returns:

- (`Boolean`)

    20
    21
    22
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/lock.rb', line 20

    def @@j_api_type.accept?(obj)
      obj.class == Lock
    end

### + (`Object`) j_api_type

    29
    30
    31
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/lock.rb', line 29

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    32
    33
    34
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/lock.rb', line 32

    def self.j_class
      Java::IoVertxCoreShareddata::Lock.java_class
    end

### + (`Object`) unwrap(obj)

    26
    27
    28
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/lock.rb', line 26

    def @@j_api_type.unwrap(obj)
      obj.j_del
    end

### + (`Object`) wrap(obj)

    23
    24
    25
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/lock.rb', line 23

    def @@j_api_type.wrap(obj)
      Lock.new(obj)
    end

## Instance Method Details

### - (`void`) release

This method returns an undefined value.

Release the lock. Once the lock is released another will be able to obtain the lock.

Raises:

- (`ArgumentError`)

    37
    38
    39
    40
    41
    42
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/lock.rb', line 37

    def release
      if !block_given?
        return @j_del.java_method(:release, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling release()"
    end