GigaSpaces XAP 7.0 API

org.openspaces.remoting.scripting.cache
Class BlockingQueueCompiledScriptPool

java.lang.Object
  extended by org.openspaces.remoting.scripting.cache.BlockingQueueCompiledScriptPool
All Implemented Interfaces:
CompiledScriptPool

public class BlockingQueueCompiledScriptPool
extends Object
implements CompiledScriptPool

A BlockingQueue script pool with a configurable size.

Upon initialization the pool compiles "size" scripts and puts it in the queue.

Author:
kimchy

Constructor Summary
BlockingQueueCompiledScriptPool(int size)
           
 
Method Summary
 void close()
          Closes the pool.
 Object get()
          Returns a compiled script from the pool.
 void init(LocalScriptExecutor executor, Script script)
          Inits the pool by compiling zero or more scripts.
 void put(Object compiledScript)
          Puts back a compiled script to the pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockingQueueCompiledScriptPool

public BlockingQueueCompiledScriptPool(int size)
Method Detail

init

public void init(LocalScriptExecutor executor,
                 Script script)
          throws ScriptingException
Description copied from interface: CompiledScriptPool
Inits the pool by compiling zero or more scripts. This is benefitial when we have a pool and we wish to initialize it with a pre set of compiled scripts.

Also, the local executor and the script can be store for later compilatation and shutdowm.

Specified by:
init in interface CompiledScriptPool
Parameters:
executor - The local script executor to compile the script and close it.
script - The script to compile.
Throws:
ScriptingException

get

public Object get()
           throws ScriptingException
Description copied from interface: CompiledScriptPool
Returns a compiled script from the pool.

Specified by:
get in interface CompiledScriptPool
Throws:
ScriptingException

put

public void put(Object compiledScript)
         throws ScriptingException
Description copied from interface: CompiledScriptPool
Puts back a compiled script to the pool.

Specified by:
put in interface CompiledScriptPool
Throws:
ScriptingException

close

public void close()
Description copied from interface: CompiledScriptPool
Closes the pool. Note, compiled scripts in the pool should be closed.

Specified by:
close in interface CompiledScriptPool

GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.