public interface Messenger
Modifier and Type | Interface and Description |
---|---|
static class |
Messenger.Factory |
Modifier and Type | Field and Description |
---|---|
static int |
CUMULATIVE
Flag for use with reject(), accept() and settle() methods.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(Tracker tracker,
int flags)
Accepts messages retrieved from the incoming message queue.
|
Message |
get()
Returns the message from the head of the incoming message
queue.
|
String |
getCertificate()
Get the path to the certificate file.
|
int |
getIncomingWindow() |
int |
getOutgoingWindow() |
String |
getPassword()
Get the password for the priate key file.
|
String |
getPrivateKey()
Get the path to the private key file.
|
Status |
getStatus(Tracker tracker)
Gets the last known remote state of the delivery associated
with the given tracker.
|
long |
getTimeout() |
String |
getTrustedCertificates()
Get the path to the trusted certificate database.
|
int |
incoming()
Returns a count of the messages available on the incoming
queue.
|
Tracker |
incomingTracker()
Returns a token which can be used to accept or reject the
message returned in the previous get() call.
|
void |
interrupt() |
boolean |
isBlocking() |
int |
outgoing()
Returns a count of the messages currently on the outgoing queue
(i.e.
|
Tracker |
outgoingTracker()
Returns a token which can be used to track the status of the
message of the previous put() call.
|
void |
put(Message message)
Places the content contained in the message onto the outgoing
queue of the Messenger.
|
int |
receiving()
Returns the capacity of the incoming message queue of
messenger.
|
void |
recv()
Receives an arbitrary number of messages into the
incoming queue of the Messenger.
|
void |
recv(int count)
Receives up to the specified number of messages into the
incoming queue of the Messenger.
|
void |
reject(Tracker tracker,
int flags)
Rejects messages retrieved from the incoming message queue.
|
void |
rewrite(String pattern,
String address) |
void |
route(String pattern,
String address) |
void |
send()
Blocks until the outgoing queue is empty and, in the event that
an outgoing window has been set, until the messages in that
window have been received by the target to which they were
sent, or the operation times out.
|
void |
send(int n) |
void |
setBlocking(boolean b) |
void |
setCertificate(String certificate)
Set the path to the certificate file.
|
void |
setIncomingWindow(int window) |
void |
setOutgoingWindow(int window) |
void |
setPassword(String password)
Set the password for private key file.
|
void |
setPrivateKey(String privateKey)
Set the path to private key file.
|
void |
setTimeout(long timeInMillis) |
void |
settle(Tracker tracker,
int flags) |
void |
setTrustedCertificates(String trusted)
Set the path to the trusted certificate database.
|
void |
start()
Transitions the Messenger to an active state.
|
void |
stop()
Transitions the Messenger to an inactive state.
|
boolean |
stopped() |
void |
subscribe(String source)
Subscribes the Messenger to messages originating from the
specified source.
|
boolean |
work(long timeout)
Sends or receives any outstanding messages queued for a
messenger.
|
static final int CUMULATIVE
void put(Message message) throws MessengerException
MessengerException
void send() throws TimeoutException
TimeoutException
void send(int n) throws TimeoutException
TimeoutException
void subscribe(String source) throws MessengerException
MessengerException
void recv() throws TimeoutException
TimeoutException
void recv(int count) throws TimeoutException
TimeoutException
int receiving()
Message get()
void start() throws IOException
IOException
void stop()
boolean stopped()
boolean work(long timeout) throws TimeoutException
TimeoutException
void interrupt()
void setTimeout(long timeInMillis)
long getTimeout()
boolean isBlocking()
void setBlocking(boolean b)
int outgoing()
int incoming()
int getIncomingWindow()
void setIncomingWindow(int window)
int getOutgoingWindow()
void setOutgoingWindow(int window)
Tracker incomingTracker()
Tracker outgoingTracker()
void reject(Tracker tracker, int flags)
void accept(Tracker tracker, int flags)
void settle(Tracker tracker, int flags)
Status getStatus(Tracker tracker)
void setCertificate(String certificate)
String getCertificate()
void setPrivateKey(String privateKey)
String getPrivateKey()
void setPassword(String password)
String getPassword()
void setTrustedCertificates(String trusted)
String getTrustedCertificates()
Copyright © 2016 The Apache Software Foundation. All rights reserved.