|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.robokind.api.messaging.DefaultMessageSender<Msg,Rec>
org.robokind.impl.messaging.JMSAvroMessageSender<Msg,Rec>
Msg
- type of Message the sender acceptsRec
- type of Avro Record to be sentL
- type of listener to notify when sending a Messagepublic class JMSAvroMessageSender<Msg,Rec extends org.apache.avro.generic.IndexedRecord>
DefaultMessageSender for serializing Messages to Avro Records and sending them over JMS (Qpid).
Field Summary |
---|
Fields inherited from class org.robokind.api.messaging.DefaultMessageSender |
---|
myRecordSender |
Constructor Summary | |
---|---|
JMSAvroMessageSender(JMSBytesMessageSender sender)
Creates a new JMSAvroMessageSender using the given sender for sending Records. |
|
JMSAvroMessageSender(javax.jms.Session session,
javax.jms.Destination destination)
Creates a new JMSAvroMessageSender to send Records to the given destination using the given session. |
Method Summary | |
---|---|
void |
notifyListeners(Msg message)
|
void |
sendMessage(Msg message,
String contentType)
Adapts the given Message to an Avro Record and sends it via JMS with the given JMS header content type. |
void |
setDefaultContentType(String contentType)
|
void |
start()
Creates and opens a new JMSAvroRecordSender for sending the Avro Records. |
void |
stop()
Closes the JMSRecordReceiver. |
Methods inherited from class org.robokind.api.messaging.DefaultMessageSender |
---|
addListener, fireMessageEvent, getRecord, handleEvent, removeListener, setAdapter, setRecordSender |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JMSAvroMessageSender(javax.jms.Session session, javax.jms.Destination destination)
session
- JMS Session to use for sendingdestination
- JMS Destination to send topublic JMSAvroMessageSender(JMSBytesMessageSender sender)
sender
- used for sending AvroRecordsMethod Detail |
---|
public void start()
start
in interface org.robokind.api.messaging.MessageSender<Msg>
start
in class org.robokind.api.messaging.DefaultMessageSender<Msg,Rec extends org.apache.avro.generic.IndexedRecord>
public void stop()
stop
in interface org.robokind.api.messaging.MessageSender<Msg>
stop
in class org.robokind.api.messaging.DefaultMessageSender<Msg,Rec extends org.apache.avro.generic.IndexedRecord>
public void setDefaultContentType(String contentType)
public void notifyListeners(Msg message)
notifyListeners
in interface org.jflux.api.core.Notifier<Msg>
notifyListeners
in interface org.robokind.api.messaging.MessageSender<Msg>
notifyListeners
in class org.robokind.api.messaging.DefaultMessageSender<Msg,Rec extends org.apache.avro.generic.IndexedRecord>
public void sendMessage(Msg message, String contentType)
message
- Message to adapt and sendcontentType
- content type to set in the JMS message header
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |