public class DefaultOutputStream extends Object implements OutputStream
| Constructor and Description |
|---|
DefaultOutputStream(org.vertx.java.core.Vertx vertx,
OutputStreamContext context) |
| Modifier and Type | Method and Description |
|---|---|
String |
address()
Returns the output stream address.
|
void |
close()
Closes the stream.
|
void |
close(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Closes the stream.
|
OutputStream |
drainHandler(org.vertx.java.core.Handler<Void> handler)
Sets a drain handler on the output.
|
int |
getSendQueueMaxSize()
Returns the send queue max size.
|
OutputStream |
group(String name,
org.vertx.java.core.Handler<OutputGroup> handler)
Creates a named output group.
|
OutputStream |
open()
Opens the stream.
|
OutputStream |
open(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Opens the stream.
|
OutputStream |
send(Boolean message)
Sends a message on the output.
|
OutputStream |
send(org.vertx.java.core.buffer.Buffer message)
Sends a message on the output.
|
OutputStream |
send(Byte message)
Sends a message on the output.
|
OutputStream |
send(byte[] message)
Sends a message on the output.
|
OutputStream |
send(Character message)
Sends a message on the output.
|
OutputStream |
send(Double message)
Sends a message on the output.
|
OutputStream |
send(Float message)
Sends a message on the output.
|
OutputStream |
send(Integer message)
Sends a message on the output.
|
OutputStream |
send(org.vertx.java.core.json.JsonArray message)
Sends a message on the output.
|
OutputStream |
send(org.vertx.java.core.json.JsonObject message)
Sends a message on the output.
|
OutputStream |
send(Long message)
Sends a message on the output.
|
OutputStream |
send(Object message)
Sends a message on the output.
|
OutputStream |
send(Short message)
Sends a message on the output.
|
OutputStream |
send(String message)
Sends a message on the output.
|
boolean |
sendQueueFull()
Returns a boolean indicating whether the send queue is full.
|
OutputStream |
setSendQueueMaxSize(int maxSize)
Sets the send queue max size.
|
int |
size()
Returns the current connection send queue size.
|
org.vertx.java.core.Vertx |
vertx()
Returns the output's Vertx instance.
|
public DefaultOutputStream(org.vertx.java.core.Vertx vertx,
OutputStreamContext context)
public org.vertx.java.core.Vertx vertx()
Outputvertx in interface Output<OutputStream>public String address()
OutputStreamaddress in interface OutputStreampublic OutputStream open()
Openableopen in interface Openable<OutputStream>public OutputStream open(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Openableopen in interface Openable<OutputStream>doneHandler - An asynchronous handler to be called once complete.public OutputStream setSendQueueMaxSize(int maxSize)
OutputsetSendQueueMaxSize in interface Output<OutputStream>maxSize - The send queue max size.public int getSendQueueMaxSize()
OutputgetSendQueueMaxSize in interface Output<OutputStream>public int size()
Outputsize in interface Output<OutputStream>public boolean sendQueueFull()
OutputsendQueueFull in interface Output<OutputStream>public OutputStream 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<OutputStream>handler - A handler to be called when the stream is prepared to accept
new messages.public OutputStream group(String name, org.vertx.java.core.Handler<OutputGroup> handler)
OutputWhen creating an output group, the output will synchronize with any inputs to which it is connected prior to calling the group handler. This means that once the group handler has been called, messages sent to the group will be immediately sent to any output connections rather than queueing messages.
group in interface Output<OutputStream>name - The output group name.handler - A handler to be called once the output group is created.public OutputStream send(Object message)
Outputsend in interface Output<OutputStream>message - The message to send.public OutputStream send(String message)
Outputsend in interface Output<OutputStream>message - The message to send.public OutputStream send(Boolean message)
Outputsend in interface Output<OutputStream>message - The message to send.public OutputStream send(Character message)
Outputsend in interface Output<OutputStream>message - The message to send.public OutputStream send(Short message)
Outputsend in interface Output<OutputStream>message - The message to send.public OutputStream send(Integer message)
Outputsend in interface Output<OutputStream>message - The message to send.public OutputStream send(Long message)
Outputsend in interface Output<OutputStream>message - The message to send.public OutputStream send(Double message)
Outputsend in interface Output<OutputStream>message - The message to send.public OutputStream send(Float message)
Outputsend in interface Output<OutputStream>message - The message to send.public OutputStream send(org.vertx.java.core.buffer.Buffer message)
Outputsend in interface Output<OutputStream>message - The message to send.public OutputStream send(org.vertx.java.core.json.JsonObject message)
Outputsend in interface Output<OutputStream>message - The message to send.public OutputStream send(org.vertx.java.core.json.JsonArray message)
Outputsend in interface Output<OutputStream>message - The message to send.public OutputStream send(Byte message)
Outputsend in interface Output<OutputStream>message - The message to send.public OutputStream send(byte[] message)
Outputsend in interface Output<OutputStream>message - The message to send.public void close()
Closeableclose in interface Closeable<OutputStream>public void close(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Closeableclose in interface Closeable<OutputStream>doneHandler - An asynchronous handler to be called once complete.Copyright © 2013-2014. All Rights Reserved.