com.sun.grizzly.jruby
Class RubyRuntimeAsyncFilter

java.lang.Object
  extended by com.sun.grizzly.jruby.RubyRuntimeAsyncFilter
All Implemented Interfaces:
AsyncFilter

public class RubyRuntimeAsyncFilter
extends Object
implements AsyncFilter

AsyncFilter that park the request if the number of Ruby runtime are all in use.

Author:
Jeanfrancois Arcand

Constructor Summary
RubyRuntimeAsyncFilter()
          Default AsynFilter constructor.
 
Method Summary
 boolean doFilter(AsyncExecutor asyncExecutor)
          If we know we gonna run out of ruby runtime, suspend the request and release the current thread.
protected  void resume()
          Resume a request that has been suspended because we run out of ruby runtime.
protected  void setRubyRuntimeQueue(BlockingQueue<?> rubyRuntimeQueue)
          The current ruby queue from the RubyObjectPool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RubyRuntimeAsyncFilter

public RubyRuntimeAsyncFilter()
Default AsynFilter constructor.

Method Detail

doFilter

public boolean doFilter(AsyncExecutor asyncExecutor)
If we know we gonna run out of ruby runtime, suspend the request and release the current thread. The request will be resumed as soon as the RailsAdapter terminate handling the request.

Specified by:
doFilter in interface AsyncFilter
Parameters:
asyncExecutor -
Returns:
true if the request can execute, false if it need to be suspended.

setRubyRuntimeQueue

protected void setRubyRuntimeQueue(BlockingQueue<?> rubyRuntimeQueue)
The current ruby queue from the RubyObjectPool.

Parameters:
rubyRuntimeQueue -

resume

protected void resume()
Resume a request that has been suspended because we run out of ruby runtime.



Copyright © 2010 SUN Microsystems. All Rights Reserved.