Search in sources :

Example 1 with OnMappedMessage

use of com.generallycloud.baseio.container.jms.client.impl.OnMappedMessage in project baseio by generallycloud.

the class RTPClient method setRTPHandle.

public void setRTPHandle(final RTPHandle handle) throws RTPException {
    if (this.handle != null) {
        return;
    }
    this.consumer.listen("invite", new OnMappedMessage() {

        @Override
        public void onReceive(MapMessage message) {
            handle.onInvite(RTPClient.this, message);
        }
    });
    this.consumer.listen("invite-reply", new OnMappedMessage() {

        @Override
        public void onReceive(MapMessage message) {
            handle.onInviteReplyed(RTPClient.this, message);
        }
    });
    this.consumer.listen("break", new OnMappedMessage() {

        @Override
        public void onReceive(MapMessage message) {
            handle.onBreak(RTPClient.this, message);
        }
    });
    this.handle = handle;
    try {
        this.consumer.receive(null);
    } catch (MQException e) {
        throw new RTPException(e);
    }
}
Also used : MQException(com.generallycloud.baseio.container.jms.MQException) OnMappedMessage(com.generallycloud.baseio.container.jms.client.impl.OnMappedMessage) MapMessage(com.generallycloud.baseio.container.jms.MapMessage) RTPException(com.generallycloud.baseio.container.rtp.RTPException)

Aggregations

MQException (com.generallycloud.baseio.container.jms.MQException)1 MapMessage (com.generallycloud.baseio.container.jms.MapMessage)1 OnMappedMessage (com.generallycloud.baseio.container.jms.client.impl.OnMappedMessage)1 RTPException (com.generallycloud.baseio.container.rtp.RTPException)1