public class HmtpWebSocketWriter extends AbstractBroker
Constructor and Description |
---|
HmtpWebSocketWriter(java.io.OutputStream os) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the Broker
|
void |
flush() |
java.lang.String |
getAddress()
The address of the stream
|
boolean |
isClosed()
Returns true if the broker has been closed
|
void |
message(java.lang.String to,
java.lang.String from,
java.io.Serializable payload)
Sends a message to a given address
|
void |
messageError(java.lang.String to,
java.lang.String from,
java.io.Serializable payload,
BamError error)
Sends a message error to a given address
|
void |
query(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable payload)
Sends a queryGet to a given address
|
void |
queryError(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable payload,
BamError error)
Sends a query error to a given address
|
void |
queryResult(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable payload)
Sends a queryResult to a given address
|
void |
setAddress(java.lang.String address)
The address of the stream
|
void |
setAutoFlush(boolean isFlush) |
addMailbox, getBroker, getBrokerMailbox, getMailbox, getQueueFullHandler, removeMailbox, setQueueFullHandler
getQueryErrorStream, toString
public HmtpWebSocketWriter(java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public java.lang.String getAddress()
getAddress
in interface MessageStream
getAddress
in class AbstractBroker
public void setAddress(java.lang.String address)
public void setAutoFlush(boolean isFlush)
public void message(java.lang.String to, java.lang.String from, java.io.Serializable payload)
message
in interface MessageStream
message
in class AbstractBrokerStream
to
- the address of the target actorfrom
- the address of the source actorpayload
- the message payloadpublic void messageError(java.lang.String to, java.lang.String from, java.io.Serializable payload, BamError error)
messageError
in interface MessageStream
messageError
in class AbstractBrokerStream
to
- the address of the target actorfrom
- the address of the source actorpayload
- the message payloaderror
- the message errorpublic void query(long id, java.lang.String to, java.lang.String from, java.io.Serializable payload)
query
in interface MessageStream
query
in class AbstractBrokerStream
id
- the query idto
- the address of the target actorfrom
- the address of the source actorpayload
- the message payloadpublic void queryResult(long id, java.lang.String to, java.lang.String from, java.io.Serializable payload)
queryResult
in interface MessageStream
queryResult
in class AbstractBrokerStream
id
- the query idto
- the address of the target actorfrom
- the address of the source actorpayload
- the message payloadpublic void queryError(long id, java.lang.String to, java.lang.String from, java.io.Serializable payload, BamError error)
queryError
in interface MessageStream
queryError
in class AbstractBrokerStream
id
- the query identifierto
- the address of the target actorfrom
- the address of the source actorpayload
- the message payloaderror
- the message errorpublic boolean isClosed()
AbstractBroker
isClosed
in interface MessageStream
isClosed
in class AbstractBroker
public void flush()
public void close()
Broker
close
in interface Broker
close
in class AbstractBroker