rservicebus 0.1.74 → 0.1.75

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.
Files changed (66) hide show
  1. data/bin/ReturnMessagesToSourceQueue +18 -18
  2. data/bin/SendEmptyMessage +3 -3
  3. data/bin/rsb_ctl +10 -10
  4. data/bin/rservicebus-create +4 -4
  5. data/bin/rservicebus-init +7 -6
  6. data/lib/rservicebus.rb +49 -49
  7. data/lib/rservicebus/Agent.rb +4 -4
  8. data/lib/rservicebus/AppResource.rb +4 -4
  9. data/lib/rservicebus/AppResource/Dir.rb +3 -3
  10. data/lib/rservicebus/AppResource/FluidDb.rb +1 -1
  11. data/lib/rservicebus/AppResource/FluidDbFirebird.rb +1 -1
  12. data/lib/rservicebus/AppResource/FluidDbMysql.rb +4 -4
  13. data/lib/rservicebus/AppResource/FluidDbMysql2.rb +4 -4
  14. data/lib/rservicebus/AppResource/FluidDbPgsql.rb +4 -4
  15. data/lib/rservicebus/AppResource/FluidDbTinyTds.rb +1 -1
  16. data/lib/rservicebus/AppResource/Mysql.rb +2 -2
  17. data/lib/rservicebus/AppResource/Redis.rb +1 -1
  18. data/lib/rservicebus/AppResource/ScpDownload.rb +51 -0
  19. data/lib/rservicebus/AppResource/ScpUpload.rb +3 -2
  20. data/lib/rservicebus/AppResource/Smb.rb +3 -3
  21. data/lib/rservicebus/AppResource/SmbDir.rb +2 -2
  22. data/lib/rservicebus/AppResource/SmbFile.rb +1 -1
  23. data/lib/rservicebus/Audit.rb +9 -9
  24. data/lib/rservicebus/CircuitBreaker.rb +4 -4
  25. data/lib/rservicebus/Config.rb +46 -46
  26. data/lib/rservicebus/ConfigureAppResource.rb +64 -63
  27. data/lib/rservicebus/ConfigureMonitor.rb +12 -12
  28. data/lib/rservicebus/ConfigureSubscriptionStorage.rb +5 -5
  29. data/lib/rservicebus/CronManager.rb +8 -8
  30. data/lib/rservicebus/EndpointMapping.rb +11 -11
  31. data/lib/rservicebus/HandlerLoader.rb +33 -33
  32. data/lib/rservicebus/HandlerManager.rb +2 -2
  33. data/lib/rservicebus/Host.rb +58 -58
  34. data/lib/rservicebus/MQ.rb +21 -21
  35. data/lib/rservicebus/MQ/Beanstalk.rb +9 -9
  36. data/lib/rservicebus/MQ/RabbitMq.rb +5 -5
  37. data/lib/rservicebus/MQ/Redis.rb +3 -3
  38. data/lib/rservicebus/Message.rb +11 -11
  39. data/lib/rservicebus/Monitor.rb +5 -5
  40. data/lib/rservicebus/Monitor/CsvDir.rb +5 -5
  41. data/lib/rservicebus/Monitor/CsvPerLine.rb +5 -5
  42. data/lib/rservicebus/Monitor/Dir.rb +34 -34
  43. data/lib/rservicebus/Monitor/DirNotifier.rb +15 -15
  44. data/lib/rservicebus/ResourceManager.rb +2 -2
  45. data/lib/rservicebus/Saga/Manager.rb +18 -18
  46. data/lib/rservicebus/SagaLoader.rb +19 -19
  47. data/lib/rservicebus/SagaStorage.rb +4 -4
  48. data/lib/rservicebus/SagaStorage/Dir.rb +12 -12
  49. data/lib/rservicebus/SendAtManager.rb +4 -4
  50. data/lib/rservicebus/SendAtStorage.rb +5 -5
  51. data/lib/rservicebus/SendAtStorage/File.rb +3 -3
  52. data/lib/rservicebus/StateManager.rb +2 -2
  53. data/lib/rservicebus/StateStorage.rb +2 -2
  54. data/lib/rservicebus/StateStorage/Dir.rb +11 -11
  55. data/lib/rservicebus/StateStorage/InMemory.rb +1 -1
  56. data/lib/rservicebus/StatisticManager.rb +2 -2
  57. data/lib/rservicebus/SubscriptionManager.rb +2 -2
  58. data/lib/rservicebus/SubscriptionStorage.rb +4 -4
  59. data/lib/rservicebus/SubscriptionStorage/File.rb +3 -3
  60. data/lib/rservicebus/SubscriptionStorage/Redis.rb +10 -10
  61. data/lib/rservicebus/Test.rb +2 -2
  62. data/lib/rservicebus/Test/Bus.rb +2 -2
  63. data/lib/rservicebus/Test/Redis.rb +1 -1
  64. data/lib/rservicebus/Transporter.rb +15 -15
  65. data/lib/rservicebus/helper_functions.rb +15 -15
  66. metadata +13 -12
