com.sun.grizzly.jruby
Class RubyObjectPool

java.lang.Object
  extended by com.sun.grizzly.jruby.RubyObjectPool

public class RubyObjectPool
extends Object

An object pool for ruby runtime.

Author:
TAKAI Naoto, Pramod Gopinath

Constructor Summary
RubyObjectPool()
           
 
Method Summary
 org.jruby.Ruby borrowRuntime()
          Retrives ruby runtime from the object pool.
 String getJrubyLib()
          Gets JRUBY_LIB directory.
 int getNumberOfRuntime()
          Gets the number of directory.
 String getRailsRoot()
          Gets RAILS_ROOT directory.
protected  BlockingQueue<org.jruby.Ruby> getRubyRuntimeQueue()
           
protected  org.jruby.Ruby initializeRubyRuntime()
           
 boolean isAsyncEnabled()
           
protected  void loadRubyLibraries(org.jruby.Ruby runtime)
           
 void returnRuntime(org.jruby.Ruby runtime)
          Returns runtime to the object pool.
 void setAsyncEnabled(boolean asyncEnabled)
           
 void setJrubyLib(String jrubyLib)
          Sets JRUBY_LIB directory.
 void setNumberOfRuntime(int numberOfRuntime)
          Sets the number of pooling runtime.
 void setRailsRoot(String railsRoot)
          Sets RAILS_ROOT directory.
 void start()
          Starts the object pool.
 void stop()
          Shutdowns the object pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RubyObjectPool

public RubyObjectPool()
Method Detail

borrowRuntime

public org.jruby.Ruby borrowRuntime()
Retrives ruby runtime from the object pool.

Returns:
JRuby runtime.

returnRuntime

public void returnRuntime(org.jruby.Ruby runtime)
Returns runtime to the object pool.

Parameters:
runtime - - JRuby Rails runtime

setJrubyLib

public void setJrubyLib(String jrubyLib)
Sets JRUBY_LIB directory.

Parameters:
jrubyLib - JRUBY_LIB directory.

setNumberOfRuntime

public void setNumberOfRuntime(int numberOfRuntime)
Sets the number of pooling runtime.

Parameters:
numberOfRuntime - the number of runtime.

setRailsRoot

public void setRailsRoot(String railsRoot)
Sets RAILS_ROOT directory.

Parameters:
railsRoot - RAILS_ROOT directory.

start

public void start()
Starts the object pool.


stop

public void stop()
Shutdowns the object pool.


initializeRubyRuntime

protected org.jruby.Ruby initializeRubyRuntime()

loadRubyLibraries

protected void loadRubyLibraries(org.jruby.Ruby runtime)

getJrubyLib

public String getJrubyLib()
Gets JRUBY_LIB directory.

Returns:
JRUBY_LIB directory.

getNumberOfRuntime

public int getNumberOfRuntime()
Gets the number of directory.

Returns:
the number of directory;

getRailsRoot

public String getRailsRoot()
Gets RAILS_ROOT directory.

Returns:
RAILS_ROOT directory.

getRubyRuntimeQueue

protected BlockingQueue<org.jruby.Ruby> getRubyRuntimeQueue()

isAsyncEnabled

public boolean isAsyncEnabled()

setAsyncEnabled

public void setAsyncEnabled(boolean asyncEnabled)


Copyright © 2010 SUN Microsystems. All Rights Reserved.