Class: VertxTcpEventbusBridge::TcpEventBusBridge
- Inherits:
-
Object
- Object
- VertxTcpEventbusBridge::TcpEventBusBridge
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-tcp-eventbus-bridge/tcp_event_bus_bridge.rb
Overview
TCP EventBus bridge for Vert.x
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary (collapse)
- + (Boolean) accept?(obj)
- + (::VertxTcpEventbusBridge::TcpEventBusBridge) create(vertx = nil, options = nil, netServerOptions = nil) { ... }
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)
Instance Method Summary (collapse)
-
- (void) close { ... }
Close the current socket.
-
- (self) listen(port = nil, address = nil) { ... }
Listen on specific port and bind to specific address.
Class Method Details
+ (Boolean) accept?(obj)
19 20 21 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-tcp-eventbus-bridge/tcp_event_bus_bridge.rb', line 19 def @@j_api_type.accept?(obj) obj.class == TcpEventBusBridge end |
+ (::VertxTcpEventbusBridge::TcpEventBusBridge) create(vertx = nil, options = nil, netServerOptions = nil) { ... }
39 40 41 42 43 44 45 46 47 48 49 50 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-tcp-eventbus-bridge/tcp_event_bus_bridge.rb', line 39 def self.create(vertx=nil,=nil,netServerOptions=nil) if vertx.class.method_defined?(:j_del) && !block_given? && == nil && netServerOptions == nil return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtEventbusBridgeTcp::TcpEventBusBridge.java_method(:create, [Java::IoVertxCore::Vertx.java_class]).call(vertx.j_del),::VertxTcpEventbusBridge::TcpEventBusBridge) elsif vertx.class.method_defined?(:j_del) && .class == Hash && !block_given? && netServerOptions == nil return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtEventbusBridgeTcp::TcpEventBusBridge.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtBridge::BridgeOptions.java_class]).call(vertx.j_del,Java::IoVertxExtBridge::BridgeOptions.new(::Vertx::Util::Utils.to_json_object())),::VertxTcpEventbusBridge::TcpEventBusBridge) elsif vertx.class.method_defined?(:j_del) && .class == Hash && netServerOptions.class == Hash && !block_given? return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtEventbusBridgeTcp::TcpEventBusBridge.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtBridge::BridgeOptions.java_class,Java::IoVertxCoreNet::NetServerOptions.java_class]).call(vertx.j_del,Java::IoVertxExtBridge::BridgeOptions.new(::Vertx::Util::Utils.to_json_object()),Java::IoVertxCoreNet::NetServerOptions.new(::Vertx::Util::Utils.to_json_object(netServerOptions))),::VertxTcpEventbusBridge::TcpEventBusBridge) elsif vertx.class.method_defined?(:j_del) && .class == Hash && netServerOptions.class == Hash && block_given? return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtEventbusBridgeTcp::TcpEventBusBridge.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtBridge::BridgeOptions.java_class,Java::IoVertxCoreNet::NetServerOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(vertx.j_del,Java::IoVertxExtBridge::BridgeOptions.new(::Vertx::Util::Utils.to_json_object()),Java::IoVertxCoreNet::NetServerOptions.new(::Vertx::Util::Utils.to_json_object(netServerOptions)),(Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxTcpEventbusBridge::BridgeEvent)) })),::VertxTcpEventbusBridge::TcpEventBusBridge) end raise ArgumentError, "Invalid arguments when calling create(#{vertx},#{},#{netServerOptions})" end |
+ (Object) j_api_type
28 29 30 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-tcp-eventbus-bridge/tcp_event_bus_bridge.rb', line 28 def self.j_api_type @@j_api_type end |
+ (Object) j_class
31 32 33 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-tcp-eventbus-bridge/tcp_event_bus_bridge.rb', line 31 def self.j_class Java::IoVertxExtEventbusBridgeTcp::TcpEventBusBridge.java_class end |
+ (Object) unwrap(obj)
25 26 27 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-tcp-eventbus-bridge/tcp_event_bus_bridge.rb', line 25 def @@j_api_type.unwrap(obj) obj.j_del end |
+ (Object) wrap(obj)
22 23 24 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-tcp-eventbus-bridge/tcp_event_bus_bridge.rb', line 22 def @@j_api_type.wrap(obj) TcpEventBusBridge.new(obj) end |
Instance Method Details
- (void) close { ... }
This method returns an undefined value.
Close the current socket.
81 82 83 84 85 86 87 88 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-tcp-eventbus-bridge/tcp_event_bus_bridge.rb', line 81 def close if !block_given? return @j_del.java_method(:close, []).call() elsif block_given? return @j_del.java_method(:close, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) })) end raise ArgumentError, "Invalid arguments when calling close()" end |
- (self) listen(port = nil, address = nil) { ... }
Listen on specific port and bind to specific address
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-tcp-eventbus-bridge/tcp_event_bus_bridge.rb', line 56 def listen(port=nil,address=nil) if !block_given? && port == nil && address == nil @j_del.java_method(:listen, []).call() return self elsif block_given? && port == nil && address == nil @j_del.java_method(:listen, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxTcpEventbusBridge::TcpEventBusBridge) : nil) })) return self elsif port.class == Fixnum && !block_given? && address == nil @j_del.java_method(:listen, [Java::int.java_class]).call(port) return self elsif port.class == Fixnum && address.class == String && !block_given? @j_del.java_method(:listen, [Java::int.java_class,Java::java.lang.String.java_class]).call(port,address) return self elsif port.class == Fixnum && block_given? && address == nil @j_del.java_method(:listen, [Java::int.java_class,Java::IoVertxCore::Handler.java_class]).call(port,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxTcpEventbusBridge::TcpEventBusBridge) : nil) })) return self elsif port.class == Fixnum && address.class == String && block_given? @j_del.java_method(:listen, [Java::int.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(port,address,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxTcpEventbusBridge::TcpEventBusBridge) : nil) })) return self end raise ArgumentError, "Invalid arguments when calling listen(#{port},#{address})" end |