judcon 2010 boston : torquebox
DESCRIPTION
Presented by Bob McWhirter at JUDCon 2010 in Boston.TRANSCRIPT
![Page 1: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/1.jpg)
TorqueBoxMixing Java and Ruby all willy-nilly
Bob McWhirterJBoss Fellow
![Page 2: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/2.jpg)
TorqueBoxMixing Java and Ruby all willy-nilly
Bob McWhirterJBoss Fellow
![Page 3: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/3.jpg)
Who is Bob?• JBoss Fellow• Chief Architect of Middleware Cloud Computing
• Founder of...• The Codehaus• Drools • TorqueBox
![Page 4: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/4.jpg)
Basic Premise
• You can run Ruby in the JVM• Compliant• Fast
• You can wire existing enterprise Java features into Ruby
![Page 5: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/5.jpg)
Why?
•Ruby has a lot of varied point solutions.•Traditionally web-centric frameworks.•Performance issues.
![Page 6: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/6.jpg)
What exactly is TorqueBox?
![Page 7: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/7.jpg)
JBoss AS6 TorqueBox Deployers JRuby
![Page 8: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/8.jpg)
JBoss AS6++
Just as good as regular JBoss AS6, plus the goodness of a Ruby platform.
![Page 9: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/9.jpg)
Ruby Platform
• Ruby Rack (1.1.0)• JNDI• JMS (HornetQ)• Quartz• VFS
![Page 10: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/10.jpg)
Rack for Web
All Rack applications are supported.
Rails, Sinatra, bare Rack apps.
![Page 11: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/11.jpg)
Rack for Web
Applications can be deployed from where-ever they sit on disk.
No bundling/jarring is required.
![Page 12: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/12.jpg)
Rack for Web
Using Rack reloading extensions, or Rails’ own development mode, applications can be modified while running.
Without redeploying.
![Page 13: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/13.jpg)
Deploying Rails apps
--- application: RAILS_ROOT: /Users/bob/applications/my_app RAILS_ENV: developmentweb: context: /
$JBOSS_HOME/server/default/deploy/myapp-rails.yml
![Page 14: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/14.jpg)
(But you can bundle)
jar cvf myapp.rails -C myapp/ .
![Page 15: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/15.jpg)
Everything else
Due to lack of specs/standards, we’ve invented our own APIs for bindings to JNDI, JMS, Quartz, etc.
![Page 16: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/16.jpg)
Messaging
/queues/foo: durable: true
/queues/bar: durable: false
queues.yml
![Page 17: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/17.jpg)
Messaging
subscribe MyConsumer, '/queues/foo', :filter=>'...', :config=>{ :answer=>42 }
messaging.tq
![Page 18: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/18.jpg)
In a Rails app...
app/ processors/ my_consumer.rbconfig/ messaging.tq queues.yml topics.yml
deploy/ queues.yml topics.yml
Either
![Page 19: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/19.jpg)
MyConsumer
class MyConsumer < TorqueBox::Message::MessageProcessor
def on_message(body) puts "Processing #{body}” end
end
my_consumer.rb
![Page 20: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/20.jpg)
MyConsumer #2
class MyConsumer
def process!(jms_message) puts "Processing #{jms_message.body}” end
end
my_consumer.rb
![Page 21: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/21.jpg)
MyConsumer #3
class MyConsumer < TorqueBox::Message::MessageProcessor
def on_message(body) puts "Processing #{body} of #{message}” end
end
my_consumer.rb
![Page 22: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/22.jpg)
A client
#!/usr/bin/env jruby
require 'torquebox/messaging/client'
TorqueBox::Messaging::Client.connect( true, :auto, 'localhost' ) do |session| queue = session.createQueue( '/queues/foo' ) producer = session.createProducer( queue ) message = session.createTextMessage( "hello #{Time.now}" ) producer.send( message ) session.commit end
my_client.rb
![Page 23: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/23.jpg)
A client
#!/usr/bin/env jruby
require 'torquebox/messaging/client'
TorqueBox::Messaging::Client.connect( true, :auto, 'localhost' ) do |session| queue = session.createQueue( '/queues/foo' ) producer = session.createProducer( queue ) message = session.createTextMessage( "hello #{Time.now}" ) producer.send( message ) session.commit end
my_client.rb
![Page 24: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/24.jpg)
A client
#!/usr/bin/env jruby
require 'torquebox/messaging/client'
TorqueBox::Messaging::Client.connect( true, :auto, 'localhost' ) do |session| queue = session.createQueue( '/queues/foo' ) producer = session.createProducer( queue ) message = session.createTextMessage( "hello #{Time.now}" ) producer.send( message ) session.commit end
my_client.rb
![Page 25: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/25.jpg)
A client
#!/usr/bin/env jruby
require 'torquebox/messaging/client'
TorqueBox::Messaging::Client.connect( true, :auto, 'localhost' ) do |session| queue = session.createQueue( '/queues/foo' ) producer = session.createProducer( queue ) message = session.createTextMessage( "hello #{Time.now}" ) producer.send( message ) session.commit end
my_client.rb
![Page 26: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/26.jpg)
A client
#!/usr/bin/env jruby
require 'torquebox/messaging/client'
TorqueBox::Messaging::Client.connect( true, :auto, 'localhost' ) do |session| queue = session.createQueue( '/queues/foo' ) producer = session.createProducer( queue ) message = session.createTextMessage( "hello #{Time.now}" ) producer.send( message ) session.commit end
my_client.rb
![Page 27: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/27.jpg)
What if I just want a farm of processors, not lots of
full AS instances?
![Page 28: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/28.jpg)
JBossMC + VDF TorqueBox Deployers JRuby
![Page 29: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/29.jpg)
Messaging outside of AS
trq-message-broker
• Ruby API for firing up HornetQ
trq-message-processor-host
• Container for processors.
![Page 30: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/30.jpg)
trq-message-broker
$ trq-message-broker -s \ --deploy queues.yml
![Page 31: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/31.jpg)
trq-message-processor-host
$ trq-message-processor-host \ -N naming.foocorp.com \ --deploy messaging.tq
![Page 32: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/32.jpg)
What’s going on?
![Page 33: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/33.jpg)
JBossMC and Ruby
•Andrew Lee Rubinger’s bootstrap-vdf-minimal
•Large-grained “enablers”•All from Ruby
![Page 34: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/34.jpg)
Foundation
require 'torquebox/container/foundation'
container = TorqueBox::Container::Foundation.new
container.start
![Page 35: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/35.jpg)
Foundation jboss-beans<deployment xmlns="urn:jboss:bean-deployer:2.0">
<bean name="Ruby" class="org.jruby.Ruby"> <constructor factoryClass="org.jruby.Ruby" factoryMethod="getGlobalRuntime"/> </bean>
<bean name="JRubyClassLoader"> <constructor factoryMethod="getJRubyClassLoader"> <factory bean="Ruby"/> </constructor> </bean>
<bean name="RubyRuntimeFactory" class="org.torquebox.interp.core.SingletonRubyRuntimeFactory"> <property name="ruby"> <inject bean="Ruby"/> </property> </bean>
<bean name="RuntimePoolDeployer" class="org.torquebox.interp.deployers.RuntimePoolDeployer"/>
</deployment>
![Page 36: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/36.jpg)
Foundation jboss-beans<deployment xmlns="urn:jboss:bean-deployer:2.0">
<bean name="Ruby" class="org.jruby.Ruby"> <constructor factoryClass="org.jruby.Ruby" factoryMethod="getGlobalRuntime"/> </bean>
<bean name="JRubyClassLoader"> <constructor factoryMethod="getJRubyClassLoader"> <factory bean="Ruby"/> </constructor> </bean>
<bean name="RubyRuntimeFactory" class="org.torquebox.interp.core.SingletonRubyRuntimeFactory"> <property name="ruby"> <inject bean="Ruby"/> </property> </bean>
<bean name="RuntimePoolDeployer" class="org.torquebox.interp.deployers.RuntimePoolDeployer"/>
</deployment>
![Page 37: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/37.jpg)
Foundation jboss-beans<deployment xmlns="urn:jboss:bean-deployer:2.0">
<bean name="Ruby" class="org.jruby.Ruby"> <constructor factoryClass="org.jruby.Ruby" factoryMethod="getGlobalRuntime"/> </bean>
<bean name="JRubyClassLoader"> <constructor factoryMethod="getJRubyClassLoader"> <factory bean="Ruby"/> </constructor> </bean>
<bean name="RubyRuntimeFactory" class="org.torquebox.interp.core.SingletonRubyRuntimeFactory"> <property name="ruby"> <inject bean="Ruby"/> </property> </bean>
<bean name="RuntimePoolDeployer" class="org.torquebox.interp.deployers.RuntimePoolDeployer"/>
</deployment>
![Page 38: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/38.jpg)
Foundation jboss-beans<deployment xmlns="urn:jboss:bean-deployer:2.0">
<bean name="Ruby" class="org.jruby.Ruby"> <constructor factoryClass="org.jruby.Ruby" factoryMethod="getGlobalRuntime"/> </bean>
<bean name="JRubyClassLoader"> <constructor factoryMethod="getJRubyClassLoader"> <factory bean="Ruby"/> </constructor> </bean>
<bean name="RubyRuntimeFactory" class="org.torquebox.interp.core.SingletonRubyRuntimeFactory"> <property name="ruby"> <inject bean="Ruby"/> </property> </bean>
<bean name="RuntimePoolDeployer" class="org.torquebox.interp.deployers.RuntimePoolDeployer"/>
</deployment>
![Page 39: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/39.jpg)
Message-Processor Host
require 'torquebox/container/foundation'
container = TorqueBox::Container::Foundation.new
container.enable( TorqueBox::Messaging::MessageProcessorHost )
container.start
![Page 40: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/40.jpg)
MPH jboss-beans.xml
<deployment xmlns="urn:jboss:bean-deployer:2.0">
<classloader><inject bean="JRubyClassLoader"/></classloader>
<bean name="MessageProcessorDeployer" class="org.torquebox.messaging.deployers.MessageProcessorDeployer"/> <bean name="MessagingRuntimePoolDeployer" class="org.torquebox.messaging.deployers.MessagingRuntimePoolDeployer"> <property name="instanceFactoryName">RubyRuntimeFactory</property> </bean>
</deployment>
![Page 41: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/41.jpg)
MPH jboss-beans.xml
<deployment xmlns="urn:jboss:bean-deployer:2.0">
<classloader><inject bean="JRubyClassLoader"/></classloader>
<bean name="MessageProcessorDeployer" class="org.torquebox.messaging.deployers.MessageProcessorDeployer"/> <bean name="MessagingRuntimePoolDeployer" class="org.torquebox.messaging.deployers.MessagingRuntimePoolDeployer"> <property name="instanceFactoryName">RubyRuntimeFactory</property> </bean>
</deployment>
![Page 42: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/42.jpg)
MPH jboss-beans.xml
<deployment xmlns="urn:jboss:bean-deployer:2.0">
<classloader><inject bean="JRubyClassLoader"/></classloader>
<bean name="MessageProcessorDeployer" class="org.torquebox.messaging.deployers.MessageProcessorDeployer"/> <bean name="MessagingRuntimePoolDeployer" class="org.torquebox.messaging.deployers.MessagingRuntimePoolDeployer"> <property name="instanceFactoryName">RubyRuntimeFactory</property> </bean>
</deployment>
![Page 43: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/43.jpg)
Pathway
MyConsumer (rb)
RubyMessageListener (Java)
RubyRuntimePool
JMS
Ruby
![Page 44: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/44.jpg)
Naming
A lot of things require JNDI.
![Page 45: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/45.jpg)
Naming
In addition to enabling components, configuration can be included.
![Page 46: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/46.jpg)
Local Naming
container.enable( TorqueBox::Naming::NamingService ) do |config| config.export = falseend
![Page 47: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/47.jpg)
Local Naming
<deployment xmlns="urn:jboss:bean-deployer:2.0">
<bean name="LookupExecutor" class="java.util.concurrent.ThreadPoolExecutor"> <constructor factoryMethod="newFixedThreadPool" factoryClass="java.util.concurrent.Executors"> <parameter>2</parameter> </constructor> <stop method="shutdown"/> </bean>
<bean name="Naming" class="org.jnp.server.NamingBeanImpl"/>
</deployment>
![Page 48: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/48.jpg)
Exported Naming
container.enable( TorqueBox::Naming::NamingService ) do |config| config.host = "my-other-host.foocorp.com" config.port = 10990end
![Page 49: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/49.jpg)
Exported Naming
<deployment xmlns="urn:jboss:bean-deployer:2.0">
<bean name="JNDIServer" class="org.jnp.server.Main"> <property name="namingInfo"> <inject bean="Naming"/> </property> <property name="port">${jnp.port:1099}</property> <property name="bindAddress">${jnp.host:localhost}</property> <property name="rmiPort">${jnp.rmiPort:1098}</property> <property name="rmiBindAddress">${jnp.host:localhost}</property> <property name="lookupExector"> <inject bean="LookupExecutor"/> </property> </bean>
</deployment>
![Page 50: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/50.jpg)
Exported Naming
<deployment xmlns="urn:jboss:bean-deployer:2.0">
<bean name="JNDIServer" class="org.jnp.server.Main"> <property name="namingInfo"> <inject bean="Naming"/> </property> <property name="port">${jnp.port:1099}</property> <property name="bindAddress">${jnp.host:localhost}</property> <property name="rmiPort">${jnp.rmiPort:1098}</property> <property name="rmiBindAddress">${jnp.host:localhost}</property> <property name="lookupExector"> <inject bean="LookupExecutor"/> </property> </bean>
</deployment>
![Page 51: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/51.jpg)
VDF bootstrap allows for TorqueBox bits to be used
in other environments.
![Page 52: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/52.jpg)
Allows us to boot up an absolute minimal AS,
in 1 second.
![Page 53: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/53.jpg)
The same code paths as AS.
![Page 54: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/54.jpg)
JBoss VFS
![Page 55: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/55.jpg)
FS v. VFSRegular FS
home/ bob/ my.jar
VFS
home/ bob/ my.jar/ WEB-INF/ lib/ another.jar/ META-INF/ manifest.xml
mount
mount
![Page 56: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/56.jpg)
Why do we like VFS?
![Page 57: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/57.jpg)
Because there’s more than just the filesystem
![Page 58: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/58.jpg)
The problem with Ruby
__FILE__/path/to/this/file.rb
![Page 59: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/59.jpg)
For Instance...
Dir[ "#{File.dirname(__FILE__)}/*.xml" ]
![Page 60: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/60.jpg)
__FILE__
vfs:/path/to/the/current/file.rb
![Page 61: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/61.jpg)
Making Ruby VFS-aware
Kernel open( "vfs:/path/to/some.jar/some/content.txt" )
Dir Dir[ "vfs:/path/to/some.jar/some/*.txt" ]
File File.exist?( "vfs:/path/to/some.jar/some/content.txt" ) File.read( "vfs:/path/to/some.jar/some/content.txt" )
![Page 62: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/62.jpg)
Now Ruby doesn’t care that your filesystem is actually VFS.
![Page 63: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/63.jpg)
Bundles
We want Ruby to be happy with VFS for when you deploy bundles and hope to farm.
![Page 64: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/64.jpg)
But not warbling
Warbler builds a “normal” JavaEE .war.
![Page 65: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/65.jpg)
So, why bother?
![Page 66: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/66.jpg)
Threading
Unlike C-Ruby, supports real threading.
![Page 67: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/67.jpg)
Management
RHQ/JON, stuff you're used to.
![Page 68: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/68.jpg)
Integration
HornetQ, Quartz, etc, already available to your apps.
![Page 69: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/69.jpg)
Gotchas
![Page 70: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/70.jpg)
Native gems
Native gems are not supported, except FFI.
![Page 71: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/71.jpg)
Threading
While TorqueBox gives you real threads, many existing Ruby libraries suck.
![Page 72: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/72.jpg)
Thanks!
![Page 73: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/73.jpg)
Q&A
![Page 74: JUDCon 2010 Boston : TorqueBox](https://reader034.vdocuments.net/reader034/viewer/2022051817/548c9270b479593d1f8b4845/html5/thumbnails/74.jpg)
Resources
http://github.com/torquebox/ # Codehttp://torquebox.org/ # Project
#torquebox # IRC
@torquebox # Twitter@bobmcwhirter