org.apache.activemq.artemis.core.protocol.openwire.amq.AMQConnectionContext

Here are the examples of the java api class org.apache.activemq.artemis.core.protocol.openwire.amq.AMQConnectionContext taken from open source projects.

1. OpenWireConnection#initContext()

Project: activemq-artemis
File: OpenWireConnection.java
public AMQConnectionContext initContext(ConnectionInfo info) throws Exception {
    WireFormatInfo wireFormatInfo = wireFormat.getPreferedWireFormatInfo();
    // they were not.
    if (wireFormatInfo != null && wireFormatInfo.getVersion() <= 2) {
        info.setClientMaster(true);
    }
    state = new ConnectionState(info);
    context = new AMQConnectionContext();
    state.reset(info);
    // Setup the context.
    String clientId = info.getClientId();
    context.setBroker(protocolManager);
    context.setClientId(clientId);
    context.setClientMaster(info.isClientMaster());
    context.setConnection(this);
    context.setConnectionId(info.getConnectionId());
    // for now we pass the manager as the connector and see what happens
    // it should be related to activemq's Acceptor
    context.setFaultTolerant(info.isFaultTolerant());
    context.setUserName(info.getUserName());
    context.setWireFormatInfo(wireFormatInfo);
    context.setReconnect(info.isFailoverReconnect());
    context.setConnectionState(state);
    if (info.getClientIp() == null) {
        info.setClientIp(getRemoteAddress());
    }
    createInternalSession(info);
    return context;
}