TorqueBox 3.1.2

org.torquebox.core.runtime
Class DefaultRubyRuntimePool

java.lang.Object
  extended by org.torquebox.core.pool.ManagedPool<org.jruby.Ruby>
      extended by org.torquebox.core.runtime.DefaultRubyRuntimePool
All Implemented Interfaces:
Pool<org.jruby.Ruby>, BasicRubyRuntimePoolMBean, RubyRuntimePool

public class DefaultRubyRuntimePool
extends ManagedPool<org.jruby.Ruby>
implements RubyRuntimePool, BasicRubyRuntimePoolMBean

Ruby interpreter pool of discrete, non-shared interpreters.

This pool supports minimum and maximum sizes, and ensures each client gets a unique interpreter.

Author:
Bob McWhirter

Constructor Summary
DefaultRubyRuntimePool()
           
DefaultRubyRuntimePool(RubyRuntimeFactory factory)
          Construct with a factory.
 
Method Summary
 org.jruby.Ruby borrowRuntime(String requester)
           
 RubyRuntimePool duplicate()
           
 Object evaluate(String code)
           
 Set<String> getAllRuntimeNames()
           
 RubyRuntimeFactory getRubyRuntimeFactory()
          Retrieve the interpreter factory.
 void returnRuntime(org.jruby.Ruby runtime)
           
 
Methods inherited from class org.torquebox.core.pool.ManagedPool
borrowInstance, borrowInstance, getAllInstances, getAvailable, getAvailableInstances, getBorrowed, getBorrowedInstances, getInstanceFactory, getMaximumInstances, getMinimumInstances, getName, getNamespaceContextSelector, getSize, isDeferredUntilRequested, isDrained, isLazy, isStarted, releaseInstance, setDeferUntilRequested, setInstanceFactory, setMaximumInstances, setMinimumInstances, setName, setNamespaceContextSelector, start, startPool, startPool, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.torquebox.core.runtime.RubyRuntimePool
getAvailable, getBorrowed, getMaximumInstances, getMinimumInstances, getName, getSize, isDeferredUntilRequested, isDrained, isLazy, isStarted, setDeferUntilRequested, setInstanceFactory, setMaximumInstances, setMinimumInstances, setNamespaceContextSelector, start, stop
 
Methods inherited from interface org.torquebox.core.runtime.BasicRubyRuntimePoolMBean
getAvailable, getBorrowed, getMaximumInstances, getMinimumInstances, getName, getSize, isLazy, isStarted, setMaximumInstances, setMinimumInstances
 

Constructor Detail

DefaultRubyRuntimePool

public DefaultRubyRuntimePool(RubyRuntimeFactory factory)
Construct with a factory.

Parameters:
factory - The factory to create interpreters.

DefaultRubyRuntimePool

public DefaultRubyRuntimePool()
Method Detail

borrowRuntime

public org.jruby.Ruby borrowRuntime(String requester)
                             throws Exception
Specified by:
borrowRuntime in interface RubyRuntimePool
Throws:
Exception

returnRuntime

public void returnRuntime(org.jruby.Ruby runtime)
Specified by:
returnRuntime in interface RubyRuntimePool

getRubyRuntimeFactory

public RubyRuntimeFactory getRubyRuntimeFactory()
Retrieve the interpreter factory.

Returns:
The interpreter factory.

evaluate

public Object evaluate(String code)
                throws Exception
Specified by:
evaluate in interface BasicRubyRuntimePoolMBean
Specified by:
evaluate in interface RubyRuntimePool
Throws:
Exception

getAllRuntimeNames

public Set<String> getAllRuntimeNames()
Specified by:
getAllRuntimeNames in interface BasicRubyRuntimePoolMBean
Specified by:
getAllRuntimeNames in interface RubyRuntimePool

duplicate

public RubyRuntimePool duplicate()
Specified by:
duplicate in interface RubyRuntimePool

TorqueBox 3.1.2

Copyright © 2015 JBoss by Red Hat. All Rights Reserved.