@@ -1,6 +1,6 @@
1
1
  module RServiceBus
2
2
 
3
- require "FluidDb/Pgsql"
3
+ require 'FluidDb/Pgsql'
4
4
 
5
5
  #Implementation of an AppResource - Redis
6
6
  class AppResource_FluidDbPgsql<AppResource
@@ -11,17 +11,17 @@ module RServiceBus
11
11
 
12
12
  # Transaction Semantics
13
13
  def Begin
14
- @connection.execute( "BEGIN", [] )
14
+ @connection.execute( 'BEGIN', [] )
15
15
  end
16
16
 
17
17
  # Transaction Semantics
18
18
  def Commit
19
- @connection.execute( "COMMIT", [] )
19
+ @connection.execute( 'COMMIT', [] )
20
20
  end
21
21
 
22
22
  # Transaction Semantics
23
23
  def Rollback
24
- @connection.execute( "ROLLBACK", [] )
24
+ @connection.execute( 'ROLLBACK', [] )
25
25
  end
26
26
 
27
27
  end
@@ -1,6 +1,6 @@
1
1
  module RServiceBus
2
2
 
3
- require "FluidDb/TinyTds"
3
+ require 'FluidDb/TinyTds'
4
4
 
5
5
  #Implementation of an AppResource - Redis
6
6
  class AppResource_FluidDbTinyTds<AppResource
@@ -1,13 +1,13 @@
1
1
  module RServiceBus
2
2
 
3
- require "mysql2"
3
+ require 'mysql2'
4
4
 
5
5
  #Implementation of an AppResource - Redis
6
6
  class AppResource_Mysql<AppResource
7
7
 
8
8
  def connect(uri)
9
9
  return Mysql2::Client.new(:host => uri.host,
10
- :database => uri.path.sub( "/", "" ),
10
+ :database => uri.path.sub( '/', ''),
11
11
  :username => uri.user )
12
12
  end
13
13
 
@@ -1,6 +1,6 @@
1
1
  module RServiceBus
2
2
 
3
- require "redis"
3
+ require 'redis'
4
4
 
5
5
  #Implementation of an AppResource - Redis
6
6
  class AppResource_Redis<AppResource
@@ -0,0 +1,51 @@
1
+ require 'net/scp'
2
+ require 'net/sftp'
3
+
4
+ module RServiceBus
5
+
6
+ class ScpDownloadHelper
7
+ attr_reader :uri
8
+
9
+ def initialize( uri )
10
+ @uri = uri
11
+ end
12
+
13
+ def download( destination )
14
+ RServiceBus.log "Host: #{@uri.host}, User: #{@uri.user}, Source: #{@uri.path}, Destination: #{destination}", true
15
+ Net::SCP.start( @uri.host, @uri.user ) do |scp|
16
+ scp.download( @uri.path, destination, :recursive => true )
17
+ end
18
+ end
19
+
20
+ def close
21
+ end
22
+
23
+ def delete( filepattern )
24
+ RServiceBus.log "Host: #{@uri.host}, User: #{@uri.user}, File Pattern: #{filepattern}, Source: #{@uri.path}", true
25
+ regexp = Regexp.new filepattern unless filepattern.nil?
26
+
27
+ Net::SSH.start( @uri.host, @uri.user ) do |ssh|
28
+ ssh.sftp.connect do |sftp|
29
+ sftp.dir.foreach(@uri.path) do |entry|
30
+ next if entry.name == '.' || entry.name == '..'
31
+ if filepattern.nil? || entry.name =~ regexp then
32
+ puts "#{@uri.path}/#{entry.name}"
33
+ r = sftp.remove("#{@uri.path}/#{entry.name}")
34
+ r.wait
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+
42
+ class AppResource_ScpDownload<AppResource
43
+
44
+ def connect(uri)
45
+ return ScpDownloadHelper.new( uri )
46
+
47
+ return inputDir;
48
+ end
49
+
50
+ end
51
+ end
@@ -25,11 +25,12 @@ module RServiceBus
25
25
 
