Class: TorqueBox::Messaging::MessageBroker

Inherits:
Object
  • Object
show all
Defined in:
lib/torquebox/messaging/message_broker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ MessageBroker

Returns a new instance of MessageBroker.



28
29
30
# File 'lib/torquebox/messaging/message_broker.rb', line 28

def initialize(&block)
  instance_eval( &block ) if block
end

Instance Attribute Details

#data_dirObject

Returns the value of attribute data_dir.



26
27
28
# File 'lib/torquebox/messaging/message_broker.rb', line 26

def data_dir
  @data_dir
end

Instance Method Details

#before_start(container) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/torquebox/messaging/message_broker.rb', line 36

def before_start(container)
  org.hornetq.core.logging::Logger.setDelegateFactory( org.hornetq.integration.logging::Log4jLogDelegateFactory.new )
  Java::java.lang::System.setProperty( "jboss.server.data.dir", data_dir || Dir.tmpdir )

	config_path = File.expand_path( File.join( File.dirname(__FILE__), 'hornetq-configuration.xml' )  )
	if ( config_path[0,1] != '/' )
	  config_path = "/#{config_path}"
	end
	config_url = "file://#{config_path}"
  java.lang::System.setProperty( "torquebox.hornetq.configuration.url", 
                                 config_url )
end

#fundamental_deployment_pathsObject



32
33
34
# File 'lib/torquebox/messaging/message_broker.rb', line 32

def fundamental_deployment_paths()
  [ File.join( File.dirname(__FILE__), 'message-broker-jboss-beans.xml' ) ]
end