public class DefaultOutputConnection extends Object implements OutputConnection
| Constructor and Description |
|---|
DefaultOutputConnection(org.vertx.java.core.Vertx vertx,
OutputConnectionContext context) |
DefaultOutputConnection(org.vertx.java.core.Vertx vertx,
String address) |
| Modifier and Type | Method and Description |
|---|---|
String |
address()
Returns the connection address.
|
OutputConnection |
batch(String id,
Object args,
org.vertx.java.core.Handler<ConnectionOutputBatch> handler)
Creates an output batch on the connection.
|
void |
close()
Closes the stream.
|
void |
close(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Closes the stream.
|
OutputConnection |
drainHandler(org.vertx.java.core.Handler<Void> handler)
Sets a drain handler on the output.
|
int |
getSendQueueMaxSize()
Returns the send queue max size.
|
OutputConnection |
group(org.vertx.java.core.Handler<OutputGroup> handler)
Creates a uniquely named output group.
|
OutputConnection |
group(String name,
org.vertx.java.core.Handler<OutputGroup> handler)
Creates a named output group.
|
OutputConnection |
group(String name,
Object args,
org.vertx.java.core.Handler<OutputGroup> handler)
Creates a named output group.
|
OutputConnection |
open()
Opens the stream.
|
OutputConnection |
open(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Opens the stream.
|
OutputConnection |
send(Boolean message)
Sends a message on the output.
|
OutputConnection |
send(org.vertx.java.core.buffer.Buffer message)
Sends a message on the output.
|
OutputConnection |
send(Byte message)
Sends a message on the output.
|
OutputConnection |
send(byte[] message)
Sends a message on the output.
|
OutputConnection |
send(Character message)
Sends a message on the output.
|
OutputConnection |
send(Double message)
Sends a message on the output.
|
OutputConnection |
send(Float message)
Sends a message on the output.
|
OutputConnection |
send(Integer message)
Sends a message on the output.
|
OutputConnection |
send(org.vertx.java.core.json.JsonArray message)
Sends a message on the output.
|
OutputConnection |
send(org.vertx.java.core.json.JsonObject message)
Sends a message on the output.
|
OutputConnection |
send(Long message)
Sends a message on the output.
|
OutputConnection |
send(Object message)
Sends a message on the output.
|
OutputConnection |
send(Short message)
Sends a message on the output.
|
OutputConnection |
send(String message)
Sends a message on the output.
|
boolean |
sendQueueFull()
Returns a boolean indicating whether the send queue is full.
|
OutputConnection |
setSendQueueMaxSize(int maxSize)
Sets the send queue max size.
|
int |
size()
Returns the current connection size.
|
org.vertx.java.core.Vertx |
vertx()
Returns the output's Vertx instance.
|
public DefaultOutputConnection(org.vertx.java.core.Vertx vertx,
String address)
public DefaultOutputConnection(org.vertx.java.core.Vertx vertx,
OutputConnectionContext context)
public String address()
Connectionaddress in interface Connection<OutputConnection>public org.vertx.java.core.Vertx vertx()
Outputvertx in interface Output<OutputConnection>public OutputConnection open()
Openableopen in interface Openable<OutputConnection>public OutputConnection open(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Openableopen in interface Openable<OutputConnection>doneHandler - An asynchronous handler to be called once complete.public OutputConnection setSendQueueMaxSize(int maxSize)
OutputsetSendQueueMaxSize in interface Output<OutputConnection>maxSize - The send queue max size.public int getSendQueueMaxSize()
OutputgetSendQueueMaxSize in interface Output<OutputConnection>public int size()
Connectionsize in interface Connection<OutputConnection>size in interface Output<OutputConnection>public boolean sendQueueFull()
OutputsendQueueFull in interface Output<OutputConnection>public OutputConnection drainHandler(org.vertx.java.core.Handler<Void> handler)
OutputWhen the output's send queue becomes full, the output will be temporarily paused while its output queue is empty. Once the queue size decreases back to 50% of the maximum queue size the drain handler will be called so that normal operation can resume.
drainHandler in interface Output<OutputConnection>handler - A handler to be called when the stream is prepared to accept
new messages.public OutputConnection batch(String id, Object args, org.vertx.java.core.Handler<ConnectionOutputBatch> handler)
OutputConnectionbatch in interface OutputConnectionid - The unique batch ID.args - Arguments to the batch's start handler.handler - A handler to be called once the batch is started.public OutputConnection group(org.vertx.java.core.Handler<OutputGroup> handler)
OutputGroupSupportMessages sent through groups will always be sent to the same connection(s). Groups can also be nested.
group in interface OutputGroupSupport<OutputConnection>handler - A handler to be called once the group has been setup.public OutputConnection group(String name, org.vertx.java.core.Handler<OutputGroup> handler)
OutputGroupSupportMessages sent through groups will always be sent to the same connection(s). Groups can also be nested.
group in interface OutputGroupSupport<OutputConnection>name - The output group name.handler - A handler to be called once the group has been setup.public OutputConnection group(String name, Object args, org.vertx.java.core.Handler<OutputGroup> handler)
OutputGroupSupportMessages sent through groups will always be sent to the same connection(s). Groups can also be nested.
group in interface OutputGroupSupport<OutputConnection>name - The output group name.args - Arguments to the group's start handler.handler - A handler to be called once the group has been setup.public void close()
Closeableclose in interface AutoCloseableclose in interface Closeable<OutputConnection>public void close(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Closeableclose in interface Closeable<OutputConnection>doneHandler - An asynchronous handler to be called once complete.public OutputConnection send(Object message)
Outputsend in interface Output<OutputConnection>message - The message to send.public OutputConnection send(String message)
Outputsend in interface Output<OutputConnection>message - The message to send.public OutputConnection send(Boolean message)
Outputsend in interface Output<OutputConnection>message - The message to send.public OutputConnection send(Character message)
Outputsend in interface Output<OutputConnection>message - The message to send.public OutputConnection send(Short message)
Outputsend in interface Output<OutputConnection>message - The message to send.public OutputConnection send(Integer message)
Outputsend in interface Output<OutputConnection>message - The message to send.public OutputConnection send(Long message)
Outputsend in interface Output<OutputConnection>message - The message to send.public OutputConnection send(Double message)
Outputsend in interface Output<OutputConnection>message - The message to send.public OutputConnection send(Float message)
Outputsend in interface Output<OutputConnection>message - The message to send.public OutputConnection send(org.vertx.java.core.json.JsonObject message)
Outputsend in interface Output<OutputConnection>message - The message to send.public OutputConnection send(org.vertx.java.core.json.JsonArray message)
Outputsend in interface Output<OutputConnection>message - The message to send.public OutputConnection send(Byte message)
Outputsend in interface Output<OutputConnection>message - The message to send.public OutputConnection send(byte[] message)
Outputsend in interface Output<OutputConnection>message - The message to send.public OutputConnection send(org.vertx.java.core.buffer.Buffer message)
Outputsend in interface Output<OutputConnection>message - The message to send.Copyright © 2013-2014. All Rights Reserved.