26
26
  def delete( path, filepattern )
27
27
  RServiceBus.log "Host: #{@uri.host}, User: #{@uri.user}, File Pattern: #{filepattern}, Destination: #{@uri.path}", true
28
- regexp = Regexp.new filepattern
28
+ regexp = Regexp.new filepattern unless filepattern.nil?
29
29
  Net::SSH.start( @uri.host, @uri.user ) do |ssh|
30
30
  ssh.sftp.connect do |sftp|
31
31
  sftp.dir.foreach(path) do |entry|
32
- if entry.name =~ regexp then
32
+ next if entry.name == '.' || entry.name == '..'
33
+ if filepattern.nil? || entry.name =~ regexp then
33
34
  r = sftp.remove("#{path}/#{entry.name}")
34
35
  r.wait
35
36
  end
@@ -1,5 +1,5 @@
1
1
  module RServiceBus
2
- require "net/smb"
2
+ require 'net/smb'
3
3
 
4
4
 
5
5
  class AppResource_Smb<AppResource
@@ -7,10 +7,10 @@ require "net/smb"
7
7
  def processUri
8
8
  host = @uri.host
9
9
 
10
- parts = @uri.path.split( "/" )
10
+ parts = @uri.path.split('/')
11
11
  parts.shift
12
12
  share = parts.shift
13
- path = parts.join( "/" )
13
+ path = parts.join('/')
14
14
 
15
15
  @clean_path = "smb://#{host}/#{share}/#{URI.decode(path)}"
16
16
 
@@ -1,12 +1,12 @@
1
1
  module RServiceBus
2
2
 
3
- require "rservicebus/AppResource/Smb"
3
+ require 'rservicebus/AppResource/Smb'
4
4
 
5
5
  class AppResource_SmbDir<AppResource_Smb
6
6
 
7
7
  def connect(uri)
8
8
  self.processUri
9
- remote = SMB.opendir( s, "b" )
9
+ remote = SMB.opendir( s, 'b')
10
10
  return remote
11
11
  end
12
12
 
@@ -1,6 +1,6 @@
1
1
  module RServiceBus
2
2
 
3
- require "rservicebus/AppResource/Smb"
3
+ require 'rservicebus/AppResource/Smb'
4
4
 
5
5
  class AppResource_SmbFile<AppResource_Smb
6
6
 
@@ -4,10 +4,10 @@ class Audit
4
4
 
5
5
  def initialize( mq )
6
6
  @mq = mq
7
- auditQueueName = RServiceBus.getValue( "AUDIT_QUEUE_NAME" )
7
+ auditQueueName = RServiceBus.getValue('AUDIT_QUEUE_NAME')
8
8
  if auditQueueName.nil? then
9
- @forwardSentMessagesTo = RServiceBus.getValue( "FORWARD_SENT_MESSAGES_TO" )
10
- @forwardReceivedMessagesTo = RServiceBus.getValue( "FORWARD_RECEIVED_MESSAGES_TO" )
9
+ @forwardSentMessagesTo = RServiceBus.getValue('FORWARD_SENT_MESSAGES_TO')
10
+ @forwardReceivedMessagesTo = RServiceBus.getValue('FORWARD_RECEIVED_MESSAGES_TO')
11
11
  else
12
12
  @forwardSentMessagesTo = auditQueueName
13
13
  @forwardReceivedMessagesTo = auditQueueName
@@ -19,14 +19,14 @@ class Audit
19
19
  end
20
20
 
21
21
  def auditOutgoing( obj )
22
- if !@forwardSentMessagesTo.nil? then
23
- self.auditToQueue( obj )
24
- end
22
+ unless @forwardSentMessagesTo.nil? then
23
+ self.auditToQueue(obj)
24
+ end
25
25
  end
26
26
  def auditIncoming( obj )
