Class: TorqueBox::Messaging::XaConnection
- Inherits:
-
Object
- Object
- TorqueBox::Messaging::XaConnection
- Defined in:
- lib/torquebox/messaging/xa_connection.rb
Instance Method Summary collapse
- #client_id ⇒ Object
- #client_id=(client_id) ⇒ Object
- #close ⇒ Object
- #create_session ⇒ Object
-
#initialize(jms_connection) ⇒ XaConnection
constructor
A new instance of XaConnection.
- #start ⇒ Object
- #with_session(&block) ⇒ Object
Constructor Details
#initialize(jms_connection) ⇒ XaConnection
Returns a new instance of XaConnection.
22 23 24 |
# File 'lib/torquebox/messaging/xa_connection.rb', line 22 def initialize(jms_connection) @jms_connection = jms_connection end |
Instance Method Details
#client_id ⇒ Object
34 35 36 |
# File 'lib/torquebox/messaging/xa_connection.rb', line 34 def client_id @jms_connection.client_id end |
#client_id=(client_id) ⇒ Object
38 39 40 |
# File 'lib/torquebox/messaging/xa_connection.rb', line 38 def client_id=(client_id) @jms_connection.client_id = client_id end |
#close ⇒ Object
30 31 32 |
# File 'lib/torquebox/messaging/xa_connection.rb', line 30 def close @jms_connection.close end |
#create_session ⇒ Object
52 53 54 |
# File 'lib/torquebox/messaging/xa_connection.rb', line 52 def create_session() XaSession.new( @jms_connection.create_xa_session() ) end |
#start ⇒ Object
26 27 28 |
# File 'lib/torquebox/messaging/xa_connection.rb', line 26 def start @jms_connection.start end |
#with_session(&block) ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'lib/torquebox/messaging/xa_connection.rb', line 42 def with_session(&block) session = self.create_session() begin result = block.call( session ) ensure session.close end return result end |