lib/hornetq.rb in jruby-hornetq-0.2.0.alpha vs lib/hornetq.rb in jruby-hornetq-0.2.1.alpha

- old
+ new

@@ -1,9 +1,30 @@ -require File.dirname(__FILE__) + '/hornetq/lib/hornetq-core-client.jar' -require File.dirname(__FILE__) + '/hornetq/lib/netty.jar' -require 'hornetq/org_hornetq_api_core_client_client_session' -require 'hornetq/org_hornetq_core_client_impl_client_message_impl' -require 'hornetq/org_hornetq_utils_typed_properties' -require 'hornetq/hornet_q_client' -require 'hornetq/client_requestor' -require 'hornetq/client_server' -require 'hornetq/session_pool' +include Java +require 'hornetq/server' +require 'hornetq/client' +require 'hornetq/uri' + +module HornetQ + + # Netty Class name + NETTY_CONNECTOR_CLASS_NAME = 'org.hornetq.core.remoting.impl.netty.NettyConnectorFactory' + NETTY_ACCEPTOR_CLASS_NAME = 'org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory' + INVM_CONNECTOR_CLASS_NAME = 'org.hornetq.core.remoting.impl.invm.InVMConnectorFactory' + INVM_ACCEPTOR_CLASS_NAME = 'org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory' + + DEFAULT_NETTY_PORT = java.lang.Integer.new(5445) + DEFAULT_DATA_DIRECTORY = './data' + + # Allow override of our included jars so we don't have to keep up with hornetq releases + def self.require_jar(jar_name) + if ENV['HORNETQ_HOME'] + require "#{ENV['HORNETQ_HOME']}/lib/#{jar_name}.jar" + else + require "hornetq/java/#{jar_name}.jar" + end + end + + def self.netty_port(port) + port ||= DEFAULT_NETTY_PORT + return java.lang.Integer.new(port) + end +end