27
- if !@forwardReceivedMessagesTo.nil? then
28
- self.auditToQueue( obj )
29
- end
27
+ unless @forwardReceivedMessagesTo.nil? then
28
+ self.auditToQueue(obj)
29
+ end
30
30
  end
31
31
 
32
32
 
@@ -21,10 +21,10 @@ module RServiceBus
21
21
 
22
22
  def initialize( host )
23
23
  @host = host
24
- @maxNumberOfFailures = RServiceBus.getValue( "RSBCB_MAX", 5 )
25
- @secondsToBreak = RServiceBus.getValue( "RSBCB_SECONDS_TO_BREAK", 60 ).to_i
26
- @secondsToReset = RServiceBus.getValue( "RSBCB_SECONDS_TO_RESET", 60 ).to_i
27
- @resetOnSuccess = RServiceBus.getValue( "RSBCB_RESET_ON_SUCCESS", false )
24
+ @maxNumberOfFailures = RServiceBus.getValue( 'RSBCB_MAX', 5 )
25
+ @secondsToBreak = RServiceBus.getValue( 'RSBCB_SECONDS_TO_BREAK', 60 ).to_i
26
+ @secondsToReset = RServiceBus.getValue( 'RSBCB_SECONDS_TO_RESET', 60 ).to_i
27
+ @resetOnSuccess = RServiceBus.getValue( 'RSBCB_RESET_ON_SUCCESS', false )
28
28
 
29
29
  self.reset
30
30
  end
@@ -19,9 +19,9 @@ module RServiceBus
19
19
  @mq
20
20
 
21
21
  def initialize()
22
- puts "Cannot instantiate config directly."
23
- puts "For production, use ConfigFromEnv."
24
- puts "For debugging or testing, you could try ConfigFromSetter"
22
+ puts 'Cannot instantiate config directly.'
23
+ puts 'For production, use ConfigFromEnv.'
24
+ puts 'For debugging or testing, you could try ConfigFromSetter'
25
25
  abort()
26
26
  end
27
27
 
@@ -30,7 +30,7 @@ module RServiceBus
30
30
  end
31
31
 
32
32
  def getValue( name, default=nil )
33
- value = ( ENV[name].nil? || ENV[name] == "" ) ? default : ENV[name];
33
+ value = ( ENV[name].nil? || ENV[name] == '') ? default : ENV[name];
34
34
  log "Env value: #{name}: #{value}"
35
35
  return value
36
36
  end
@@ -42,10 +42,10 @@ module RServiceBus
42
42
  #Expected format;
43
43
  # <path 1>;<path 2>
44
44
  def loadHandlerPathList()
45
- path = self.getValue( "MSGHANDLERPATH", "./MessageHandler" )
45
+ path = self.getValue( 'MSGHANDLERPATH', './MessageHandler')
46
46
  @handlerPathList = Array.new
47
- path.split( ";" ).each do |path|
48
- path = path.strip.chomp( "/" )
47
+ path.split(';').each do |path|
48
+ path = path.strip.chomp('/')
49
49
  @handlerPathList << path
50
50
  end
51
51
 
@@ -53,10 +53,10 @@ module RServiceBus
53
53
  end
54
54
 
55
55
  def loadSagaPathList()
56
- path = self.getValue( "SAGAPATH", "./Saga" )
56
+ path = self.getValue( 'SAGAPATH', './Saga')
57
57
  @sagaPathList = Array.new
58
- path.split( ";" ).each do |path|
59
- path = path.strip.chomp( "/" )
58
+ path.split(';').each do |path|
59
+ path = path.strip.chomp('/')
60
60
  @sagaPathList << path
61
61
  end
62
62
 
@@ -64,16 +64,16 @@ module RServiceBus
64
64
  end
65
65
 
66
66
  def loadHostSection()
67
- @appName = self.getValue( "APPNAME", "RServiceBus" )
68
- @errorQueueName = self.getValue( "ERROR_QUEUE_NAME", "error" )
69
- @maxRetries = self.getValue( "MAX_RETRIES", "5" ).to_i
70
- @statOutputCountdown = self.getValue( "STAT_OUTPUT_COUNTDOWN", "100" ).to_i
71
- @subscriptionUri = self.getValue( "SUBSCRIPTION_URI", "file:///tmp/#{appName}_subscriptions.yaml" )
67
+ @appName = self.getValue( 'APPNAME', 'RServiceBus')
68
+ @errorQueueName = self.getValue( 'ERROR_QUEUE_NAME', 'error')
69
+ @maxRetries = self.getValue( 'MAX_RETRIES', '5').to_i
70
+ @statOutputCountdown = self.getValue( 'STAT_OUTPUT_COUNTDOWN', '100').to_i
71
+ @subscriptionUri = self.getValue( 'SUBSCRIPTION_URI', "file:///tmp/#{appName}_subscriptions.yaml" )
72
72
 
