Example usage for javax.jms MapMessage setStringProperty

List of usage examples for javax.jms MapMessage setStringProperty

Introduction

In this page you can find the example usage for javax.jms MapMessage setStringProperty.

Prototype


void setStringProperty(String name, String value) throws JMSException;

Source Link

Document

Sets a String property value with the specified name into the message.

Usage

From source file:org.jwebsocket.plugins.system.SystemPlugIn.java

void notifySessionStarted(WebSocketConnector aConnector) {
    try {/* w w  w  .j  a va  2s  .  c o m*/
        // getting the message hub
        JMSManager lMessageHub = getServer().getJMSManager();

        // creating the event message to be sent
        MapMessage lMsg = lMessageHub.buildMessage(getNamespace(), "sessionStarted");
        lMsg.setStringProperty("connectorId", aConnector.getId());

        // sending event
        lMessageHub.send(lMsg);
    } catch (Exception lEx) {
        mLog.error(Logging.getSimpleExceptionMessage(lEx,
                "notifying 'sessionStarted' " + "event through the MessageHub"), lEx);
    }
}

From source file:org.jwebsocket.plugins.system.SystemPlugIn.java

void notifySessionStopped(WebSocketSession aSession) {
    try {/*from ww w.  ja v  a  2  s  .  c o  m*/
        // getting the message hub
        JMSManager lMessageHub = getServer().getJMSManager();

        // creating the event message to be sent
        MapMessage lMsg = lMessageHub.buildMessage(getNamespace(), "sessionStopped");
        lMsg.setStringProperty("username", aSession.getUsername());
        lMsg.setStringProperty("uuid", aSession.getUUID());
        lMsg.setBooleanProperty("authenticated", aSession.isAuthenticated());
        lMsg.setStringProperty("authorities", (String) aSession.getStorage().get(SystemPlugIn.AUTHORITIES));

        // sending event
        lMessageHub.send(lMsg);
    } catch (Exception lEx) {
        mLog.error(Logging.getSimpleExceptionMessage(lEx,
                "notifying 'sessionStopped' " + "event through the MessageHub"), lEx);
    }
}

From source file:org.jwebsocket.plugins.system.SystemPlugIn.java

void notifyConnectorStarted(WebSocketConnector aConnector) {
    try {/*from ww  w . j a va 2s .c o  m*/
        // getting the message hub
        JMSManager lMessageHub = getServer().getJMSManager();

        // creating the event message to be sent
        MapMessage lMsg = lMessageHub.buildMessage(getNamespace(), "connectorStarted");
        lMsg.setStringProperty("connectorId", aConnector.getId());

        // sending event
        lMessageHub.send(lMsg);
    } catch (Exception lEx) {
        mLog.error(Logging.getSimpleExceptionMessage(lEx,
                "notifying 'connectorStarted' " + "event through the MessageHub"), lEx);
    }
}

From source file:org.jwebsocket.plugins.system.SystemPlugIn.java

void notifyConnectorStopped(WebSocketConnector aConnector) {
    try {// w  w w. j ava2s  .c o m
        // getting the message hub
        JMSManager lMessageHub = getServer().getJMSManager();

        // creating the event message to be sent
        MapMessage lMsg = lMessageHub.buildMessage(getNamespace(), "connectorStopped");
        lMsg.setStringProperty("connectorId", aConnector.getId());

        // sending event
        lMessageHub.send(lMsg);
    } catch (Exception lEx) {
        mLog.error(Logging.getSimpleExceptionMessage(lEx,
                "notifying 'connectorStopped' " + "event through the MessageHub"), lEx);
    }
}

From source file:org.jwebsocket.plugins.system.SystemPlugIn.java

void notifyLogon(WebSocketConnector aConnector) {
    try {/*  w  w w.j ava 2 s  .c om*/
        // getting the message hub
        JMSManager lMessageHub = getServer().getJMSManager();

        // creating the event message to be sent
        MapMessage lMsg = lMessageHub.buildMessage(getNamespace(), "logon");
        lMsg.setStringProperty("connectorId", aConnector.getId());
        lMsg.setStringProperty("username", aConnector.getUsername());

        // sending event
        lMessageHub.send(lMsg);
    } catch (Exception lEx) {
        mLog.error(
                Logging.getSimpleExceptionMessage(lEx, "notifying 'logon' " + "event through the MessageHub"),
                lEx);
    }
}

From source file:org.jwebsocket.plugins.system.SystemPlugIn.java

void notifyLogoff(WebSocketConnector aConnector) {
    try {/*from   w  ww. ja  v a 2  s.  c  o  m*/
        // getting the message hub
        JMSManager lMessageHub = getServer().getJMSManager();

        // creating the event message to be sent
        MapMessage lMsg = lMessageHub.buildMessage(getNamespace(), "logoff");
        lMsg.setStringProperty("connectorId", aConnector.getId());
        lMsg.setStringProperty("username", aConnector.getUsername());

        // sending event
        lMessageHub.send(lMsg);
    } catch (Exception lEx) {
        mLog.error(
                Logging.getSimpleExceptionMessage(lEx, "notifying 'logoff' " + "event through the MessageHub"),
                lEx);
    }
}