public class DefaultOutputPort extends Object implements OutputPort, Observer<OutputPortContext>
| Constructor and Description |
|---|
DefaultOutputPort(org.vertx.java.core.Vertx vertx,
OutputPortContext context) |
| Modifier and Type | Method and Description |
|---|---|
OutputPort |
batch(org.vertx.java.core.Handler<OutputBatch> handler)
Creates a new batch.
|
OutputPort |
batch(Object args,
org.vertx.java.core.Handler<OutputBatch> handler)
Creates a new output batch.
|
OutputPort |
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.
|
OutputPort |
drainHandler(org.vertx.java.core.Handler<Void> handler)
Sets a drain handler on the output.
|
int |
getSendQueueMaxSize()
Returns the send queue max size.
|
OutputPort |
group(org.vertx.java.core.Handler<OutputGroup> handler)
Creates a uniquely named output group.
|
OutputPort |
group(String name,
org.vertx.java.core.Handler<OutputGroup> handler)
Creates a named output group.
|
OutputPort |
group(String name,
Object args,
org.vertx.java.core.Handler<OutputGroup> handler)
Creates a named output group.
|
String |
name()
Returns the port name.
|
OutputPort |
open()
Opens the stream.
|
OutputPort |
open(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Opens the stream.
|
OutputPort |
send(Boolean message)
Sends a message on the output.
|
OutputPort |
send(org.vertx.java.core.buffer.Buffer message)
Sends a message on the output.
|
OutputPort |
send(Byte message)
Sends a message on the output.
|
OutputPort |
send(byte[] message)
Sends a message on the output.
|
OutputPort |
send(Character message)
Sends a message on the output.
|
OutputPort |
send(Double message)
Sends a message on the output.
|
OutputPort |
send(Float message)
Sends a message on the output.
|
OutputPort |
send(Integer message)
Sends a message on the output.
|
OutputPort |
send(org.vertx.java.core.json.JsonArray message)
Sends a message on the output.
|
OutputPort |
send(org.vertx.java.core.json.JsonObject message)
Sends a message on the output.
|
OutputPort |
send(Long message)
Sends a message on the output.
|
OutputPort |
send(Object message)
Sends a message on the output.
|
OutputPort |
send(Short message)
Sends a message on the output.
|
OutputPort |
send(String message)
Sends a message on the output.
|
boolean |
sendQueueFull()
Returns a boolean indicating whether the send queue is full.
|
OutputPort |
setSendQueueMaxSize(int maxSize)
Sets the send queue max size.
|
int |
size()
Returns the current connection send queue size.
|
void |
update(OutputPortContext update)
Notifies the observer of an update.
|
org.vertx.java.core.Vertx |
vertx()
Returns the output's Vertx instance.
|
public DefaultOutputPort(org.vertx.java.core.Vertx vertx,
OutputPortContext context)
public String name()
Portname in interface Port<OutputPort>public org.vertx.java.core.Vertx vertx()
Outputvertx in interface Output<OutputPort>public void update(OutputPortContext update)
Observerupdate in interface Observer<OutputPortContext>update - The updated object.public OutputPort setSendQueueMaxSize(int maxSize)
OutputsetSendQueueMaxSize in interface Output<OutputPort>maxSize - The send queue max size.public int getSendQueueMaxSize()
OutputgetSendQueueMaxSize in interface Output<OutputPort>public int size()
Outputsize in interface Output<OutputPort>public boolean sendQueueFull()
OutputsendQueueFull in interface Output<OutputPort>public OutputPort 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<OutputPort>handler - A handler to be called when the stream is prepared to accept
new messages.public OutputPort open()
Openableopen in interface Openable<OutputPort>public OutputPort open(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Openableopen in interface Openable<OutputPort>doneHandler - An asynchronous handler to be called once complete.public void close()
Closeableclose in interface AutoCloseableclose in interface Closeable<OutputPort>public void close(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Closeableclose in interface Closeable<OutputPort>doneHandler - An asynchronous handler to be called once complete.public OutputPort batch(org.vertx.java.core.Handler<OutputBatch> handler)
OutputPortbatch in interface OutputBatchSupport<OutputPort>batch in interface OutputPorthandler - A handler to be called when the batch is created.public OutputPort batch(Object args, org.vertx.java.core.Handler<OutputBatch> handler)
OutputBatchSupportbatch in interface OutputBatchSupport<OutputPort>args - Arguments to the batch's start handler.handler - A handler to be called once the batch has been created.public OutputPort batch(String id, Object args, org.vertx.java.core.Handler<OutputBatch> handler)
OutputBatchSupportbatch in interface OutputBatchSupport<OutputPort>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 OutputPort 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<OutputPort>handler - A handler to be called once the group has been setup.public OutputPort 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<OutputPort>name - The output group name.handler - A handler to be called once the group has been setup.public OutputPort 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<OutputPort>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 OutputPort send(Object message)
Outputsend in interface Output<OutputPort>message - The message to send.public OutputPort send(String message)
Outputsend in interface Output<OutputPort>message - The message to send.public OutputPort send(Boolean message)
Outputsend in interface Output<OutputPort>message - The message to send.public OutputPort send(Character message)
Outputsend in interface Output<OutputPort>message - The message to send.public OutputPort send(Short message)
Outputsend in interface Output<OutputPort>message - The message to send.public OutputPort send(Integer message)
Outputsend in interface Output<OutputPort>message - The message to send.public OutputPort send(Long message)
Outputsend in interface Output<OutputPort>message - The message to send.public OutputPort send(Double message)
Outputsend in interface Output<OutputPort>message - The message to send.public OutputPort send(Float message)
Outputsend in interface Output<OutputPort>message - The message to send.public OutputPort send(org.vertx.java.core.json.JsonObject message)
Outputsend in interface Output<OutputPort>message - The message to send.public OutputPort send(org.vertx.java.core.json.JsonArray message)
Outputsend in interface Output<OutputPort>message - The message to send.public OutputPort send(Byte message)
Outputsend in interface Output<OutputPort>message - The message to send.public OutputPort send(byte[] message)
Outputsend in interface Output<OutputPort>message - The message to send.public OutputPort send(org.vertx.java.core.buffer.Buffer message)
Outputsend in interface Output<OutputPort>message - The message to send.Copyright © 2013-2014. All Rights Reserved.