final Map headers = command.getHeaders();
String login = (String) headers.get(Stomp.Headers.Connect.LOGIN);
String passcode = (String) headers.get(Stomp.Headers.Connect.PASSCODE);
String clientId = (String) headers.get(Stomp.Headers.Connect.CLIENT_ID);
XAConnectionFactory factory = getConnectionFactory();
IntrospectionSupport.setProperties(factory, headers, "factory.");
if (login != null) {
connection = factory.createXAConnection(login, passcode);
}
else {
connection = factory.createXAConnection();
}
if (clientId != null) {
connection.setClientID(clientId);
}
IntrospectionSupport.setProperties(connection, headers, "connection.");