73
- auditQueueName = self.getValue( "AUDIT_QUEUE_NAME" )
73
+ auditQueueName = self.getValue('AUDIT_QUEUE_NAME')
74
74
  if auditQueueName.nil? then
75
- @forwardSentMessagesTo = self.getValue( "FORWARD_SENT_MESSAGES_TO" )
76
- @forwardReceivedMessagesTo = self.getValue( "FORWARD_RECEIVED_MESSAGES_TO" )
75
+ @forwardSentMessagesTo = self.getValue('FORWARD_SENT_MESSAGES_TO')
76
+ @forwardReceivedMessagesTo = self.getValue('FORWARD_RECEIVED_MESSAGES_TO')
77
77
  else
78
78
  @forwardSentMessagesTo = auditQueueName
79
79
  @forwardReceivedMessagesTo = auditQueueName
@@ -83,17 +83,17 @@ module RServiceBus
83
83
  end
84
84
 
85
85
  def ensureContractFileExists( path )
86
- if !( File.exists?( path ) ||
87
- File.exists?( "#{path}.rb" ) ) then
88
- puts "Error while processing contracts"
89
- puts "*** path, #{path}, provided does not exist as a file"
90
- abort()
86
+ unless File.exists?(path) ||
87
+ File.exists?("#{path}.rb") then
88
+ puts 'Error while processing contracts'
89
+ puts "*** path, #{path}, provided does not exist as a file"
90
+ abort()
91
91
  end
92
- if !( File.extname( path ) == "" ||
93
- File.extname( path ) == ".rb" ) then
94
- puts "Error while processing contracts"
95
- puts "*** path, #{path}, should point to a ruby file, with extention .rb"
96
- abort()
92
+ unless File.extname(path) == "" ||
93
+ File.extname(path) == ".rb" then
94
+ puts 'Error while processing contracts'
95
+ puts "*** path, #{path}, should point to a ruby file, with extention .rb"
96
+ abort()
97
97
  end
98
98
  end
99
99
 
@@ -108,11 +108,11 @@ module RServiceBus
108
108
 
109
109
  #This is a guard clause in case no Contracts have been specified
110
110
  #If any guard clauses have been specified, then execution should drop to the second block
111
- if self.getValue( "CONTRACTS" ).nil? then
111
+ if self.getValue('CONTRACTS').nil? then
112
112
  return self
113
113
  end
114
114
 
115
- self.getValue( "CONTRACTS", "./Contract" ).split( ";" ).each do |path|
115
+ self.getValue( 'CONTRACTS', './Contract').split(';').each do |path|
116
116
  self.ensureContractFileExists( path )
117
117
  @contractList << path
118
118
  end
@@ -128,19 +128,19 @@ module RServiceBus
128
128
  def loadLibs()
129
129
  @libList = Array.new
130
130
 
131
- path = self.getValue( "LIB" )
132
- path = "./lib" if path.nil? and File.exists?( "./lib" )
131
+ path = self.getValue('LIB')
132
+ path = './lib' if path.nil? and File.exists?('./lib')
133
133
  if path.nil? then
134
134
  return self
135
135
  end
136
136
 
137
- path.split( ";" ).each do |path|
137
+ path.split(';').each do |path|
138
138
  log "Loading libs from, #{path}"
139
- if !File.exists?( path ) then
140
- puts "Error while processing libs"
141
- puts "*** path, #{path}, should point to a ruby file, with extention .rb, or"
142
- puts "*** path, #{path}, should point to a directory than conatins ruby files, that have extention .rb"
143
- abort()
139
+ unless File.exists?(path) then
140
+ puts 'Error while processing libs'
141
+ puts "*** path, #{path}, should point to a ruby file, with extention .rb, or"
142
+ puts "*** path, #{path}, should point to a directory than conatins ruby files, that have extention .rb"
143
+ abort()
144
144
  end
