Corrected concurrency issues with JRuby

This commit is contained in:
David Turanski
2011-09-27 21:23:04 -04:00
committed by Mark Fisher
parent f78d6021a8
commit a5ac75ea43
7 changed files with 70 additions and 78 deletions

View File

@@ -67,7 +67,7 @@ public class Jsr223RefreshTests {
private static class CycleResource extends AbstractResource {
private int count = -1;
private String[] scripts = {"\"ruby-#{$payload}-0\"", "\"ruby-#{$payload}-1\""};
private String[] scripts = {"\"ruby-#{payload}-0\"", "\"ruby-#{payload}-1\""};
public String getDescription() {
return "CycleResource";

View File

@@ -33,7 +33,7 @@
<service-activator input-channel="inlineScriptInput">
<script:script lang="ruby">
<![CDATA[
"inline-#{$payload}"
"inline-#{payload}"
]]>
</script:script>
</service-activator>

View File

@@ -10,7 +10,7 @@
<service-activator input-channel="inlineScriptInput">
<script:script lang="ruby">
<![CDATA[
return "inline-#{$payload}-" + "#{$foo}" + " - " + $bar + " - " + $date
return "inline-#{payload}-" + "#{foo}" + " - " + bar + " - " + date
]]>
<script:variable name="foo" value="foo"/>
<script:variable name="bar" value="bar"/>

View File

@@ -1 +1 @@
"ruby-#{$payload}-#{$foo} - #{$bar} - #{$date}"
"ruby-#{payload}-#{foo} - #{bar} - #{date}"

View File

@@ -2,7 +2,6 @@ class Transformer
def transform(payload)
"ruby-#{payload}"
end
end
Transformer.new.transform($payload)
Transformer.new.transform(payload)

View File

@@ -1,12 +1,12 @@
include Java
require "java"
include_class 'java.util.Date'
#payload and headers a global variable
if $payload
$payload = $payload+" modified #{Date.new}"
if payload
payload = payload+" modified #{Date.new}"
end
puts $payload
if $headers
$headers.each {|key, value| puts "#{key} is #{value}" }
puts payload
if headers
headers.each {|key, value| puts "#{key} is #{value}" }
end
puts "#{$one} #{$two} #{$three}"
$payload
payload