Class: JMS::OracleAQConnectionFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/jms/oracle_a_q_connection_factory.rb

Overview

Connection Factory to support Oracle AQ

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#passwordObject

attr_writer :password



25
26
27
# File 'lib/jms/oracle_a_q_connection_factory.rb', line 25

def password
  @password
end

#urlObject

Returns the value of attribute url.



23
24
25
# File 'lib/jms/oracle_a_q_connection_factory.rb', line 23

def url
  @url
end

#usernameObject

Returns the value of attribute username.



23
24
25
# File 'lib/jms/oracle_a_q_connection_factory.rb', line 23

def username
  @username
end

Instance Method Details

#create_connection(*args) ⇒ Object

Creates a connection per standard JMS 1.1 techniques from the Oracle AQ JMS Interface



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/jms/oracle_a_q_connection_factory.rb', line 28

def create_connection(*args)
# Since username and password are not assigned (see lib/jms/connection.rb:200)
# and connection_factory.create_connection expects 2 arguments when username is not null ...
  if args.length == 2
    @username = args[0]
    @password = args[1]
  end

 # Full Qualified name causes a Java exception
  #cf = oracle.jms.AQjmsFactory.getConnectionFactory(@url, java.util.Properties.new)
  cf = AQjmsFactory.getConnectionFactory(@url, java.util.Properties.new)

  if username
    cf.createConnection(@username, @password)
  else
    cf.createConnection()
  end
end