145
145
  @libList << path
146
146
  end
@@ -148,7 +148,7 @@ module RServiceBus
148
148
  end
149
149
 
150
150
  def configureMq
151
- @mqHost = self.getValue( "MQ", "beanstalk://localhost" )
151
+ @mqHost = self.getValue( 'MQ', 'beanstalk://localhost')
152
152
  return self
153
153
  end
154
154
 
@@ -159,17 +159,17 @@ module RServiceBus
159
159
  #Expected format;
160
160
  # <path 1>;<path 2>
161
161
  def loadWorkingDirList()
162
- pathList = self.getValue( "WORKING_DIR" )
162
+ pathList = self.getValue('WORKING_DIR')
163
163
  return self if pathList.nil?
164
164
 
165
- pathList.split( ";" ).each do |path|
165
+ pathList.split(';').each do |path|
166
166
 
167
- path = path.strip.chomp( "/" )
167
+ path = path.strip.chomp('/')
168
168
 
169
- if !Dir.exists?( "#{path}" ) then
170
- puts "Error while processing working directory list"
171
- puts "*** path, #{path}, does not exist"
172
- next
169
+ unless Dir.exists?("#{path}") then
170
+ puts 'Error while processing working directory list'
171
+ puts "*** path, #{path}, does not exist"
172
+ next
173
173
  end
174
174
 
175
175
  if Dir.exists?( "#{path}/MessageHandler" ) then
@@ -1,71 +1,72 @@
1
1
  module RServiceBus
2
-
3
- require "uri"
4
-
5
- #Configure AppResources for an rservicebus host
6
- class ConfigureAppResource
2
+ require 'uri'
3
+ #Configure AppResources for an rservicebus host
4
+ class ConfigureAppResource
7
5
 
8
- def getResources( env, host, stateManager, sagaStorage )
9
- resourceManager = ResourceManager.new( stateManager, sagaStorage )
6
+ def getResources( env, host, stateManager, sagaStorage )
7
+ resourceManager = ResourceManager.new( stateManager, sagaStorage )
10
8
 
11
9
 
12
- env.each do |k,v|
13
- if v.is_a?(String) and
14
- k.start_with?( "RSBFDB_" ) then
15
- uri = URI.parse( v )
16
- require "rservicebus/AppResource/FluidDb"
17
- resourceManager.add k.sub( "RSBFDB_", "" ), AppResource_FluidDb.new( host, uri )
18
- elsif v.is_a?(String) and
19
- k.start_with?( "RSB_" ) then
20
- uri = URI.parse( v )
21
- case uri.scheme
22
- when "redis"
23
- require "rservicebus/AppResource/Redis"
24
- resourceManager.add k.sub( "RSB_", "" ), AppResource_Redis.new( host, uri )
25
-
26
- when "mysql"
27
- require "rservicebus/AppResource/Mysql"
28
- resourceManager.add k.sub( "RSB_", "" ), AppResource_Mysql.new( host, uri )
29
-
30
- when "fluiddbmysql"
31
- require "rservicebus/AppResource/FluidDbMysql"
32
- resourceManager.add k.sub( "RSB_", "" ), AppResource_FluidDbMysql.new( host, uri )
33
- when "fluiddbmysql2"
34
- require "rservicebus/AppResource/FluidDbMysql2"
35
- resourceManager.add k.sub( "RSB_", "" ), AppResource_FluidDbMysql2.new( host, uri )
36
- when "fluiddbpgsql"
37
- require "rservicebus/AppResource/FluidDbPgsql"
38
- resourceManager.add k.sub( "RSB_", "" ), AppResource_FluidDbPgsql.new( host, uri )
39
- when "fluiddbtinytds"
40
- require "rservicebus/AppResource/FluidDbTinyTds"
41
- resourceManager.add k.sub( "RSB_", "" ), AppResource_FluidDbTinyTds.new( host, uri )
10
+ env.each do |k,v|
11
+ if v.is_a?(String) and
12
+ k.start_with?('RSBFDB_') then
13
+ uri = URI.parse( v )
14
+ require 'rservicebus/AppResource/FluidDb'
15
+ resourceManager.add k.sub( 'RSBFDB_', ''), AppResource_FluidDb.new( host, uri )
16
+ elsif v.is_a?(String) and
17
+ k.start_with?('RSB_') then
18
+ uri = URI.parse( v )
19
+ case uri.scheme
20
+ when 'redis'
21
+ require 'rservicebus/AppResource/Redis'
22
+ resourceManager.add k.sub( 'RSB_', ''), AppResource_Redis.new( host, uri )
42
23
 
