Class: TorqueBox::Messaging::XaConnectionFactory

Inherits:
ConnectionFactory show all
Defined in:
lib/torquebox/messaging/xa_connection_factory.rb

Instance Attribute Summary

Attributes inherited from ConnectionFactory

#internal_connection_factory

Instance Method Summary collapse

Methods inherited from ConnectionFactory

#activate, #connections, #create_connection, #create_connection_factory, #create_internal_connection_factory, #create_xa_connection, #current, #deactivate, #initialize, new, #transaction

Constructor Details

This class inherits a constructor from TorqueBox::Messaging::ConnectionFactory

Instance Method Details

#to_sObject



39
40
41
# File 'lib/torquebox/messaging/xa_connection_factory.rb', line 39

def to_s
  "[XaConnectionFactory: internal_connection_factory=#{internal_connection_factory}]"
end

#with_new_connection(options, &block) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/torquebox/messaging/xa_connection_factory.rb', line 25

def with_new_connection(options, &block)
  client_id = options[:client_id]
  connection = create_xa_connection( options )
  connection.client_id = client_id
  connection.start
  begin
    result = block.call( connection )
  ensure
    connection.close
  end
  return result
end