|
Oracle™ Business Intelligence Beans Java API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.dss.thin.beans.graph.PoolDispatcher | +--oracle.dss.thin.beans.graph.GraphPool
GraphPool can be used to manage a dynamically growing pool of graph objects. By reusing pooled graphs to render images for multiple users applications can improve scalability without sacrificing performance. GraphPool is built with an assumption that application does not hold on to the checked out instances, and that they are returned after a relatively short period of time.
To use a pooling service, application will need to instantiate GraphPool as a static variable or Servlet instance variable. Here is what happens when an instance of ThinGraph is needed to perform rendering:
It is good idea to perform steps 3 and 4 within a try{} block, and step 4 within finally{} to ensure that graphs get released even if some exceptions are thrown.
If used with GraphBean, an instance of ThinGraph should be provided to it as a BoundValue:
//when UIX Component tree is constructed: GraphBean graphNode = new GraphBean(); GraphNode.setGraphBinding(NAMESPACE, DATATANAME, GRAPH_SELECT_KEY); //when the UINode tree is rendered: ThinGraph graph = m_pool.getThinGraph(); DictionaryData data = new DictionaryData(); data.put(GRAPH_SELECT_KEY, graph); renderingContext.setDataObject(NAMESPACE, DATATANAME, data);
Application can customize pool is created and growing. The optimal parameters will depend on the number of concurrent requests and time needed to configure graph and perform rendering.
An instance of graph retrieved from a pool can be initialized with a graph definition stored within BI Beans Catalog. PersistenceNanager exposes a set of lookup() methods that take Persistable as a second parameter. To load graph definition into a pooled instance, supply it as Persistable to the lookup() call.
Application might choose to cache graph settings and data source loaded from BI Beans Catalogue. Since pooled graph objects are reused across user sessions, settings and data sources that are session-specific have to be stored independently from graph instances. Consider the following example:
//retrieve graph from the pool ThinGraph graph = m_graphPool.getThinGraph(); //load graph definition persistanceManager.lookup("folder/mygraph", graph); //get graph settings and its datasource String xml = graph.getXMLAsString(); DataSource ds = graph.getDataSource(); //store session-specific settings and data source on HTTP session: httpSession.setAttribute(GRAPH_XML, xml); httpSession.setAttribute(GRAPH_DATASOURCE, ds);
Fields inherited from class oracle.dss.thin.beans.graph.PoolDispatcher |
DEF_INITIAL_SIZE, DEF_INSTANCE_INCR, DEF_MAX_SIZE, DEF_NORM_SIZE, DEF_QUEUE_RATIO |
Constructor Summary | |
GraphPool() Default Constructor. | |
GraphPool(java.lang.ClassLoader threadClassLoader) Constructor. | |
GraphPool(int init_size, int norm_size, int max_size, int inst_incr, float queue_ratio) Constructor. | |
GraphPool(int init_size, int norm_size, int max_size, int inst_incr, float queue_ratio, java.lang.ClassLoader threadClassLoader) Constructor. |
Method Summary | |
ThinGraph |
getThinGraph() Retrieves an instance of ThinGraph from a pool. |
void |
release(java.lang.Object obj) Returns a thin graph to the pool after resetting all of its properties |
void |
release(java.lang.Object obj, boolean fReset) Returns a thin graph to the pool |
Methods inherited from class oracle.dss.thin.beans.graph.PoolDispatcher |
cleanup, dump, get |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GraphPool()
PoolDispatcher.DEF_INITIAL_SIZE
, PoolDispatcher.DEF_NORM_SIZE
, PoolDispatcher.DEF_MAX_SIZE
, PoolDispatcher.DEF_INSTANCE_INCR
, PoolDispatcher.DEF_QUEUE_RATIO
public GraphPool(java.lang.ClassLoader threadClassLoader)
threadClassLoader
- class loader used in the thread that allocates new GraphsPoolDispatcher.DEF_INITIAL_SIZE
, PoolDispatcher.DEF_NORM_SIZE
, PoolDispatcher.DEF_MAX_SIZE
, PoolDispatcher.DEF_INSTANCE_INCR
, PoolDispatcher.DEF_QUEUE_RATIO
public GraphPool(int init_size, int norm_size, int max_size, int inst_incr, float queue_ratio, java.lang.ClassLoader threadClassLoader)
init_size
- The number of pooled objects allocated when pool is creatednorm_size
- The number of pooled objects that should remain allocated when there are no outstanding requestsmax_size
- Maximum number of pooled objects to be allocatedinst_incr
- Number of instances allocated at once when pool is growingqueue_ratio
- A ratio between the number of outstanding requests and and the total number of pooled obejcts when the pool should start growingthreadClassLoader
- class loader used in the thread that allocates new Graphspublic GraphPool(int init_size, int norm_size, int max_size, int inst_incr, float queue_ratio)
init_size
- The number of pooled objects allocated when pool is creatednorm_size
- The number of pooled objects that should remain allocated when there are no outstanding requestsmax_size
- Maximum number of pooled objects to be allocatedinst_incr
- Number of instances allocated at once when pool is growingqueue_ratio
- A ratio between the number of outstanding requests and and the total number of pooled obejcts when the pool should start growingMethod Detail |
public ThinGraph getThinGraph()
public void release(java.lang.Object obj)
release
in class PoolDispatcher
An
- instance of graph to be returnedpublic void release(java.lang.Object obj, boolean fReset)
obj
- An instance of graph to be returnedfReset
- A flag indicating whether all graph properties should be reset to defaults
|
Oracle™ Business Intelligence Beans Java API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |