Class: VertxServiceDiscovery::ServiceExporter

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_exporter.rb

Overview

The service exporter allows integrate other discovery technologies with the Vert.x service discovery. It maps entries from another technology to a and maps to a publication in this other technology. The exporter is one side of a service discovery bridge.

Instance Method Summary (collapse)

Instance Method Details

- (void) close { ... }

This method returns an undefined value.

Close the exporter

Yields:

  • the handle to be notified when exporter is closed

Raises:

  • (ArgumentError)


50
51
52
53
54
55
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_exporter.rb', line 50

def close
  if block_given?
    return @j_del.java_method(:close, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield })
  end
  raise ArgumentError, "Invalid arguments when calling close()"
end

- (void) on_publish(record = nil)

This method returns an undefined value.

Notify a new record has been published, the record's registration can be used to uniquely identify the record

Parameters:

  • record (Hash) (defaults to: nil)
    the record

Raises:

  • (ArgumentError)


22
23
24
25
26
27
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_exporter.rb', line 22

def on_publish(record=nil)
  if record.class == Hash && !block_given?
    return @j_del.java_method(:onPublish, [Java::IoVertxServicediscovery::Record.java_class]).call(Java::IoVertxServicediscovery::Record.new(::Vertx::Util::Utils.to_json_object(record)))
  end
  raise ArgumentError, "Invalid arguments when calling on_publish(record)"
end

- (void) on_unpublish(id = nil)

This method returns an undefined value.

Notify an existing record has been removed

Parameters:

  • id (String) (defaults to: nil)
    the record registration id

Raises:

  • (ArgumentError)


41
42
43
44
45
46
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_exporter.rb', line 41

def on_unpublish(id=nil)
  if id.class == String && !block_given?
    return @j_del.java_method(:onUnpublish, [Java::java.lang.String.java_class]).call(id)
  end
  raise ArgumentError, "Invalid arguments when calling on_unpublish(id)"
end

- (void) on_update(record = nil)

This method returns an undefined value.

Notify an existing record has been updated, the record's registration can be used to uniquely identify the record

Parameters:

  • record (Hash) (defaults to: nil)
    the record

Raises:

  • (ArgumentError)


32
33
34
35
36
37
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_exporter.rb', line 32

def on_update(record=nil)
  if record.class == Hash && !block_given?
    return @j_del.java_method(:onUpdate, [Java::IoVertxServicediscovery::Record.java_class]).call(Java::IoVertxServicediscovery::Record.new(::Vertx::Util::Utils.to_json_object(record)))
  end
  raise ArgumentError, "Invalid arguments when calling on_update(record)"
end