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.
|
OutputStream |
batch(org.vertx.java.core.Handler<OutputBatch> handler)
Creates a new output batch with a random identifier.
|
OutputStream |
batch(Object args,
org.vertx.java.core.Handler<OutputBatch> handler)
Creates a new output batch.
|
OutputStream |
batch(String id,
Object args,
org.vertx.java.core.Handler<OutputBatch> handler)
Creates a new output batch.
|
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(org.vertx.java.core.Handler<OutputGroup> handler)
Creates a uniquely named output group.
|
OutputStream |
group(String name,
org.vertx.java.core.Handler<OutputGroup> handler)
Creates a named output group.
|
OutputStream |
group(String name,
Object args,
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 batch(org.vertx.java.core.Handler<OutputBatch> handler)
OutputBatchSupportbatch in interface OutputBatchSupport<OutputStream>handler - A handler to be called once the batch has been created.public OutputStream batch(Object args, org.vertx.java.core.Handler<OutputBatch> handler)
OutputBatchSupportbatch in interface OutputBatchSupport<OutputStream>args - Arguments to the batch's start handler.handler - A handler to be called once the batch has been created.public OutputStream batch(String id, Object args, org.vertx.java.core.Handler<OutputBatch> handler)
OutputBatchSupportbatch in interface OutputBatchSupport<OutputStream>id - The unique batch identifier.args - Arguments to the batch's start handler.handler - A handler to be called once the batch has been created.public OutputStream 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<OutputStream>handler - A handler to be called once the group has been setup.public OutputStream 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<OutputStream>name - The output group name.handler - A handler to be called once the group has been setup.public OutputStream 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<OutputStream>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 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.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 OutputStream send(org.vertx.java.core.buffer.Buffer message)
Outputsend in interface Output<OutputStream>message - The message to send.public void close()
Closeableclose in interface AutoCloseableclose 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.