43
- when "fluiddbfirebird"
44
- require "rservicebus/AppResource/FluidDbFirebird"
45
- resourceManager.add k.sub( "RSB_", "" ), AppResource_FluidDbFirebird.new( host, uri )
46
-
47
- when "dir"
48
- require "rservicebus/AppResource/Dir"
49
- resourceManager.add k.sub( "RSB_", "" ), AppResource_Dir.new( host, uri )
50
- when "file"
51
- require "rservicebus/AppResource/File"
52
- resourceManager.add k.sub( "RSB_", "" ), AppResource_File.new( host, uri )
53
- when "scpupload"
54
- require "rservicebus/AppResource/ScpUpload"
55
- resourceManager.add k.sub( "RSB_", "" ), AppResource_ScpUpload.new( host, uri )
56
- when "smbfile"
57
- require "rservicebus/AppResource/SmbFile"
58
- resourceManager.add k.sub( "RSB_", "" ), AppResource_SmbFile.new( host, uri )
59
- else
60
- abort("Scheme, #{uri.scheme}, not recognised when configuring app resource, #{k}=#{v}");
61
- end
62
- end
63
-
64
- end
65
-
66
- return resourceManager
24
+ when 'mysql'
25
+ require 'rservicebus/AppResource/Mysql'
26
+ resourceManager.add k.sub( 'RSB_', ''), AppResource_Mysql.new( host, uri )
27
+
28
+ when 'fluiddbmysql'
29
+ require 'rservicebus/AppResource/FluidDbMysql'
30
+ resourceManager.add k.sub( 'RSB_', ''), AppResource_FluidDbMysql.new( host, uri )
31
+ when 'fluiddbmysql2'
32
+ require 'rservicebus/AppResource/FluidDbMysql2'
33
+ resourceManager.add k.sub( 'RSB_', ''), AppResource_FluidDbMysql2.new( host, uri )
34
+ when 'fluiddbpgsql'
35
+ require 'rservicebus/AppResource/FluidDbPgsql'
36
+ resourceManager.add k.sub( 'RSB_', ''), AppResource_FluidDbPgsql.new( host, uri )
37
+ when 'fluiddbtinytds'
38
+ require 'rservicebus/AppResource/FluidDbTinyTds'
39
+ resourceManager.add k.sub( 'RSB_', ''), AppResource_FluidDbTinyTds.new( host, uri )
40
+
41
+ when 'fluiddbfirebird'
42
+ require 'rservicebus/AppResource/FluidDbFirebird'
43
+ resourceManager.add k.sub( 'RSB_', ''), AppResource_FluidDbFirebird.new( host, uri )
44
+
45
+ when 'dir'
46
+ require 'rservicebus/AppResource/Dir'
47
+ resourceManager.add k.sub( 'RSB_', ''), AppResource_Dir.new( host, uri )
48
+ when 'file'
49
+ require 'rservicebus/AppResource/File'
50
+ resourceManager.add k.sub( 'RSB_', ''), AppResource_File.new( host, uri )
51
+ when 'scpdownload'
52
+ require 'rservicebus/AppResource/ScpDownload'
53
+ resourceManager.add k.sub( 'RSB_', '' ), AppResource_ScpDownload.new( host, uri )
54
+ when 'scpupload'
55
+ require 'rservicebus/AppResource/ScpUpload'
56
+ resourceManager.add k.sub( 'RSB_', ''), AppResource_ScpUpload.new( host, uri )
57
+ when 'smbfile'
58
+ require 'rservicebus/AppResource/SmbFile'
59
+ resourceManager.add k.sub( 'RSB_', ''), AppResource_SmbFile.new( host, uri )
60
+ else
61
+ abort("Scheme, #{uri.scheme}, not recognised when configuring app resource, #{k}=#{v}");
62
+ end
67
63
  end
68
-
64
+
65
+ end
66
+
67
+ return resourceManager
69
68
  end
70
-
69
+
70
+ end
71
+
71
72
  end