jruby-jms 0.11.1 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/HISTORY.md +5 -0
- data/Rakefile +1 -1
- data/examples/invm/invm.rb +44 -0
- data/examples/invm/log4j.properties +58 -0
- data/examples/jms.yml +11 -9
- data/examples/producer-consumer/producer.rb +1 -1
- data/lib/jms/connection.rb +1 -0
- data/lib/jms/message_producer.rb +59 -0
- data/test/connection_test.rb +3 -0
- data/test/jms.yml +3 -1
- data/test/log4j.properties +32 -0
- metadata +6 -37
- data/doc/classes/JMS.html +0 -265
- data/doc/classes/JMS/BytesMessage.html +0 -215
- data/doc/classes/JMS/Connection.html +0 -1145
- data/doc/classes/JMS/MapMessage.html +0 -333
- data/doc/classes/JMS/Message.html +0 -1085
- data/doc/classes/JMS/MessageConsumer.html +0 -316
- data/doc/classes/JMS/MessageListenerImpl.html +0 -262
- data/doc/classes/JMS/ObjectMessage.html +0 -170
- data/doc/classes/JMS/OracleAQConnectionFactory.html +0 -184
- data/doc/classes/JMS/QueueBrowser.html +0 -155
- data/doc/classes/JMS/Session.html +0 -947
- data/doc/classes/JMS/SessionPool.html +0 -411
- data/doc/classes/JMS/TextMessage.html +0 -194
- data/doc/created.rid +0 -1
- data/doc/files/README_md.html +0 -440
- data/doc/files/lib/jms/bytes_message_rb.html +0 -122
- data/doc/files/lib/jms/connection_rb.html +0 -140
- data/doc/files/lib/jms/imports_rb.html +0 -108
- data/doc/files/lib/jms/logging_rb.html +0 -129
- data/doc/files/lib/jms/map_message_rb.html +0 -122
- data/doc/files/lib/jms/message_consumer_rb.html +0 -122
- data/doc/files/lib/jms/message_listener_impl_rb.html +0 -122
- data/doc/files/lib/jms/message_rb.html +0 -122
- data/doc/files/lib/jms/object_message_rb.html +0 -122
- data/doc/files/lib/jms/oracle_a_q_connection_factory_rb.html +0 -122
- data/doc/files/lib/jms/queue_browser_rb.html +0 -122
- data/doc/files/lib/jms/session_pool_rb.html +0 -108
- data/doc/files/lib/jms/session_rb.html +0 -164
- data/doc/files/lib/jms/text_message_rb.html +0 -122
- data/doc/files/lib/jms_rb.html +0 -131
- data/doc/fr_class_index.html +0 -39
- data/doc/fr_file_index.html +0 -42
- data/doc/fr_method_index.html +0 -120
- data/doc/index.html +0 -24
- data/doc/rdoc-style.css +0 -208
data/HISTORY.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 0.11.2 (2011-06-01)
|
2
|
+
|
3
|
+
* Issue #8 Add ability to set Producer delivery mode using a Symbol
|
4
|
+
* Include ActiveMQ InVM working example along with Log4J properties file
|
5
|
+
|
1
6
|
## 0.11.1 (2011-05-25)
|
2
7
|
|
3
8
|
* Fixes the condition where a bad session keeps being re-used in a session pool.
|
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ desc "Build gem"
|
|
9
9
|
task :gem do |t|
|
10
10
|
gemspec = Gem::Specification.new do |s|
|
11
11
|
s.name = 'jruby-jms'
|
12
|
-
s.version = '0.11.
|
12
|
+
s.version = '0.11.2'
|
13
13
|
s.author = 'Reid Morrison'
|
14
14
|
s.email = 'rubywmq@gmail.com'
|
15
15
|
s.homepage = 'https://github.com/reidmorrison/jruby-jms'
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#
|
2
|
+
# Sample ActiveMQ InVM Example:
|
3
|
+
# Write to a queue and then consume the message in a separate thread
|
4
|
+
#
|
5
|
+
# Note: This example only works with ActiveMQ
|
6
|
+
# Update the jar files path in ../jms.yml to point to your ActiveMQ installation
|
7
|
+
|
8
|
+
# Allow examples to be run in-place without requiring a gem install
|
9
|
+
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../../lib'
|
10
|
+
|
11
|
+
require 'rubygems'
|
12
|
+
require 'yaml'
|
13
|
+
require 'jms'
|
14
|
+
require 'benchmark'
|
15
|
+
|
16
|
+
# Set Log4J properties file so that it does not need to be in the CLASSPATH
|
17
|
+
java.lang.System.properties['log4j.configuration'] = "file://#{File.join(File.dirname(__FILE__), 'log4j.properties')}"
|
18
|
+
|
19
|
+
jms_provider = 'activemq-invm'
|
20
|
+
|
21
|
+
# Load Connection parameters from configuration file
|
22
|
+
config = YAML.load_file(File.join(File.dirname(__FILE__), '..', 'jms.yml'))[jms_provider]
|
23
|
+
raise "JMS Provider option:#{jms_provider} not found in jms.yml file" unless config
|
24
|
+
|
25
|
+
JMS::Connection.start(config) do |connection|
|
26
|
+
# Consume messages in a separate thread
|
27
|
+
connection.on_message(:queue_name => 'ExampleQueue') do |message|
|
28
|
+
JMS::logger.info "Consumed message from ExampleQueue: '#{message.data}'"
|
29
|
+
end
|
30
|
+
|
31
|
+
# Send a single message within a new session
|
32
|
+
connection.session do |session|
|
33
|
+
session.producer(:queue_name => 'ExampleQueue') do |producer|
|
34
|
+
producer.send(session.message("Hello World. #{Time.now}"))
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
JMS::logger.info "Put message on ExampleQueue"
|
39
|
+
|
40
|
+
# Give the consume thread time to process the message before terminating
|
41
|
+
sleep 1
|
42
|
+
|
43
|
+
JMS::logger.info "Shutting down"
|
44
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
#
|
2
|
+
# This file controls most of the logging in ActiveMQ which is mainly based around
|
3
|
+
# the commons logging API.
|
4
|
+
#
|
5
|
+
log4j.rootLogger=INFO, logfile, console
|
6
|
+
log4j.logger.org.apache.activemq.spring=WARN
|
7
|
+
log4j.logger.org.apache.activemq.web.handler=WARN
|
8
|
+
log4j.logger.org.springframework=WARN
|
9
|
+
log4j.logger.org.apache.xbean=WARN
|
10
|
+
log4j.logger.org.apache.camel=INFO
|
11
|
+
|
12
|
+
# When debugging or reporting problems to the ActiveMQ team,
|
13
|
+
# comment out the above lines and uncomment the next.
|
14
|
+
|
15
|
+
#log4j.rootLogger=DEBUG, logfile, console
|
16
|
+
|
17
|
+
# Or for more fine grained debug logging uncomment one of these
|
18
|
+
#log4j.logger.org.apache.activemq=DEBUG
|
19
|
+
#log4j.logger.org.apache.camel=DEBUG
|
20
|
+
|
21
|
+
# Console appender
|
22
|
+
log4j.appender.console=org.apache.log4j.ConsoleAppender
|
23
|
+
log4j.appender.console.layout=org.apache.log4j.PatternLayout
|
24
|
+
log4j.appender.console.layout.ConversionPattern=%d{ISO8601} %-5p: %m [%c %t]%n
|
25
|
+
log4j.appender.console.threshold=INFO
|
26
|
+
|
27
|
+
# File appender
|
28
|
+
log4j.appender.logfile=org.apache.log4j.RollingFileAppender
|
29
|
+
log4j.appender.logfile.file=activemq.log
|
30
|
+
log4j.appender.logfile.maxFileSize=10240KB
|
31
|
+
log4j.appender.logfile.maxBackupIndex=5
|
32
|
+
log4j.appender.logfile.append=true
|
33
|
+
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
|
34
|
+
log4j.appender.logfile.layout.ConversionPattern=%d{ISO8601} %-5p: %m [%c %t]%n
|
35
|
+
# use some of the following patterns to see MDC logging data
|
36
|
+
#
|
37
|
+
# %X{activemq.broker}
|
38
|
+
# %X{activemq.connector}
|
39
|
+
# %X{activemq.destination}
|
40
|
+
#
|
41
|
+
# e.g.
|
42
|
+
#
|
43
|
+
# log4j.appender.logfile.layout.ConversionPattern=%d | %-20.20X{activemq.connector} | %-5p | %m | %c | %t%n
|
44
|
+
|
45
|
+
###########
|
46
|
+
# Audit log
|
47
|
+
###########
|
48
|
+
|
49
|
+
log4j.additivity.org.apache.activemq.audit=false
|
50
|
+
log4j.logger.org.apache.activemq.audit=INFO, audit
|
51
|
+
|
52
|
+
log4j.appender.audit=org.apache.log4j.FileAppender
|
53
|
+
log4j.appender.audit.file=activemq-audit.log
|
54
|
+
log4j.appender.logfile.maxFileSize=10240KB
|
55
|
+
log4j.appender.logfile.maxBackupIndex=5
|
56
|
+
log4j.appender.audit.append=true
|
57
|
+
log4j.appender.audit.layout=org.apache.log4j.PatternLayout
|
58
|
+
log4j.appender.audit.layout.ConversionPattern=%d{ISO8601} %-5p: %m [%c %t]%n
|
data/examples/jms.yml
CHANGED
@@ -14,26 +14,28 @@ activemq:
|
|
14
14
|
:username: system
|
15
15
|
:password: manager
|
16
16
|
:require_jars:
|
17
|
-
- ~/Applications/apache-activemq-5.
|
18
|
-
|
19
|
-
|
20
|
-
# - ~/Applications/apache-activemq-5.5.0/lib/optional/slf4j-log4j12-1.5.11.jar
|
21
|
-
# - ~/Applications/apache-activemq-5.5.0/lib/optional/log4j-1.2.14.jar
|
17
|
+
- ~/Applications/apache-activemq-5.5.0/activemq-all-5.5.0.jar
|
18
|
+
- ~/Applications/apache-activemq-5.5.0/lib/optional/slf4j-log4j12-1.5.11.jar
|
19
|
+
- ~/Applications/apache-activemq-5.5.0/lib/optional/log4j-1.2.14.jar
|
22
20
|
|
23
21
|
# ActiveMQ In VM Broker (Supports messaging within a JVM instance)
|
24
|
-
activemq-
|
22
|
+
activemq-invm:
|
25
23
|
:factory: org.apache.activemq.ActiveMQConnectionFactory
|
26
|
-
:broker_url: vm://
|
24
|
+
:broker_url: vm://mybroker
|
27
25
|
:object_message_serialization_defered: true
|
28
26
|
:require_jars:
|
29
|
-
- ~/Applications/apache-activemq-5.
|
27
|
+
- ~/Applications/apache-activemq-5.5.0/activemq-all-5.5.0.jar
|
28
|
+
- ~/Applications/apache-activemq-5.5.0/lib/optional/slf4j-log4j12-1.5.11.jar
|
29
|
+
- ~/Applications/apache-activemq-5.5.0/lib/optional/log4j-1.2.14.jar
|
30
30
|
|
31
31
|
# ActiveMQ with failover to slave instance
|
32
32
|
activemq-ha:
|
33
33
|
:factory: org.apache.activemq.ActiveMQConnectionFactory
|
34
34
|
:broker_url: failover://(tcp://msg1:61616,tcp://msg2:61616)?randomize=false&timeout=30000&initialReconnectDelay=100&useExponentialBackOff=true
|
35
35
|
:require_jars:
|
36
|
-
- ~/Applications/apache-activemq-5.
|
36
|
+
- ~/Applications/apache-activemq-5.5.0/activemq-all-5.5.0.jar
|
37
|
+
- ~/Applications/apache-activemq-5.5.0/lib/optional/slf4j-log4j12-1.5.11.jar
|
38
|
+
- ~/Applications/apache-activemq-5.5.0/lib/optional/log4j-1.2.14.jar
|
37
39
|
|
38
40
|
# JBoss 4 Messaging
|
39
41
|
:jndi_name: ConnectionFactory
|
@@ -18,7 +18,7 @@ raise "JMS Provider option:#{jms_provider} not found in jms.yml file" unless con
|
|
18
18
|
|
19
19
|
JMS::Connection.session(config) do |session|
|
20
20
|
session.producer(:queue_name => 'ExampleQueue') do |producer|
|
21
|
-
producer.
|
21
|
+
producer.delivery_mode_sym = :non_persistent
|
22
22
|
producer.send(session.message("Hello World: #{Time.now}"))
|
23
23
|
JMS::logger.info "Successfully sent one message to queue ExampleQueue"
|
24
24
|
end
|
data/lib/jms/connection.rb
CHANGED
@@ -0,0 +1,59 @@
|
|
1
|
+
################################################################################
|
2
|
+
# Copyright 2008, 2009, 2010, 2011 J. Reid Morrison
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
################################################################################
|
16
|
+
|
17
|
+
# Extend JMS Message Producer Interface with Ruby methods
|
18
|
+
#
|
19
|
+
# For further help on javax.jms.Message
|
20
|
+
# http://download.oracle.com/javaee/6/api/javax/jms/MessageProducer.html
|
21
|
+
#
|
22
|
+
# Interface javax.jms.Producer
|
23
|
+
module JMS::MessageProducer
|
24
|
+
|
25
|
+
# Return the Delivery Mode as a Ruby symbol
|
26
|
+
# :persistent
|
27
|
+
# :non_persistent
|
28
|
+
# nil if unknown
|
29
|
+
def delivery_mode_sym
|
30
|
+
case delivery_mode
|
31
|
+
when JMS::DeliveryMode::PERSISTENT
|
32
|
+
:persistent
|
33
|
+
when JMS::DeliveryMode::NON_PERSISTENT
|
34
|
+
:non_persistent
|
35
|
+
else
|
36
|
+
nil
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
# Set the JMS Delivery Mode from a Ruby Symbol
|
41
|
+
# Valid values for mode
|
42
|
+
# :persistent
|
43
|
+
# :non_persistent
|
44
|
+
#
|
45
|
+
# Example:
|
46
|
+
# producer.delivery_mode_sym = :persistent
|
47
|
+
def delivery_mode_sym=(mode)
|
48
|
+
val = case mode
|
49
|
+
when :persistent
|
50
|
+
JMS::DeliveryMode::PERSISTENT
|
51
|
+
when :non_persistent
|
52
|
+
JMS::DeliveryMode::NON_PERSISTENT
|
53
|
+
else
|
54
|
+
raise "Unknown delivery mode symbol: #{mode}"
|
55
|
+
end
|
56
|
+
self.delivery_mode = val
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
data/test/connection_test.rb
CHANGED
@@ -7,6 +7,9 @@ require 'shoulda'
|
|
7
7
|
require 'jms'
|
8
8
|
require 'yaml'
|
9
9
|
|
10
|
+
# Set Log4J properties file so that it does not need to be in the CLASSPATH
|
11
|
+
java.lang.System.properties['log4j.configuration'] = "test/log4j.properties"
|
12
|
+
|
10
13
|
class JMSTest < Test::Unit::TestCase
|
11
14
|
context 'JMS Connection' do
|
12
15
|
# Load configuration from jms.yml
|
data/test/jms.yml
CHANGED
@@ -13,7 +13,9 @@ activemq:
|
|
13
13
|
:factory: org.apache.activemq.ActiveMQConnectionFactory
|
14
14
|
:broker_url: tcp://localhost:61616
|
15
15
|
:require_jars:
|
16
|
-
- ~/Applications/apache-activemq-5.
|
16
|
+
- ~/Applications/apache-activemq-5.5.0/activemq-all-5.5.0.jar
|
17
|
+
- ~/Applications/apache-activemq-5.5.0/lib/optional/slf4j-log4j12-1.5.11.jar
|
18
|
+
- ~/Applications/apache-activemq-5.5.0/lib/optional/log4j-1.2.14.jar
|
17
19
|
:queue_name: TestQueue
|
18
20
|
:topic_name: TestTopic
|
19
21
|
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#
|
2
|
+
# This file controls most of the logging in ActiveMQ which is mainly based around
|
3
|
+
# the commons logging API.
|
4
|
+
#
|
5
|
+
log4j.rootLogger=INFO, console
|
6
|
+
log4j.logger.org.apache.activemq.spring=WARN
|
7
|
+
log4j.logger.org.apache.activemq.web.handler=WARN
|
8
|
+
log4j.logger.org.springframework=WARN
|
9
|
+
log4j.logger.org.apache.xbean=WARN
|
10
|
+
log4j.logger.org.apache.camel=INFO
|
11
|
+
|
12
|
+
# When debugging or reporting problems to the ActiveMQ team,
|
13
|
+
# comment out the above lines and uncomment the next.
|
14
|
+
|
15
|
+
#log4j.rootLogger=DEBUG, logfile, console
|
16
|
+
|
17
|
+
# Or for more fine grained debug logging uncomment one of these
|
18
|
+
#log4j.logger.org.apache.activemq=DEBUG
|
19
|
+
#log4j.logger.org.apache.camel=DEBUG
|
20
|
+
|
21
|
+
# Console appender
|
22
|
+
log4j.appender.console=org.apache.log4j.ConsoleAppender
|
23
|
+
log4j.appender.console.layout=org.apache.log4j.PatternLayout
|
24
|
+
log4j.appender.console.layout.ConversionPattern=%d{ISO8601} %-5p: %m [%c %t]%n
|
25
|
+
log4j.appender.console.threshold=INFO
|
26
|
+
|
27
|
+
log4j.additivity.org.apache.activemq.audit=false
|
28
|
+
log4j.logger.org.apache.activemq.audit=INFO, audit
|
29
|
+
|
30
|
+
log4j.appender.audit=org.apache.log4j.ConsoleAppender
|
31
|
+
log4j.appender.audit.layout=org.apache.log4j.PatternLayout
|
32
|
+
log4j.appender.audit.layout.ConversionPattern=%d{ISO8601} %-5p: %m [%c %t]%n
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: jruby-jms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.11.
|
5
|
+
version: 0.11.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Reid Morrison
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-06-01 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|
@@ -27,45 +27,12 @@ files:
|
|
27
27
|
- LICENSE.txt
|
28
28
|
- Rakefile
|
29
29
|
- README.md
|
30
|
-
- doc/created.rid
|
31
|
-
- doc/fr_class_index.html
|
32
|
-
- doc/fr_file_index.html
|
33
|
-
- doc/fr_method_index.html
|
34
|
-
- doc/index.html
|
35
|
-
- doc/rdoc-style.css
|
36
|
-
- doc/classes/JMS.html
|
37
|
-
- doc/classes/JMS/BytesMessage.html
|
38
|
-
- doc/classes/JMS/Connection.html
|
39
|
-
- doc/classes/JMS/MapMessage.html
|
40
|
-
- doc/classes/JMS/Message.html
|
41
|
-
- doc/classes/JMS/MessageConsumer.html
|
42
|
-
- doc/classes/JMS/MessageListenerImpl.html
|
43
|
-
- doc/classes/JMS/ObjectMessage.html
|
44
|
-
- doc/classes/JMS/OracleAQConnectionFactory.html
|
45
|
-
- doc/classes/JMS/QueueBrowser.html
|
46
|
-
- doc/classes/JMS/Session.html
|
47
|
-
- doc/classes/JMS/SessionPool.html
|
48
|
-
- doc/classes/JMS/TextMessage.html
|
49
|
-
- doc/files/README_md.html
|
50
|
-
- doc/files/lib/jms_rb.html
|
51
|
-
- doc/files/lib/jms/bytes_message_rb.html
|
52
|
-
- doc/files/lib/jms/connection_rb.html
|
53
|
-
- doc/files/lib/jms/imports_rb.html
|
54
|
-
- doc/files/lib/jms/logging_rb.html
|
55
|
-
- doc/files/lib/jms/map_message_rb.html
|
56
|
-
- doc/files/lib/jms/message_consumer_rb.html
|
57
|
-
- doc/files/lib/jms/message_listener_impl_rb.html
|
58
|
-
- doc/files/lib/jms/message_rb.html
|
59
|
-
- doc/files/lib/jms/object_message_rb.html
|
60
|
-
- doc/files/lib/jms/oracle_a_q_connection_factory_rb.html
|
61
|
-
- doc/files/lib/jms/queue_browser_rb.html
|
62
|
-
- doc/files/lib/jms/session_pool_rb.html
|
63
|
-
- doc/files/lib/jms/session_rb.html
|
64
|
-
- doc/files/lib/jms/text_message_rb.html
|
65
30
|
- examples/jms.yml
|
66
31
|
- examples/advanced/session_pool.rb
|
67
32
|
- examples/client-server/replier.rb
|
68
33
|
- examples/client-server/requestor.rb
|
34
|
+
- examples/invm/invm.rb
|
35
|
+
- examples/invm/log4j.properties
|
69
36
|
- examples/performance/consumer.rb
|
70
37
|
- examples/performance/producer.rb
|
71
38
|
- examples/producer-consumer/browser.rb
|
@@ -83,6 +50,7 @@ files:
|
|
83
50
|
- lib/jms/message.rb
|
84
51
|
- lib/jms/message_consumer.rb
|
85
52
|
- lib/jms/message_listener_impl.rb
|
53
|
+
- lib/jms/message_producer.rb
|
86
54
|
- lib/jms/object_message.rb
|
87
55
|
- lib/jms/oracle_a_q_connection_factory.rb
|
88
56
|
- lib/jms/queue_browser.rb
|
@@ -91,6 +59,7 @@ files:
|
|
91
59
|
- lib/jms/text_message.rb
|
92
60
|
- test/connection_test.rb
|
93
61
|
- test/jms.yml
|
62
|
+
- test/log4j.properties
|
94
63
|
- test/message_test.rb
|
95
64
|
- test/session_pool_test.rb
|
96
65
|
- test/session_test.rb
|
data/doc/classes/JMS.html
DELETED
@@ -1,265 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Module: JMS</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Module</strong></td>
|
53
|
-
<td class="class-name-in-header">JMS</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../files/lib/jms/connection_rb.html">
|
59
|
-
lib/jms/connection.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
<a href="../files/lib/jms/imports_rb.html">
|
63
|
-
lib/jms/imports.rb
|
64
|
-
</a>
|
65
|
-
<br />
|
66
|
-
<a href="../files/lib/jms/logging_rb.html">
|
67
|
-
lib/jms/logging.rb
|
68
|
-
</a>
|
69
|
-
<br />
|
70
|
-
<a href="../files/lib/jms/message_listener_impl_rb.html">
|
71
|
-
lib/jms/message_listener_impl.rb
|
72
|
-
</a>
|
73
|
-
<br />
|
74
|
-
<a href="../files/lib/jms/oracle_a_q_connection_factory_rb.html">
|
75
|
-
lib/jms/oracle_a_q_connection_factory.rb
|
76
|
-
</a>
|
77
|
-
<br />
|
78
|
-
<a href="../files/lib/jms/session_pool_rb.html">
|
79
|
-
lib/jms/session_pool.rb
|
80
|
-
</a>
|
81
|
-
<br />
|
82
|
-
</td>
|
83
|
-
</tr>
|
84
|
-
|
85
|
-
</table>
|
86
|
-
</div>
|
87
|
-
<!-- banner header -->
|
88
|
-
|
89
|
-
<div id="bodyContent">
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
<div id="contextContent">
|
94
|
-
|
95
|
-
<div id="description">
|
96
|
-
<p>
|
97
|
-
Copyright 2008, 2009, 2010, 2011 J. Reid Morrison
|
98
|
-
</p>
|
99
|
-
<p>
|
100
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
101
|
-
you may not use this file except in compliance with the License. You may
|
102
|
-
obtain a copy of the License at
|
103
|
-
</p>
|
104
|
-
<pre>
|
105
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
106
|
-
</pre>
|
107
|
-
<p>
|
108
|
-
Unless required by applicable law or agreed to in writing, software
|
109
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
110
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
111
|
-
See the License for the specific language governing permissions and
|
112
|
-
limitations under the License.
|
113
|
-
</p>
|
114
|
-
|
115
|
-
</div>
|
116
|
-
|
117
|
-
|
118
|
-
</div>
|
119
|
-
|
120
|
-
<div id="method-list">
|
121
|
-
<h3 class="section-bar">Methods</h3>
|
122
|
-
|
123
|
-
<div class="name-list">
|
124
|
-
<a href="#M000002">logger</a>
|
125
|
-
<a href="#M000003">logger=</a>
|
126
|
-
<a href="#M000004">ruby_logger</a>
|
127
|
-
</div>
|
128
|
-
</div>
|
129
|
-
|
130
|
-
</div>
|
131
|
-
|
132
|
-
|
133
|
-
<!-- if includes -->
|
134
|
-
|
135
|
-
<div id="section">
|
136
|
-
|
137
|
-
<div id="class-list">
|
138
|
-
<h3 class="section-bar">Classes and Modules</h3>
|
139
|
-
|
140
|
-
Module <a href="JMS/BytesMessage.html" class="link">JMS::BytesMessage</a><br />
|
141
|
-
Module <a href="JMS/MapMessage.html" class="link">JMS::MapMessage</a><br />
|
142
|
-
Module <a href="JMS/Message.html" class="link">JMS::Message</a><br />
|
143
|
-
Module <a href="JMS/MessageConsumer.html" class="link">JMS::MessageConsumer</a><br />
|
144
|
-
Module <a href="JMS/ObjectMessage.html" class="link">JMS::ObjectMessage</a><br />
|
145
|
-
Module <a href="JMS/QueueBrowser.html" class="link">JMS::QueueBrowser</a><br />
|
146
|
-
Module <a href="JMS/Session.html" class="link">JMS::Session</a><br />
|
147
|
-
Module <a href="JMS/TextMessage.html" class="link">JMS::TextMessage</a><br />
|
148
|
-
Class <a href="JMS/Connection.html" class="link">JMS::Connection</a><br />
|
149
|
-
Class <a href="JMS/MessageListenerImpl.html" class="link">JMS::MessageListenerImpl</a><br />
|
150
|
-
Class <a href="JMS/OracleAQConnectionFactory.html" class="link">JMS::OracleAQConnectionFactory</a><br />
|
151
|
-
Class <a href="JMS/SessionPool.html" class="link">JMS::SessionPool</a><br />
|
152
|
-
|
153
|
-
</div>
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
<!-- if method_list -->
|
162
|
-
<div id="methods">
|
163
|
-
<h3 class="section-bar">Public Class methods</h3>
|
164
|
-
|
165
|
-
<div id="method-M000002" class="method-detail">
|
166
|
-
<a name="M000002"></a>
|
167
|
-
|
168
|
-
<div class="method-heading">
|
169
|
-
<a href="#M000002" class="method-signature">
|
170
|
-
<span class="method-name">logger</span><span class="method-args">()</span>
|
171
|
-
</a>
|
172
|
-
</div>
|
173
|
-
|
174
|
-
<div class="method-description">
|
175
|
-
<p>
|
176
|
-
Returns the <a href="JMS.html#M000002">logger</a> being used by jruby-jms
|
177
|
-
Unless previously set, it will try to use the Rails <a
|
178
|
-
href="JMS.html#M000002">logger</a> and if it is not present, it will return
|
179
|
-
a new Ruby <a href="JMS.html#M000002">logger</a>
|
180
|
-
</p>
|
181
|
-
<p><a class="source-toggle" href="#"
|
182
|
-
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
183
|
-
<div class="method-source-code" id="M000002-source">
|
184
|
-
<pre>
|
185
|
-
<span class="ruby-comment cmt"># File lib/jms/logging.rb, line 23</span>
|
186
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">logger</span>
|
187
|
-
<span class="ruby-ivar">@logger</span> <span class="ruby-operator">||=</span> (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">rails_logger</span> <span class="ruby-operator">||</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ruby_logger</span>)
|
188
|
-
<span class="ruby-keyword kw">end</span>
|
189
|
-
</pre>
|
190
|
-
</div>
|
191
|
-
</div>
|
192
|
-
</div>
|
193
|
-
|
194
|
-
<div id="method-M000003" class="method-detail">
|
195
|
-
<a name="M000003"></a>
|
196
|
-
|
197
|
-
<div class="method-heading">
|
198
|
-
<a href="#M000003" class="method-signature">
|
199
|
-
<span class="method-name">logger=</span><span class="method-args">(logger)</span>
|
200
|
-
</a>
|
201
|
-
</div>
|
202
|
-
|
203
|
-
<div class="method-description">
|
204
|
-
<p>
|
205
|
-
Replace the <a href="JMS.html#M000002">logger</a> for jruby-jms
|
206
|
-
</p>
|
207
|
-
<p><a class="source-toggle" href="#"
|
208
|
-
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
209
|
-
<div class="method-source-code" id="M000003-source">
|
210
|
-
<pre>
|
211
|
-
<span class="ruby-comment cmt"># File lib/jms/logging.rb, line 28</span>
|
212
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">logger=</span>(<span class="ruby-identifier">logger</span>)
|
213
|
-
<span class="ruby-ivar">@logger</span> = <span class="ruby-identifier">logger</span>
|
214
|
-
<span class="ruby-keyword kw">end</span>
|
215
|
-
</pre>
|
216
|
-
</div>
|
217
|
-
</div>
|
218
|
-
</div>
|
219
|
-
|
220
|
-
<div id="method-M000004" class="method-detail">
|
221
|
-
<a name="M000004"></a>
|
222
|
-
|
223
|
-
<div class="method-heading">
|
224
|
-
<a href="#M000004" class="method-signature">
|
225
|
-
<span class="method-name">ruby_logger</span><span class="method-args">(level=nil, target=STDOUT)</span>
|
226
|
-
</a>
|
227
|
-
</div>
|
228
|
-
|
229
|
-
<div class="method-description">
|
230
|
-
<p>
|
231
|
-
Use the ruby <a href="JMS.html#M000002">logger</a>, but add needed trace
|
232
|
-
level logging which will result in debug log entries
|
233
|
-
</p>
|
234
|
-
<p><a class="source-toggle" href="#"
|
235
|
-
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
236
|
-
<div class="method-source-code" id="M000004-source">
|
237
|
-
<pre>
|
238
|
-
<span class="ruby-comment cmt"># File lib/jms/logging.rb, line 34</span>
|
239
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ruby_logger</span>(<span class="ruby-identifier">level</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">target</span>=<span class="ruby-constant">STDOUT</span>)
|
240
|
-
<span class="ruby-identifier">require</span> <span class="ruby-value str">'logger'</span>
|
241
|
-
|
242
|
-
<span class="ruby-identifier">l</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Logger</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">target</span>)
|
243
|
-
<span class="ruby-identifier">l</span>.<span class="ruby-identifier">instance_eval</span> <span class="ruby-value str">"alias :trace :debug"</span>
|
244
|
-
<span class="ruby-identifier">l</span>.<span class="ruby-identifier">instance_eval</span> <span class="ruby-value str">"alias :trace? :debug?"</span>
|
245
|
-
<span class="ruby-identifier">l</span>.<span class="ruby-identifier">level</span> = <span class="ruby-identifier">level</span> <span class="ruby-operator">||</span> <span class="ruby-operator">::</span><span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">INFO</span>
|
246
|
-
<span class="ruby-identifier">l</span>
|
247
|
-
<span class="ruby-keyword kw">end</span>
|
248
|
-
</pre>
|
249
|
-
</div>
|
250
|
-
</div>
|
251
|
-
</div>
|
252
|
-
|
253
|
-
|
254
|
-
</div>
|
255
|
-
|
256
|
-
|
257
|
-
</div>
|
258
|
-
|
259
|
-
|
260
|
-
<div id="validator-badges">
|
261
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
262
|
-
</div>
|
263
|
-
|
264
|
-
</body>
|
265
|
-
</html>
|